From joe.darcy at oracle.com Mon Jul 1 00:09:34 2013 From: joe.darcy at oracle.com (Joe Darcy) Date: Sun, 30 Jun 2013 17:09:34 -0700 Subject: JDK 8 code review request for doclint fixes in java.util.jar.Pack200 In-Reply-To: <51D0C321.90409@oracle.com> References: <51D0BD4D.1050708@oracle.com> <51D0C321.90409@oracle.com> Message-ID: <51D0C8BE.2060406@oracle.com> Hi Kumar, On 06/30/2013 04:45 PM, Kumar Srinivasan wrote: > Hi Joe, > > The changes looks good, thanks for doing this!. I should've peeked at > the generated reports. :-[ The changes look fine according to specdiff too. > > But, there are 2 more errors j.u.j.Attributes.java and some missing > @throws for j.u.j.JarEntry.java, are you planning on doing this > separately ? I am actually hoping for someone else to do them separately ;-) At least one of the missing @throws should probably be addressed by removing the throws clause from the method, which requires some more investigation and a ccc request. Thanks, -Joe > > Thanks > > Kumar > > >> Hello, >> >> Pack200 has some doclint issues; please review the fixes to them below. >> >> Thanks, >> >> -Joe >> >> --- a/src/share/classes/java/util/jar/Pack200.java Sun Jun 30 >> 16:02:11 2013 -0700 >> +++ b/src/share/classes/java/util/jar/Pack200.java Sun Jun 30 >> 16:19:25 2013 -0700 >> @@ -1,5 +1,5 @@ >> /* >> - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All >> rights reserved. >> + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All >> rights reserved. >> * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. >> * >> * This code is free software; you can redistribute it and/or modify it >> @@ -112,7 +112,7 @@ >> // Static methods of the Pack200 class. >> /** >> * Obtain new instance of a class that implements Packer. >> - * >> + * >> * >> *

Note: The returned object is not guaranteed to operate >> * correctly if multiple threads use it at the same time. >> @@ -137,7 +138,7 @@ >> >> /** >> * Obtain new instance of a class that implements Unpacker. >> - * >> + *

>> * >> *

Note: The returned object is not guaranteed to operate >> * correctly if multiple threads use it at the same time. >> @@ -350,14 +352,14 @@ >> * directory will be passed also. >> *

>> * Examples: >> - *


>> +         * 
{@code
>>           *     Map p = packer.properties();
>>           *     p.put(PASS_FILE_PFX+0, "mutants/Rogue.class");
>>           *     p.put(PASS_FILE_PFX+1, "mutants/Wolverine.class");
>>           *     p.put(PASS_FILE_PFX+2, "mutants/Storm.class");
>>           *     # Pass all files in an entire directory hierarchy:
>>           *     p.put(PASS_FILE_PFX+3, "police/");
>> -         * 
. >> + * }
>> */ >> String PASS_FILE_PFX = "pack.pass.file."; >> >> @@ -378,12 +380,12 @@ >> * This is the default value for this property. >> *

>> * Examples: >> - *


>> +         * 
{@code
>>           *     Map p = pack200.getProperties();
>>           *     p.put(UNKNOWN_ATTRIBUTE, ERROR);
>>           *     p.put(UNKNOWN_ATTRIBUTE, STRIP);
>>           *     p.put(UNKNOWN_ATTRIBUTE, PASS);
>> -         * 
>> + * }
>> */ >> String UNKNOWN_ATTRIBUTE = "pack.unknown.attribute"; >> > From david.holmes at oracle.com Mon Jul 1 00:43:14 2013 From: david.holmes at oracle.com (David Holmes) Date: Mon, 01 Jul 2013 10:43:14 +1000 Subject: RFR (XS): 8014890 : Reference queues may return more entries than expected In-Reply-To: <1371589723.2524.43.camel@cirrus> References: <1371589723.2524.43.camel@cirrus> Message-ID: <51D0D0A2.7030307@oracle.com> Hi Thomas, Sorry for the delay in looking into this deeper but I've been OOTO a bit this past week. I'm backing up to the start to explore the apparent problem ... On 19/06/2013 7:08 AM, Thomas Schatzl wrote: > Hi all, > > can I have reviews for the following change? > > It happens if multiple threads are enqueuing and dequeuing reference > objects into a reference queue, that Reference objects may be enqueued > at multiple times. > > This is because when java.lang.ref.ReferenceQueue.poll() returns and > inactivates a Reference object, another thread may just be during > enqueuing it again. > > In the test case provided, the two threads that conflict are the > reference handler thread and the program (main) thread. > > Relevant code: > > ReferenceHandlerThread.run(): > > 0: [...] > 1: ReferenceQueue q = r.queue; // r is the reference > 2: if (r != ReferenceQueue.NULL) > 3: q.enqueue(). > > ReferenceQueue::poll()(reallyPoll()) code (I removed lots of code here) > > 1: synchronized(lock) { > 2: [...] > 3: r.queue = ReferenceQueue.NULL; > 3:} > > I.e. while ReferenceQueue.poll() sets the Reference's queue to the NULL > queue so that that reference will not be enqueued again (or at most into > the NULL queue which is a nop), it happens that if the task switch > occurs between lines 2 and 3 of the reference handler thread, q still > contains the old queue reference, and the reference handler thread will > enqueue the Reference into the original queue again. Let's set some initial conditions here. For poll() to remove 'r' it must already have been enqueued on this queue. That means that r.queue == ENQUEUED. That means the ReferenceHandler thread would actually enqueue it to the ENQUEUED instance - which is harmless. So it seems to me that we must have a race between two enqueue attempts for a problem to arise here. So lets assume that there is a concurrent r.enqueue() with the reference handlers attempt to enqueue, and a poll() is mixed in. Consider the following: refThread reads target q: ReferenceQueue q = r.queue; // r is the reference if (r != ReferenceQueue.NULL) (Note: the check for NULL is at best an optimization; it isn't needed) Thread_1 does r.enqueue() So r.queue == ENQUEUED Thread_2 does q.poll() and removes r. r.queue == NULL refThread continues and executes: q.enqueue(r) and so we have enqueued 'r' twice. Which seems to be the problem scenario observed by the test, as we can then poll() and get 'r' a second time. But is it actually a problem if this happens? If I have two concurrent attempts to enqueue a reference and concurrent attempt to dequeue it (via poll) it seems quite plausible to see: enqueue, poll, enqueue - and so the reference ends up in the queue. The test program is of the form: for (int i = 0; i < iterations; i++) { queue = new ReferenceQueue(); for (int j = 0; j < refs.length; j++) { refs[j] = new WeakReference(new Object(), queue); } System.gc(); // enqueues references into the list of discovered references // now manually enqueue all of them for (int j = 0; j < refs.length; j++) { refs[j].enqueue(); } // and get them back. There should be exactly numReferences // entries in the queue now. int foundReferences = 0; while (queue.poll() != null) { foundReferences++; } and naively we would assume that until the enqueue loop is complete (at which point all refs are enqueued) then the ReferenceHandler thread will not process any of those references as they are still strongly reachable. If it processes them after then it is a no-op and either way the poll() will find the exact number of references enqueued. But that is not guaranteed to happen. As JLS 12.6.1 states: "Optimizing transformations of a program can be designed that reduce the number of objects that are reachable to be less than those which would naively be considered reachable." So in fact we might find that one or more references are no longer reachable before their enqueue() operation is invoked and so consequently we can indeed get this race between the reference handler's attempt to enqueue and the test programs attempt to enqueue. I would say this is a bug in the test program as it needs to ensure that the references are guaranteed to be strongly reachable until after they have had enqueue() invoked. So your proposed fix really just masks the invalid assumption that a ReferenceHandler based enqueue and a direct r.enqueue can't possibly be concurrent. Let's consider the case of two concurrent r.enqueue() calls, with an interleaving poll(). Because Reference.enqueue lacks synchronization on the reference while reading the queue you can get an interleaving where the second enqueue() might see NULL, ENQUEUED or the actual queue depending on the timing. I don't see any issue that requires a code change. Only an omniscient observer can determine the exact order in which the two enqueue()'s and the poll() occur, so pretty much any outcome is valid. So I don't think there is actually a bug in the reference code per-se, at least not in relation to this test program. Now the synchronization is still "all over the place". There are races due to lack of synchronized (the ref should be locked whenever any of its fields, ie queue & next, are modified), and lack of volatile on fields accessed without synchronization. But whether any of those races are actually a bug is a separate matter and very difficult to determine. Bugs would arise where multi-field invariants are violated due to lack of sync, but AFAICS that does not occur. Even JMM issues, reading stale fields, don't seem to cause any problem here. Cheers, David ----- > You can achieve the same effect by simply calling > ReferenceQueue.enqueue() (i.e. without the reference handler thread, or > within the reference handler thread doing the != NULL check), it's just > that in such a case the "old" ReferenceQueue is stored in some register. > > The guard for ReferenceQueue.NULL does not have any effect except for > possibly saving the virtual call. Simply calling r.enqueue() exhibits > the same problem. > > The proposed solution is to filter out References within > ReferenceQueue.enqueue() again. At that point we can check whether the > given Reference is actually meant for this queue or not. Already removed > References are known to be "inactive" (as enqueue and poll are mutually > exclusive using a lock), in particular the References' queue is > different (actually the NULL queue) to the queue it is being enqueued. > > This change should pose no change in semantics, as the ReferenceQueue of > the Reference can only be set in its constructor, and as soon as the > Reference is removed from a ReferenceQueue, its ReferenceQueue will be > the NULL queue. (I.e. before this change you could not enqueue such an > "inactive" Reference multiple times anyway) > > (too many References and queues here :) > > Webrev with test case > http://cr.openjdk.java.net/~tschatzl/8014890/webrev/ > > JIRA: > https://jbs.oracle.com/bugs/browse/JDK-8014890 > > bugs.sun.com > http://bugs.sun.com/view_bug.do?bug_id=8014890 > > Testing: > jck, jprt, manual testing > > Note that I also need a sponsor to push in case this change is approved. > > Thanks, > Thomas > From joe.darcy at oracle.com Mon Jul 1 00:16:04 2013 From: joe.darcy at oracle.com (joe.darcy at oracle.com) Date: Mon, 01 Jul 2013 00:16:04 +0000 Subject: hg: jdk8/tl/jdk: 8019467: Fix doclint issues in java.util.jar.Pack200 Message-ID: <20130701001616.1999A486AE@hg.openjdk.java.net> Changeset: 9eaeb1a0aa46 Author: darcy Date: 2013-06-30 17:15 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/9eaeb1a0aa46 8019467: Fix doclint issues in java.util.jar.Pack200 Reviewed-by: lancea, ksrini ! src/share/classes/java/util/jar/Pack200.java From Alan.Bateman at oracle.com Mon Jul 1 06:11:40 2013 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Mon, 01 Jul 2013 07:11:40 +0100 Subject: Error in Javadoc for DatabaseMetaData In-Reply-To: <214DD60F-F0B4-4A56-BF6E-A91EF38D283F@nicholaswilliams.net> References: <214DD60F-F0B4-4A56-BF6E-A91EF38D283F@nicholaswilliams.net> Message-ID: <51D11D9C.7010804@oracle.com> On 30/06/2013 22:26, Nick Williams wrote: > In java.sql.DatabaseMetaData, the Javadoc for supportsResultSetHoldability fails to properly close a tag, and so everything following that method is monospace. To be precise: > > ResultSet.CLOSE_CURSORS_AT_COMMIT > > However, it should be: > > ResultSet.CLOSE_CURSORS_AT_COMMIT > > Nick > This was fixed recently along with many other javadoc issues, see: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/b9ba04dc210f -Alan From zhangshj at linux.vnet.ibm.com Mon Jul 1 07:43:31 2013 From: zhangshj at linux.vnet.ibm.com (Shi Jun Zhang) Date: Mon, 01 Jul 2013 15:43:31 +0800 Subject: RFR: 8019381: HashMap.isEmpty is non-final, potential issues for get/remove In-Reply-To: <51CDB453.5010003@linux.vnet.ibm.com> References: <51CBF181.1020301@linux.vnet.ibm.com> <51CCAAE5.4010707@univ-mlv.fr> <51CD896D.9030807@oracle.com> <51CDB453.5010003@linux.vnet.ibm.com> Message-ID: <51D13323.9030601@linux.vnet.ibm.com> On 6/29/2013 12:05 AM, Shi Jun Zhang wrote: > On 6/28/2013 9:02 PM, Alan Bateman wrote: >> On 27/06/2013 22:13, Remi Forax wrote: >>> On 06/27/2013 10:02 AM, Shi Jun Zhang wrote: >>>> Hi, >>>> >>>> There are some isEmpty() check added into get/remove methods since >>>> 8011200 to return directly if HashMap is empty. However isEmpty is >>>> a non-final public method which can be overridden by subclass. If >>>> the subclass defines isEmpty differently from HashMap, it would >>>> cause problem while getting or removing elements. >>> >>> yes, it's a bug. >>> Could you report it ? >>> >>> R?mi >> I've created a bug to track this: >> >> 8019381: HashMap.isEmpty is non-final, potential issues for get/remove >> >> -Alan >> > Thanks, Alan. > > I'm quite busy today and do not have time to report it until now. > Thanks for your help. > > I will provide a webrev next Monday for review. > Hi, Here is the webrev http://cr.openjdk.java.net/~zhangshj/8019381/webrev.00/ -- Regards, Shi Jun Zhang From david.holmes at oracle.com Mon Jul 1 07:51:27 2013 From: david.holmes at oracle.com (David Holmes) Date: Mon, 01 Jul 2013 17:51:27 +1000 Subject: RFR (XS): 8014890 : Reference queues may return more entries than expected In-Reply-To: <51D0D0A2.7030307@oracle.com> References: <1371589723.2524.43.camel@cirrus> <51D0D0A2.7030307@oracle.com> Message-ID: <51D134FF.2080802@oracle.com> Well you can ignore what I wrote below - sorry. Somehow I got it in my head that multiple enqueue's were intended/supported when of course they are not. :( So the proposed fix is okay - though I'd simplify the comment to just: // Check that since getting the lock this reference hasn't already been // enqueued (and even then removed) The synchronization is problematic as I mention below but there is no easy fix due to the lock-ordering problem, and any attempt at such a fix would be much riskier. So this fix is fine - thanks. David ----- On 1/07/2013 10:43 AM, David Holmes wrote: > Hi Thomas, > > Sorry for the delay in looking into this deeper but I've been OOTO a bit > this past week. > > I'm backing up to the start to explore the apparent problem ... > > On 19/06/2013 7:08 AM, Thomas Schatzl wrote: >> Hi all, >> >> can I have reviews for the following change? >> >> It happens if multiple threads are enqueuing and dequeuing reference >> objects into a reference queue, that Reference objects may be enqueued >> at multiple times. >> >> This is because when java.lang.ref.ReferenceQueue.poll() returns and >> inactivates a Reference object, another thread may just be during >> enqueuing it again. >> >> In the test case provided, the two threads that conflict are the >> reference handler thread and the program (main) thread. >> >> Relevant code: >> >> ReferenceHandlerThread.run(): >> >> 0: [...] >> 1: ReferenceQueue q = r.queue; // r is the reference >> 2: if (r != ReferenceQueue.NULL) >> 3: q.enqueue(). >> >> ReferenceQueue::poll()(reallyPoll()) code (I removed lots of code here) >> >> 1: synchronized(lock) { >> 2: [...] >> 3: r.queue = ReferenceQueue.NULL; >> 3:} >> >> I.e. while ReferenceQueue.poll() sets the Reference's queue to the NULL >> queue so that that reference will not be enqueued again (or at most into >> the NULL queue which is a nop), it happens that if the task switch >> occurs between lines 2 and 3 of the reference handler thread, q still >> contains the old queue reference, and the reference handler thread will >> enqueue the Reference into the original queue again. > > Let's set some initial conditions here. For poll() to remove 'r' it must > already have been enqueued on this queue. That means that r.queue == > ENQUEUED. That means the ReferenceHandler thread would actually enqueue > it to the ENQUEUED instance - which is harmless. > > So it seems to me that we must have a race between two enqueue attempts > for a problem to arise here. So lets assume that there is a concurrent > r.enqueue() with the reference handlers attempt to enqueue, and a poll() > is mixed in. Consider the following: > > refThread reads target q: > > ReferenceQueue q = r.queue; // r is the reference > if (r != ReferenceQueue.NULL) > > (Note: the check for NULL is at best an optimization; it isn't needed) > > Thread_1 does r.enqueue() > > So r.queue == ENQUEUED > > Thread_2 does q.poll() and removes r. > > r.queue == NULL > > refThread continues and executes: > > q.enqueue(r) > > and so we have enqueued 'r' twice. Which seems to be the problem > scenario observed by the test, as we can then poll() and get 'r' a > second time. > > But is it actually a problem if this happens? If I have two concurrent > attempts to enqueue a reference and concurrent attempt to dequeue it > (via poll) it seems quite plausible to see: enqueue, poll, enqueue - and > so the reference ends up in the queue. The test program is of the form: > > for (int i = 0; i < iterations; i++) { > queue = new ReferenceQueue(); > > for (int j = 0; j < refs.length; j++) { > refs[j] = new WeakReference(new Object(), queue); > } > > System.gc(); // enqueues references into the list of > discovered references > > // now manually enqueue all of them > for (int j = 0; j < refs.length; j++) { > refs[j].enqueue(); > } > // and get them back. There should be exactly > numReferences > // entries in the queue now. > int foundReferences = 0; > while (queue.poll() != null) { > foundReferences++; > } > > and naively we would assume that until the enqueue loop is complete (at > which point all refs are enqueued) then the ReferenceHandler thread will > not process any of those references as they are still strongly > reachable. If it processes them after then it is a no-op and either way > the poll() will find the exact number of references enqueued. > > But that is not guaranteed to happen. As JLS 12.6.1 states: > > "Optimizing transformations of a program can be designed that reduce the > number of objects that are reachable to be less than those which would > naively be considered reachable." > > So in fact we might find that one or more references are no longer > reachable before their enqueue() operation is invoked and so > consequently we can indeed get this race between the reference handler's > attempt to enqueue and the test programs attempt to enqueue. I would say > this is a bug in the test program as it needs to ensure that the > references are guaranteed to be strongly reachable until after they have > had enqueue() invoked. > > So your proposed fix really just masks the invalid assumption that a > ReferenceHandler based enqueue and a direct r.enqueue can't possibly be > concurrent. > > Let's consider the case of two concurrent r.enqueue() calls, with an > interleaving poll(). Because Reference.enqueue lacks synchronization on > the reference while reading the queue you can get an interleaving where > the second enqueue() might see NULL, ENQUEUED or the actual queue > depending on the timing. I don't see any issue that requires a code > change. Only an omniscient observer can determine the exact order in > which the two enqueue()'s and the poll() occur, so pretty much any > outcome is valid. > > So I don't think there is actually a bug in the reference code per-se, > at least not in relation to this test program. > > Now the synchronization is still "all over the place". There are races > due to lack of synchronized (the ref should be locked whenever any of > its fields, ie queue & next, are modified), and lack of volatile on > fields accessed without synchronization. But whether any of those races > are actually a bug is a separate matter and very difficult to determine. > Bugs would arise where multi-field invariants are violated due to lack > of sync, but AFAICS that does not occur. Even JMM issues, reading stale > fields, don't seem to cause any problem here. > > Cheers, > David > ----- > > > >> You can achieve the same effect by simply calling >> ReferenceQueue.enqueue() (i.e. without the reference handler thread, or >> within the reference handler thread doing the != NULL check), it's just >> that in such a case the "old" ReferenceQueue is stored in some register. >> >> The guard for ReferenceQueue.NULL does not have any effect except for >> possibly saving the virtual call. Simply calling r.enqueue() exhibits >> the same problem. >> >> The proposed solution is to filter out References within >> ReferenceQueue.enqueue() again. At that point we can check whether the >> given Reference is actually meant for this queue or not. Already removed >> References are known to be "inactive" (as enqueue and poll are mutually >> exclusive using a lock), in particular the References' queue is >> different (actually the NULL queue) to the queue it is being enqueued. >> >> This change should pose no change in semantics, as the ReferenceQueue of >> the Reference can only be set in its constructor, and as soon as the >> Reference is removed from a ReferenceQueue, its ReferenceQueue will be >> the NULL queue. (I.e. before this change you could not enqueue such an >> "inactive" Reference multiple times anyway) >> >> (too many References and queues here :) >> >> Webrev with test case >> http://cr.openjdk.java.net/~tschatzl/8014890/webrev/ >> >> JIRA: >> https://jbs.oracle.com/bugs/browse/JDK-8014890 >> >> bugs.sun.com >> http://bugs.sun.com/view_bug.do?bug_id=8014890 >> >> Testing: >> jck, jprt, manual testing >> >> Note that I also need a sponsor to push in case this change is approved. >> >> Thanks, >> Thomas >> From Alan.Bateman at oracle.com Mon Jul 1 07:59:21 2013 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Mon, 01 Jul 2013 08:59:21 +0100 Subject: JDK 8 code review request for doclint cleanup of javax.naming.* In-Reply-To: References: <51CDCDEE.8000103@oracle.com> Message-ID: <51D136D9.5080405@oracle.com> On 28/06/2013 19:13, Lance Andersen - Oracle wrote: > Hi Joe, > > Looks good. > > fwiw, I was able to use H3 vs H1 tags to make doclint accessibility happy. Not sure if it matters below but thought I would point it out if you want a smaller heading > I think this is worth checking into because changing some of these to h1 results in headings that are out of proportion to the importance or the original intention. I don't know if this is standard doclint issue or something else. -Alan. From huizhe.wang at oracle.com Mon Jul 1 08:09:23 2013 From: huizhe.wang at oracle.com (huizhe wang) Date: Mon, 01 Jul 2013 01:09:23 -0700 Subject: RFR: JAXP 1.5 for JDK8/7u40: 8016648: FEATURE_SECURE_PROCESSING set to true or false causes SAXParseException to be thrown Message-ID: <51D13933.8090901@oracle.com> Hi, There have been two revisions in JAXP 1.5 specification: 1) the relationship between the JAXP 1.5 properties and FEATURE_SECURE_PROCESSING (FSP) is now a recommendation. It is up to the implementation to decide if it wants to restrict when FSP is set. 2) System properties will override that may have been set by FSP. In the following patch, a JDK version detection code is added so that when FSP is set explicitly, for JDK7, there will be no restrictions, but for JDK8 and above, the restrictions are on. The effective order is changed so that JAXP 1.5 defined system properties will override that may be set by enabling FSP. Please review: http://cr.openjdk.java.net/~joehw/jdk8/8016648/webrev/ Note that the patch is identical for JDK7 and 8, and I plan to ask approval for 7u40 integration. Thanks, Joe From aleksey.shipilev at oracle.com Mon Jul 1 08:27:27 2013 From: aleksey.shipilev at oracle.com (Aleksey Shipilev) Date: Mon, 01 Jul 2013 12:27:27 +0400 Subject: Refresh - Java 8 RFR 8017540: Improve multi-threaded contention behavior of BigInteger.toString() radix conversion cache In-Reply-To: References: Message-ID: <51D13D6F.6010109@oracle.com> On 06/28/2013 10:24 PM, Brian Burkhalter wrote: > http://cr.openjdk.java.net/~bpb/8017540/ Thumbs up. -Aleksey. N.B.: You can put me in with "Reviewed-by: shade". From paul.sandoz at oracle.com Mon Jul 1 09:22:39 2013 From: paul.sandoz at oracle.com (Paul Sandoz) Date: Mon, 1 Jul 2013 11:22:39 +0200 Subject: RFR: 8015315: Stream.concat methods In-Reply-To: <51CE3142.60800@oracle.com> References: <51CE3142.60800@oracle.com> Message-ID: Hi Henry, On Jun 29, 2013, at 2:58 AM, Henry Jen wrote: > Hi, > > Please review the webrev that add concat static method to Stream and > primitive Streams. > > http://cr.openjdk.java.net/~henryjen/ccc/8015315.0/webrev/ > Non test-code looks good. Now that LongStream.range uses concat you need to uncomment the tests in RangeTest. In ConcatOpTest: You could do the prerequisite assertion tests in the constructor since the map operation and parallel methods are not affected by the type of the stream. Then for each testXXXConcat you can avoid repeating mapToXxx by doing that in a assertXxxConcat method, and the assertion on the characteristics and contents can be shared between all types. See end of email for an example. -- I notice some exceptions output from testng: [testng] java.lang.ClassNotFoundException: org/openjdk/tests/java/util/stream/ConcatOpTest [testng] at java.lang.Class.forName0(Native Method) [testng] at java.lang.Class.forName(Class.java:258) [testng] at org.testng.internal.ClassHelper.getEnclosingClass(ClassHelper.java:427) [testng] at org.testng.internal.ClassHelper.createInstance1(ClassHelper.java:349) [testng] at org.testng.internal.ClassHelper.createInstance(ClassHelper.java:299) [testng] at org.testng.internal.ClassImpl.getDefaultInstance(ClassImpl.java:110) [testng] at org.testng.internal.ClassImpl.getInstances(ClassImpl.java:186) [testng] at org.testng.internal.TestNGClassFinder.(TestNGClassFinder.java:120) [testng] at org.testng.TestRunner.initMethods(TestRunner.java:409) [testng] at org.testng.TestRunner.init(TestRunner.java:235) [testng] at org.testng.TestRunner.init(TestRunner.java:205) [testng] at org.testng.TestRunner.(TestRunner.java:153) [testng] at org.testng.SuiteRunner$DefaultTestRunnerFactory.newTestRunner(SuiteRunner.java:522) [testng] at org.testng.SuiteRunner.init(SuiteRunner.java:157) [testng] at org.testng.SuiteRunner.(SuiteRunner.java:111) [testng] at org.testng.TestNG.createSuiteRunner(TestNG.java:1273) [testng] at org.testng.TestNG.createSuiteRunners(TestNG.java:1260) [testng] at org.testng.TestNG.runSuitesLocally(TestNG.java:1114) [testng] at org.testng.TestNG.run(TestNG.java:1031) [testng] at org.testng.TestNG.privateMain(TestNG.java:1338) [testng] at org.testng.TestNG.main(TestNG.java:1307) It does not seem to affect test execution and appears to be caused by the inner class used for your clever combination of a data provider and a factory. -- Just pointing out the following more for interest/education. The tests for unordered are OK, but the concat implementation could if there were any benefit decide to do something different if both streams are unordered e.g. there is no difference if the concatenation is b::a rather than a::b. If so that would break the tests. Let's fix 'em if in the unlikely event we ever get to that point :-) Paul. private void assertConcatContents(Spliterator s, boolean ordered, Spliterator expected) { // concat stream cannot guarantee uniqueness assertFalse(s.hasCharacteristics(Spliterator.DISTINCT), scenario); // concat stream cannot guarantee sorted assertFalse(s.hasCharacteristics(Spliterator.SORTED), scenario); // concat stream is ordered if bothe are ordered assertEquals(s.hasCharacteristics(Spliterator.ORDERED), ordered, scenario); // Verify elements assertEquals(toBoxedList(s), toBoxedList(expected), scenario); } private void assertDoubleConcat(Stream s1, Stream s2, boolean parallel, boolean ordered) { DoubleStream result = DoubleStream.concat(s1.mapToDouble(Integer::doubleValue), s2.mapToDouble(Integer::doubleValue)); assertEquals(result.isParallel(), parallel); assertConcatContents(result.spliterator(), ordered, expected.stream().mapToDouble(Integer::doubleValue).spliterator()); } public void testDoubleConcat() { // sequential + sequential -> sequential assertDoubleConcat(c1.stream(), c2.stream(), false, true); // parallel + parallel -> parallel assertDoubleConcat(c1.parallelStream(), c2.parallelStream(), true, true); // sequential + parallel -> parallel assertDoubleConcat(c1.stream(), c2.parallelStream(), true, true); // parallel + sequential -> parallel assertDoubleConcat(c1.parallelStream(), c2.stream(), true, true); // not ordered assertDoubleConcat(c1.stream().unordered(), c2.stream(), false, false); assertDoubleConcat(c1.stream(), c2.stream().unordered(), false, false); assertDoubleConcat(c1.parallelStream().unordered(), c2.stream().unordered(), true, false); } From daniel.fuchs at oracle.com Mon Jul 1 09:27:19 2013 From: daniel.fuchs at oracle.com (daniel.fuchs at oracle.com) Date: Mon, 01 Jul 2013 09:27:19 +0000 Subject: hg: jdk8/tl/jdk: 8014045: test/java/lang/management/PlatformLoggingMXBean/LoggingMXBeanTest.java failing intermittently Message-ID: <20130701092807.71C8C486BA@hg.openjdk.java.net> Changeset: 3aa541b50a64 Author: dfuchs Date: 2013-07-01 11:13 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/3aa541b50a64 8014045: test/java/lang/management/PlatformLoggingMXBean/LoggingMXBeanTest.java failing intermittently Summary: this test was failing because it didn't take into account the fact that Loggers could be garbage collected. Reviewed-by: mchung ! test/java/lang/management/PlatformLoggingMXBean/LoggingMXBeanTest.java From forax at univ-mlv.fr Mon Jul 1 09:52:40 2013 From: forax at univ-mlv.fr (Remi Forax) Date: Mon, 01 Jul 2013 11:52:40 +0200 Subject: RFR: 8015315: Stream.concat methods In-Reply-To: <51CE3142.60800@oracle.com> References: <51CE3142.60800@oracle.com> Message-ID: <51D15168.2020403@univ-mlv.fr> On 06/29/2013 02:58 AM, Henry Jen wrote: > Hi, > > Please review the webrev that add concat static method to Stream and > primitive Streams. > > http://cr.openjdk.java.net/~henryjen/ccc/8015315.0/webrev/ > > Cheers, > Henry Hi Henry, I find the the cast to Spliterator in Streams.concat() dubious, I can not see how it can be correct, could you explain why this cast is Ok. cheers, R?mi From thomas.schatzl at oracle.com Mon Jul 1 10:05:39 2013 From: thomas.schatzl at oracle.com (Thomas Schatzl) Date: Mon, 01 Jul 2013 12:05:39 +0200 Subject: RFR (XS): 8014890 : Reference queues may return more entries than expected In-Reply-To: <51D134FF.2080802@oracle.com> References: <1371589723.2524.43.camel@cirrus> <51D0D0A2.7030307@oracle.com> <51D134FF.2080802@oracle.com> Message-ID: <1372673139.2769.14.camel@cirrus> Hi David, On Mon, 2013-07-01 at 17:51 +1000, David Holmes wrote: > Well you can ignore what I wrote below - sorry. Somehow I got it in my > head that multiple enqueue's were intended/supported when of course they > are not. :( > > So the proposed fix is okay - though I'd simplify the comment to just: > > // Check that since getting the lock this reference hasn't already been > // enqueued (and even then removed) Done, see the new webrev at http://cr.openjdk.java.net/~tschatzl/8014890/webrev.01/ I will send this version to Mandy for pushing if nobody objects in the next few days. > The synchronization is problematic as I mention below but there is no > easy fix due to the lock-ordering problem, and any attempt at such a fix > would be much riskier. So this fix is fine - thanks. Fyi, while waiting for your approval, I tried to clean up this a little taking into account the comments from Peter and Aleksey (sorry if I forgot somebody) into account. A webrev for this is at http://cr.openjdk.java.net/~tschatzl/8014890/webrev.refactor/ The changes are: - avoid the double read from the volatile head member in ReferenceQueue.reallyPoll() - the fix for 8014890 you just reviewed - make Reference.queue volatile, and remove the synchronization on it from Reference.isEnqueued() and ReferenceQueue.enqueue(). I do not see a performance problem: a volatile read (in Reference.isEnqueued()) should be at least as fast as the synchronization on that reference. I think the change is okay as in functionally correct; I ran it through jprt (running all the available test cases, including the one for the original 8014890 patch, in the process), passing it. Maybe it is useful to you for future reference. Thanks everyone for your suggestions, Thomas Standard information about the patch (the original one, not the suggested cleanup): JIRA: https://jbs.oracle.com/bugs/browse/JDK-8014890 bugs.sun.com http://bugs.sun.com/view_bug.do?bug_id=8014890 Testing: jck, jprt, manual testing on most platforms From aleksey.shipilev at oracle.com Mon Jul 1 10:14:17 2013 From: aleksey.shipilev at oracle.com (Aleksey Shipilev) Date: Mon, 01 Jul 2013 14:14:17 +0400 Subject: RFR (XS): 8014890 : Reference queues may return more entries than expected In-Reply-To: <1372673139.2769.14.camel@cirrus> References: <1371589723.2524.43.camel@cirrus> <51D0D0A2.7030307@oracle.com> <51D134FF.2080802@oracle.com> <1372673139.2769.14.camel@cirrus> Message-ID: <51D15679.2080407@oracle.com> On 07/01/2013 02:05 PM, Thomas Schatzl wrote: > Fyi, while waiting for your approval, I tried to clean up this a little > taking into account the comments from Peter and Aleksey (sorry if I > forgot somebody) into account. Mandy Chung? > A webrev for this is at > http://cr.openjdk.java.net/~tschatzl/8014890/webrev.refactor/ This looks good. The same "thou shalt not do multiple volatile reads" applies to "(r.queue == NULL) || (r.queue == ENQUEUED)" now. Also, continuing on the micro-optimization spree, you might want to use bitwise |, not logical ||, saving a branch. Both things are optional though, it does not hurt much at this point due to the synchronization, and we can address these if/when we do the overhaul of that entire code. -Aleksey. From paul.sandoz at oracle.com Mon Jul 1 10:52:22 2013 From: paul.sandoz at oracle.com (Paul Sandoz) Date: Mon, 1 Jul 2013 12:52:22 +0200 Subject: RFR 8019481 Sync misc j.u.c classes from 166 to tl Message-ID: Hi, The following patch syncs misc-related classes from 166 j.u.c to tl. Basically stuff that has not already been committed or submitted for review except CHM stuff (which i will submit next). Again this contains docs (+ formatting changes) in addition to improvements (mainly to Exchanger and Phaser): http://cr.openjdk.java.net/~psandoz/tl/JDK-8019481-concur-misc/webrev/ Paul. From david.holmes at oracle.com Mon Jul 1 11:34:54 2013 From: david.holmes at oracle.com (David Holmes) Date: Mon, 01 Jul 2013 21:34:54 +1000 Subject: RFR (XS): 8014890 : Reference queues may return more entries than expected In-Reply-To: <1372673139.2769.14.camel@cirrus> References: <1371589723.2524.43.camel@cirrus> <51D0D0A2.7030307@oracle.com> <51D134FF.2080802@oracle.com> <1372673139.2769.14.camel@cirrus> Message-ID: <51D1695E.2050504@oracle.com> On 1/07/2013 8:05 PM, Thomas Schatzl wrote: > Hi David, > > On Mon, 2013-07-01 at 17:51 +1000, David Holmes wrote: >> Well you can ignore what I wrote below - sorry. Somehow I got it in my >> head that multiple enqueue's were intended/supported when of course they >> are not. :( >> >> So the proposed fix is okay - though I'd simplify the comment to just: >> >> // Check that since getting the lock this reference hasn't already been >> // enqueued (and even then removed) > > Done, see the new webrev at > http://cr.openjdk.java.net/~tschatzl/8014890/webrev.01/ > > I will send this version to Mandy for pushing if nobody objects in the next few days. Thanks. >> The synchronization is problematic as I mention below but there is no >> easy fix due to the lock-ordering problem, and any attempt at such a fix >> would be much riskier. So this fix is fine - thanks. > > Fyi, while waiting for your approval, I tried to clean up this a little > taking into account the comments from Peter and Aleksey (sorry if I > forgot somebody) into account. > > A webrev for this is at > http://cr.openjdk.java.net/~tschatzl/8014890/webrev.refactor/ Yes I think this handles it better. Get rid of synchronization of the Reference, make the fields volatile and let things race until the ReferenceQueue lock is taken, then sort it out. David ----- > The changes are: > - avoid the double read from the volatile head member in > ReferenceQueue.reallyPoll() > - the fix for 8014890 you just reviewed > - make Reference.queue volatile, and remove the synchronization on it > from Reference.isEnqueued() and ReferenceQueue.enqueue(). I do not see a > performance problem: a volatile read (in Reference.isEnqueued()) should > be at least as fast as the synchronization on that reference. > > I think the change is okay as in functionally correct; I ran it through > jprt (running all the available test cases, including the one for the > original 8014890 patch, in the process), passing it. > > Maybe it is useful to you for future reference. > > Thanks everyone for your suggestions, > Thomas > > Standard information about the patch (the original one, not the > suggested cleanup): > > JIRA: > https://jbs.oracle.com/bugs/browse/JDK-8014890 > > bugs.sun.com > http://bugs.sun.com/view_bug.do?bug_id=8014890 > > Testing: > jck, jprt, manual testing on most platforms > > From peter.levart at gmail.com Mon Jul 1 11:36:35 2013 From: peter.levart at gmail.com (Peter Levart) Date: Mon, 01 Jul 2013 13:36:35 +0200 Subject: RFR: 8015315: Stream.concat methods In-Reply-To: <51D15168.2020403@univ-mlv.fr> References: <51CE3142.60800@oracle.com> <51D15168.2020403@univ-mlv.fr> Message-ID: <51D169C3.4040706@gmail.com> On 07/01/2013 11:52 AM, Remi Forax wrote: > On 06/29/2013 02:58 AM, Henry Jen wrote: >> Hi, >> >> Please review the webrev that add concat static method to Stream and >> primitive Streams. >> >> http://cr.openjdk.java.net/~henryjen/ccc/8015315.0/webrev/ >> >> Cheers, >> Henry > > Hi Henry, > I find the the cast to Spliterator in Streams.concat() dubious, > I can not see how it can be correct, could you explain why this cast > is Ok. > > cheers, > R?mi > Hi, I think that if we want to concat say Stream with Stream, producing Stream, there would have to be an unsafe cast somewhere. Since Stream API apears to be covariant (like for example Iterator), casting Stream to Stream seems to be safe. Regards, Peter From david.holmes at oracle.com Mon Jul 1 11:37:12 2013 From: david.holmes at oracle.com (David Holmes) Date: Mon, 01 Jul 2013 21:37:12 +1000 Subject: RFR (XS): 8014890 : Reference queues may return more entries than expected In-Reply-To: <51D15679.2080407@oracle.com> References: <1371589723.2524.43.camel@cirrus> <51D0D0A2.7030307@oracle.com> <51D134FF.2080802@oracle.com> <1372673139.2769.14.camel@cirrus> <51D15679.2080407@oracle.com> Message-ID: <51D169E8.70601@oracle.com> On 1/07/2013 8:14 PM, Aleksey Shipilev wrote: > On 07/01/2013 02:05 PM, Thomas Schatzl wrote: >> Fyi, while waiting for your approval, I tried to clean up this a little >> taking into account the comments from Peter and Aleksey (sorry if I >> forgot somebody) into account. > > Mandy Chung? > >> A webrev for this is at >> http://cr.openjdk.java.net/~tschatzl/8014890/webrev.refactor/ > > This looks good. > > The same "thou shalt not do multiple volatile reads" applies to > "(r.queue == NULL) || (r.queue == ENQUEUED)" now. Doesn't that just reduce to "r.queue != this" ? (The assert suggests so :) ) > Also, continuing on > the micro-optimization spree, you might want to use bitwise |, not > logical ||, saving a branch. Bit-wise OR? What bits are you ORing ? David ----- Both things are optional though, it does > not hurt much at this point due to the synchronization, and we can > address these if/when we do the overhaul of that entire code. > > > -Aleksey. > From aleksey.shipilev at oracle.com Mon Jul 1 11:44:24 2013 From: aleksey.shipilev at oracle.com (Aleksey Shipilev) Date: Mon, 01 Jul 2013 15:44:24 +0400 Subject: RFR (XS): 8014890 : Reference queues may return more entries than expected In-Reply-To: <51D169E8.70601@oracle.com> References: <1371589723.2524.43.camel@cirrus> <51D0D0A2.7030307@oracle.com> <51D134FF.2080802@oracle.com> <1372673139.2769.14.camel@cirrus> <51D15679.2080407@oracle.com> <51D169E8.70601@oracle.com> Message-ID: <51D16B98.5010506@oracle.com> On 07/01/2013 03:37 PM, David Holmes wrote: > On 1/07/2013 8:14 PM, Aleksey Shipilev wrote: >> The same "thou shalt not do multiple volatile reads" applies to >> "(r.queue == NULL) || (r.queue == ENQUEUED)" now. > > Doesn't that just reduce to "r.queue != this" ? (The assert suggests > so :) ) Thomas' original patch had this in form of "r.queue != this". I argue it is more future-proof to distinguish the concrete cases. >> Also, continuing on the micro-optimization spree, you might want to >> use bitwise |, not logical ||, saving a branch. > > Bit-wise OR? What bits are you ORing ? You *can* bitwise OR two booleans; which would only remove short-circuiting behavior with the benefit of clearing one branch. See http://docs.oracle.com/javase/specs/jls/se7/html/jls-15.html#jls-15.22.2 -Aleksey. From thomas.schatzl at oracle.com Mon Jul 1 11:51:19 2013 From: thomas.schatzl at oracle.com (Thomas Schatzl) Date: Mon, 01 Jul 2013 13:51:19 +0200 Subject: RFR (XS): 8014890 : Reference queues may return more entries than expected In-Reply-To: <51D16B98.5010506@oracle.com> References: <1371589723.2524.43.camel@cirrus> <51D0D0A2.7030307@oracle.com> <51D134FF.2080802@oracle.com> <1372673139.2769.14.camel@cirrus> <51D15679.2080407@oracle.com> <51D169E8.70601@oracle.com> <51D16B98.5010506@oracle.com> Message-ID: <1372679479.2769.44.camel@cirrus> Hi all, On Mon, 2013-07-01 at 15:44 +0400, Aleksey Shipilev wrote: > On 07/01/2013 03:37 PM, David Holmes wrote: > > On 1/07/2013 8:14 PM, Aleksey Shipilev wrote: > >> The same "thou shalt not do multiple volatile reads" applies to > >> "(r.queue == NULL) || (r.queue == ENQUEUED)" now. > > > > Doesn't that just reduce to "r.queue != this" ? (The assert suggests > > so :) ) > > Thomas' original patch had this in form of "r.queue != this". I argue it > is more future-proof to distinguish the concrete cases. :) I also thought it was more understandable if the cases were explicitly enumerated, in addition to the assert. I changed this in http://cr.openjdk.java.net/~tschatzl/8014890/webrev.refactor to that version now, using a temporary variable that stores r.queue before the checks to avoid the double volatile reads. However for me either version is fine, just tell me what you favor. I am not really happy about bitwise ORing the two comparison results as it seems to reduce readability at no real gain. Thanks, Thomas From aleksey.shipilev at oracle.com Mon Jul 1 11:53:38 2013 From: aleksey.shipilev at oracle.com (Aleksey Shipilev) Date: Mon, 01 Jul 2013 15:53:38 +0400 Subject: RFR (XS): 8014890 : Reference queues may return more entries than expected In-Reply-To: <1372679479.2769.44.camel@cirrus> References: <1371589723.2524.43.camel@cirrus> <51D0D0A2.7030307@oracle.com> <51D134FF.2080802@oracle.com> <1372673139.2769.14.camel@cirrus> <51D15679.2080407@oracle.com> <51D169E8.70601@oracle.com> <51D16B98.5010506@oracle.com> <1372679479.2769.44.camel@cirrus> Message-ID: <51D16DC2.9070908@oracle.com> On 07/01/2013 03:51 PM, Thomas Schatzl wrote: > Hi all, > > On Mon, 2013-07-01 at 15:44 +0400, Aleksey Shipilev wrote: >> On 07/01/2013 03:37 PM, David Holmes wrote: >>> On 1/07/2013 8:14 PM, Aleksey Shipilev wrote: >>>> The same "thou shalt not do multiple volatile reads" applies to >>>> "(r.queue == NULL) || (r.queue == ENQUEUED)" now. >>> >>> Doesn't that just reduce to "r.queue != this" ? (The assert suggests >>> so :) ) >> >> Thomas' original patch had this in form of "r.queue != this". I argue it >> is more future-proof to distinguish the concrete cases. > > :) > > I also thought it was more understandable if the cases were explicitly > enumerated, in addition to the assert. > > I changed this in > http://cr.openjdk.java.net/~tschatzl/8014890/webrev.refactor to that > version now, using a temporary variable that stores r.queue before the > checks to avoid the double volatile reads. > > However for me either version is fine, just tell me what you favor. I have no opinion on this. Fine with both versions. -Aleksey. From nicholas+openjdk at nicholaswilliams.net Mon Jul 1 12:43:18 2013 From: nicholas+openjdk at nicholaswilliams.net (Nick Williams) Date: Mon, 1 Jul 2013 07:43:18 -0500 Subject: Error in Javadoc for DatabaseMetaData In-Reply-To: <51D11D9C.7010804@oracle.com> References: <214DD60F-F0B4-4A56-BF6E-A91EF38D283F@nicholaswilliams.net> <51D11D9C.7010804@oracle.com> Message-ID: <6BA3AF82-8FD1-4044-B1AA-797252D1BD25@nicholaswilliams.net> Indeed. Thanks! On Jul 1, 2013, at 1:11 AM, Alan Bateman wrote: > On 30/06/2013 22:26, Nick Williams wrote: >> In java.sql.DatabaseMetaData, the Javadoc for supportsResultSetHoldability fails to properly close a tag, and so everything following that method is monospace. To be precise: >> >> ResultSet.CLOSE_CURSORS_AT_COMMIT >> >> However, it should be: >> >> ResultSet.CLOSE_CURSORS_AT_COMMIT >> >> Nick >> > This was fixed recently along with many other javadoc issues, see: > > http://hg.openjdk.java.net/jdk8/tl/jdk/rev/b9ba04dc210f > > -Alan From paul.sandoz at oracle.com Mon Jul 1 12:44:08 2013 From: paul.sandoz at oracle.com (Paul Sandoz) Date: Mon, 1 Jul 2013 14:44:08 +0200 Subject: RFR 8019484 Sync j.u.c.ConcurrentHashMap from 166 to tl Message-ID: <9055AD19-214B-4136-8F76-56FEC8E2E406@oracle.com> Hi, The following is the final j.u.c patch that syncs CMH classes from 166 j.u.c to tl. http://cr.openjdk.java.net/~psandoz/tl/JDK-8019484-chm/webrev/ (i am sure there will be more patches to follow as tweaks are made to various areas, but hopefully they will not need so bulky.) ConcurrentMap.replaceAll in tl was more up to date than that in 166. Quite tricky to review CHM since there is a fair bit of code shuffling due to: 480 * This file is organized to make things a little easier to follow 481 * while reading than they might otherwise: First the main static 482 * declarations and utilities, then fields, then main public 483 * methods (with a few factorings of multiple public methods into 484 * internal ones), then sizing methods, trees, traversers, and 485 * bulk operations. Paul. From Alan.Bateman at oracle.com Mon Jul 1 13:08:04 2013 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Mon, 01 Jul 2013 14:08:04 +0100 Subject: Refresh - Java 8 RFR 8017540: Improve multi-threaded contention behavior of BigInteger.toString() radix conversion cache In-Reply-To: References: Message-ID: <51D17F34.50202@oracle.com> On 28/06/2013 19:24, Brian Burkhalter wrote: > This Request for Review is a refresh of this thread > > http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-June/018337.html > > pertaining to this issue > > http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8017540 > > The webrev has been updated in the same location > > http://cr.openjdk.java.net/~bpb/8017540/ > > Basic JTREG sanity testing has been performed. > > Thanks, > > Brian This looks to me too and I can sponsor this. One final thing that crossed my mind is whether we might need insert a SoftReference someday so that it can be GC'ed when there is memory pressure. It's not needed now but something to thing about. -Alan From dl at cs.oswego.edu Mon Jul 1 13:19:12 2013 From: dl at cs.oswego.edu (Doug Lea) Date: Mon, 01 Jul 2013 09:19:12 -0400 Subject: RFR 8019484 Sync j.u.c.ConcurrentHashMap from 166 to tl In-Reply-To: <9055AD19-214B-4136-8F76-56FEC8E2E406@oracle.com> References: <9055AD19-214B-4136-8F76-56FEC8E2E406@oracle.com> Message-ID: <51D181D0.9050106@cs.oswego.edu> On 07/01/13 08:44, Paul Sandoz wrote: > > The following is the final j.u.c patch that syncs CMH classes from 166 j.u.c to tl. > > http://cr.openjdk.java.net/~psandoz/tl/JDK-8019484-chm/webrev/ Thanks for doing this! > ConcurrentMap.replaceAll in tl was more up to date than that in 166. Yes, we knew this would happen a few weeks ago when Mike committed, but I was still tracking lambda versions. Hopefully these mismatches will soon be things of the past. > > Quite tricky to review CHM since there is a fair bit of code shuffling due to: > > 480 * This file is organized to make things a little easier to follow > 481 * while reading than they might otherwise: First the main static > 482 * declarations and utilities, then fields, then main public > 483 * methods (with a few factorings of multiple public methods into > 484 * internal ones), then sizing methods, trees, traversers, and > 485 * bulk operations. > Yes, sorry for the impact on diffs, but the old file organization (based on the original version of CHM) was getting too chaotic, so I rearranged in a way that better reflects structure. -Doug From forax at univ-mlv.fr Mon Jul 1 13:19:49 2013 From: forax at univ-mlv.fr (Remi Forax) Date: Mon, 01 Jul 2013 15:19:49 +0200 Subject: RFR: 8015315: Stream.concat methods In-Reply-To: <51D169C3.4040706@gmail.com> References: <51CE3142.60800@oracle.com> <51D15168.2020403@univ-mlv.fr> <51D169C3.4040706@gmail.com> Message-ID: <51D181F5.6060106@univ-mlv.fr> On 07/01/2013 01:36 PM, Peter Levart wrote: > > On 07/01/2013 11:52 AM, Remi Forax wrote: >> On 06/29/2013 02:58 AM, Henry Jen wrote: >>> Hi, >>> >>> Please review the webrev that add concat static method to Stream and >>> primitive Streams. >>> >>> http://cr.openjdk.java.net/~henryjen/ccc/8015315.0/webrev/ >>> >>> Cheers, >>> Henry >> >> Hi Henry, >> I find the the cast to Spliterator in Streams.concat() dubious, >> I can not see how it can be correct, could you explain why this cast >> is Ok. >> >> cheers, >> R?mi >> > > Hi, Hi, > > I think that if we want to concat say Stream with > Stream, producing Stream, there would have to be an > unsafe cast somewhere. Since Stream API apears to be covariant > (like for example Iterator), casting Stream to > Stream seems to be safe. if Stream is covariant, it should be possible to create a Stream from a Spliterator, so there is no need of such unsafe cast. > > Regards, Peter > cheers, R?mi From daniel.fuchs at oracle.com Mon Jul 1 13:25:57 2013 From: daniel.fuchs at oracle.com (Daniel Fuchs) Date: Mon, 01 Jul 2013 15:25:57 +0200 Subject: RFR: JDK-7184195 - java.util.logging.Logger.getGlobal().info() doesn't log without configuration In-Reply-To: <51CDE603.1030309@oracle.com> References: <51C1CEE9.9010200@oracle.com> <51CDE603.1030309@oracle.com> Message-ID: <51D18365.3040409@oracle.com> On 6/28/13 9:37 PM, Mandy Chung wrote: > Hi Daniel, > > On 6/19/2013 8:31 AM, Daniel Fuchs wrote: >> The fix proposed is simple. In getGlobal() we check whether >> the 'manager' variable is null - and if it is, we initialize it >> by calling LogManager.getLogManager(). >> This is a pattern which is already present at other places in >> the Logger.java class file. >> > > This fix is much better. I am happy that you found this simple approach > to avoid calling Logger.getLogger from Logger.getGlobal() as the > LogManager class initialization is fragile and its circular dependency > with Logger class caused several deadlock issues in the past. > > I reviewed the new webrev.01. >> > Hi Mandy, thanks for the review! > Looks good in general. Some comments: > > Logger.global is deprecated. In LogManager static initializer, we > should have @SuppressWarnings("deprecation") on Logger.global (probably > need to define a local variable) to suppress the warning and together > with your comment it will make it clear that accessing this deprecated > field is intentional. Right. I can do that. But I don't see any warnings when compiling (with make) - maybe they're turned out by default? > > As you pointed out, the same pattern is used in the checkPermission() > method. Might be worth having a private getManager() method to replace > direct access to the manager field in the Logger class - just a thought > to prevent similar bug from happening again. Well - hmm - I'd prefer to do that in a later cleanup. I'd want first to analyze all the places where manager is used. Plus there is Peter's suggestion about changing the dynamics between LogManager & Logger. Both are excellent suggestions but I think I'd like to dedicate a whole changeset for this kind of cleanup, without mixing it with bug fix. >> However - initialization of LogManager has proved to be fragile >> in the past - in particular wrt deadlocks between Logger and >> LogManager caused by circular class initialization. >> > > Yes indeed and it's hard to diagnose if something goes wrong. In the > readPrimordialConfiguration() method, it silently ignores any exception: > > } catch (Exception ex) { > // System.err.println("Can't read logging configuration:"); > // ex.printStackTrace(); > } > > I have a patch at one point that turns this into an assert so that we > will diagnose any logging initialization issue easier. You may want to > consider adding this in the future. > > Great to see the regression tests covering various configurations that > looks fine. Some suggestions. > > I think TestGetGlobal and TestGetGlobal2 are almost the same except > verifyingLogger.getGlobal()vs > Logger.getLogger(Logger.GLOBAL_LOGGER_NAME)- btw they have the same > @summary. Good catch - I will update the summary. > > Have you considered merging them into one single file and having the > argument to control which method the test will call? That will avoid > the duplicated code. The downside the number of @run will be double. Well - yes that's partly why I put two tests: One to verify calling Logger.getGlobal(), one to verify calling Logger.getLogger(Logger.GLOBAL_LOGGER_NAME). > One idea is to move the @run -Djava.util.logging.manager to the > corresponding LogManager subclass (i.e. TestLogManagerImpl.java will be > a jtreg test that runs the tests that set itself as the global > LogManager) that might make it easier to understand what each LogManager > subclass is about. Hmmm... Not sure that's a good idea. I'd prefer leave TestLogManagerImpl* as simple subclasses of LogManager - but maybe I should remove the Test prefix - and leave that for actual test classes. > You're improving the test coverage for logging which is great. It may be > good to adopt the current convention e.g. put these tests under > jdk/test/java/util/logging/Logger/getGlobal directory as they are for > Logger.getGlobal method. OK > TestHandles and TestLogManagerImpl are in testgetglobal package and I > suggest to move them to "testgetglobal" subdirectory. OK. -- daniel > > Thanks > Mandy From vincent.x.ryan at oracle.com Mon Jul 1 13:41:46 2013 From: vincent.x.ryan at oracle.com (vincent.x.ryan at oracle.com) Date: Mon, 01 Jul 2013 13:41:46 +0000 Subject: hg: jdk8/tl/jdk: 8019259: Failover to CRL checking does not happen if wrong OCSP responder URL is set Message-ID: <20130701134210.1FE1F486C5@hg.openjdk.java.net> Changeset: dfb37cc30a67 Author: vinnie Date: 2013-07-01 14:39 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/dfb37cc30a67 8019259: Failover to CRL checking does not happen if wrong OCSP responder URL is set Reviewed-by: xuelei ! src/share/classes/sun/security/provider/certpath/RevocationChecker.java ! test/java/security/cert/CertPathValidator/OCSP/FailoverToCRL.java From maurizio.cimadamore at oracle.com Mon Jul 1 13:57:26 2013 From: maurizio.cimadamore at oracle.com (maurizio.cimadamore at oracle.com) Date: Mon, 01 Jul 2013 13:57:26 +0000 Subject: hg: jdk8/tl/langtools: 7034798: Ambiguity error for abstract method call is too eager Message-ID: <20130701135732.8E158486C6@hg.openjdk.java.net> Changeset: f559ef7568ce Author: mcimadamore Date: 2013-07-01 14:57 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/f559ef7568ce 7034798: Ambiguity error for abstract method call is too eager Summary: Javac should wait and see if ambiguous methods can be reconciled at the end of an overload resolution round Reviewed-by: jjg, vromero ! src/share/classes/com/sun/tools/javac/comp/Resolve.java ! test/tools/javac/resolve/ResolveHarness.java + test/tools/javac/resolve/tests/AbstractMerge.java ! test/tools/javac/resolve/tests/InnerOverOuter.java From eric.mccorkle at oracle.com Mon Jul 1 15:04:12 2013 From: eric.mccorkle at oracle.com (Eric McCorkle) Date: Mon, 01 Jul 2013 11:04:12 -0400 Subject: JDK-8016285: Add java.lang.reflect.Parameter.isNamePresent() In-Reply-To: <51C89C00.20604@oracle.com> References: <51C4B02B.7040004@oracle.com> <51C4B47E.4060702@oracle.com> <51C4E010.1050603@oracle.com> <51C89C00.20604@oracle.com> Message-ID: <51D19A6C.7090406@oracle.com> Pinging this one again... On 06/24/13 15:20, Eric McCorkle wrote: > Pinging this RFR. It still needs a capital R reviewer. > http://cr.openjdk.java.net/~emc/8016285/ > > On 06/21/13 19:21, Eric McCorkle wrote: >> On 06/21/13 16:15, Aleksey Shipilev wrote: >>> On 06/21/2013 11:57 PM, Eric McCorkle wrote: >>>> The webrev is here: >>>> http://cr.openjdk.java.net/~emc/8016285/ >>> >>> Looks generally good (but not a Reviewer). >>> >>> A few questions though: >>> a) Are we em-bracing the brace-less control flow blocks? >> >> Fixed it. >> >>> b) Should hasRealParameterData be transient? >>> c) Should hasRealParameterData be volatile? (now is being implicitly >>> protected by $parameters volatile write/read, but it is fragile) >> >> Transient yes. Volatile, I'd say I think not, since It's written before >> it's read on all possible paths, and all writes are the same value. >> But... I set it volatile just to be safe from reordering problems. >> >> Webrev's been updated. >> http://cr.openjdk.java.net/~emc/8016285/ >> From forax at univ-mlv.fr Mon Jul 1 15:22:22 2013 From: forax at univ-mlv.fr (Remi Forax) Date: Mon, 01 Jul 2013 17:22:22 +0200 Subject: RFR: 8019381: HashMap.isEmpty is non-final, potential issues for get/remove In-Reply-To: <51D13323.9030601@linux.vnet.ibm.com> References: <51CBF181.1020301@linux.vnet.ibm.com> <51CCAAE5.4010707@univ-mlv.fr> <51CD896D.9030807@oracle.com> <51CDB453.5010003@linux.vnet.ibm.com> <51D13323.9030601@linux.vnet.ibm.com> Message-ID: <51D19EAE.2010201@univ-mlv.fr> On 07/01/2013 09:43 AM, Shi Jun Zhang wrote: > On 6/29/2013 12:05 AM, Shi Jun Zhang wrote: >> On 6/28/2013 9:02 PM, Alan Bateman wrote: >>> On 27/06/2013 22:13, Remi Forax wrote: >>>> On 06/27/2013 10:02 AM, Shi Jun Zhang wrote: >>>>> Hi, >>>>> >>>>> There are some isEmpty() check added into get/remove methods since >>>>> 8011200 to return directly if HashMap is empty. However isEmpty is >>>>> a non-final public method which can be overridden by subclass. If >>>>> the subclass defines isEmpty differently from HashMap, it would >>>>> cause problem while getting or removing elements. >>>> >>>> yes, it's a bug. >>>> Could you report it ? >>>> >>>> R?mi >>> I've created a bug to track this: >>> >>> 8019381: HashMap.isEmpty is non-final, potential issues for get/remove >>> >>> -Alan >>> >> Thanks, Alan. >> >> I'm quite busy today and do not have time to report it until now. >> Thanks for your help. >> >> I will provide a webrev next Monday for review. >> > Hi, > > Here is the webrev > > http://cr.openjdk.java.net/~zhangshj/8019381/webrev.00/ > This looks Ok for me. R?mi From erik.helin at oracle.com Mon Jul 1 15:32:02 2013 From: erik.helin at oracle.com (Erik Helin) Date: Mon, 1 Jul 2013 17:32:02 +0200 Subject: RFR: 8019500: Exclude MemoryTest.java and MemoryTestAllGC.sh to enable integration Message-ID: <20130701153202.GE2213@ehelin-thinkpad> Hi all, this change excludes the following two MemoryMXBean tests: - java/lang/management/MemoryMXBean/MemoryTestAllGC.sh - java/lang/management/MemoryMXBean/MemoryTest.java This is needed since a change in hotspot added a new memory pool for metaspace: > hg log hotspot-main/hotspot: > changeset: 4861:71963b3f802a > user: ehelin > date: Wed Jun 26 16:58:37 2013 > summary: 8013590: NPG: Add a memory pool MXBean for Metaspace These tests need to be excluded for a (very short) time to be able to integrate hotspot-main into jdk8/jdk8. Webrev: http://cr.openjdk.java.net/~ehelin/8019500/webrev.00/ Please note that the change is for jdk8/jdk8 (not jdk8/tl) since hotspot needs to be integrated into jdk8/jdk8. I have also sent out a review request for a change that fixes the test and removes the tests from ProblemList.txt. This change can be applied to jdk8/tl as soon as hotspot has been integrated and pulled down to jdk8/tl. Thanks, Erik From erik.helin at oracle.com Mon Jul 1 15:35:20 2013 From: erik.helin at oracle.com (Erik Helin) Date: Mon, 1 Jul 2013 17:35:20 +0200 Subject: RFR: 8010734: NPG: The test MemoryTest.java needs to be updated to support metaspace Message-ID: <20130701153520.GF2213@ehelin-thinkpad> Hi all, this change updates MemoryTest.java to take the newly added Metaspace and Compressed Class Space MemoryMXBeans into account, as well as the new Metaspace Memory Manager. This change also removes the following two tests from ProblemList.txt since they are now passing again: -java/lang/management/MemoryMXBean/MemoryTestAllGC.sh generic-all -java/lang/management/MemoryMXBean/MemoryTest.java generic-all Webrev: http://cr.openjdk.java.net/~ehelin/8010734/webrev.00/ Thanks, Erik From Alan.Bateman at oracle.com Mon Jul 1 15:44:50 2013 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Mon, 01 Jul 2013 16:44:50 +0100 Subject: RFR: JAXP 1.5 for JDK8/7u40: 8016648: FEATURE_SECURE_PROCESSING set to true or false causes SAXParseException to be thrown In-Reply-To: <51D13933.8090901@oracle.com> References: <51D13933.8090901@oracle.com> Message-ID: <51D1A3F2.2000707@oracle.com> On 01/07/2013 09:09, huizhe wang wrote: > Hi, > > There have been two revisions in JAXP 1.5 specification: 1) the > relationship between the JAXP 1.5 properties and > FEATURE_SECURE_PROCESSING (FSP) is now a recommendation. It is up to > the implementation to decide if it wants to restrict when FSP is set. > 2) System properties will override that may have been set by FSP. > > In the following patch, a JDK version detection code is added so that > when FSP is set explicitly, for JDK7, there will be no restrictions, > but for JDK8 and above, the restrictions are on. > > The effective order is changed so that JAXP 1.5 defined system > properties will override that may be set by enabling FSP. > > Please review: > http://cr.openjdk.java.net/~joehw/jdk8/8016648/webrev/ > > Note that the patch is identical for JDK7 and 8, and I plan to ask > approval for 7u40 integration. > > Thanks, > Joe Are there tests that can be used to verify this (both for 8 and 7u40? Are you confident that tests cover all the overrides scenarios? I think isJDKandAbove has the assume the long standing format for java.version. If someone really did change the format to what you are suggesting then the code would fail with a value such as "7.40". In getJAXPSystemProperty's comment then I assume it should be ${java.home}. -Alan From chris.hegarty at oracle.com Mon Jul 1 15:49:08 2013 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Mon, 1 Jul 2013 17:49:08 +0200 Subject: RFR: 8019381: HashMap.isEmpty is non-final, potential issues for get/remove In-Reply-To: <51D19EAE.2010201@univ-mlv.fr> References: <51CBF181.1020301@linux.vnet.ibm.com> <51CCAAE5.4010707@univ-mlv.fr> <51CD896D.9030807@oracle.com> <51CDB453.5010003@linux.vnet.ibm.com> <51D13323.9030601@linux.vnet.ibm.com> <51D19EAE.2010201@univ-mlv.fr> Message-ID: <450D0C6E-3BA7-40AD-B415-6659A6FDDA91@oracle.com> On 1 Jul 2013, at 17:22, Remi Forax wrote: > On 07/01/2013 09:43 AM, Shi Jun Zhang wrote: >> On 6/29/2013 12:05 AM, Shi Jun Zhang wrote: >>> On 6/28/2013 9:02 PM, Alan Bateman wrote: >>>> On 27/06/2013 22:13, Remi Forax wrote: >>>>> On 06/27/2013 10:02 AM, Shi Jun Zhang wrote: >>>>>> Hi, >>>>>> >>>>>> There are some isEmpty() check added into get/remove methods since 8011200 to return directly if HashMap is empty. However isEmpty is a non-final public method which can be overridden by subclass. If the subclass defines isEmpty differently from HashMap, it would cause problem while getting or removing elements. >>>>> >>>>> yes, it's a bug. >>>>> Could you report it ? >>>>> >>>>> R?mi >>>> I've created a bug to track this: >>>> >>>> 8019381: HashMap.isEmpty is non-final, potential issues for get/remove >>>> >>>> -Alan >>> Thanks, Alan. >>> >>> I'm quite busy today and do not have time to report it until now. Thanks for your help. >>> >>> I will provide a webrev next Monday for review. >> Hi, >> >> Here is the webrev >> >> http://cr.openjdk.java.net/~zhangshj/8019381/webrev.00/ > > This looks Ok for me. +1 -Chris > R?mi > From peter.levart at gmail.com Mon Jul 1 15:50:58 2013 From: peter.levart at gmail.com (Peter Levart) Date: Mon, 01 Jul 2013 17:50:58 +0200 Subject: RFR: 8015315: Stream.concat methods In-Reply-To: <51D181F5.6060106@univ-mlv.fr> References: <51CE3142.60800@oracle.com> <51D15168.2020403@univ-mlv.fr> <51D169C3.4040706@gmail.com> <51D181F5.6060106@univ-mlv.fr> Message-ID: <51D1A562.4070409@gmail.com> On 07/01/2013 03:19 PM, Remi Forax wrote: > On 07/01/2013 01:36 PM, Peter Levart wrote: >> >> On 07/01/2013 11:52 AM, Remi Forax wrote: >>> On 06/29/2013 02:58 AM, Henry Jen wrote: >>>> Hi, >>>> >>>> Please review the webrev that add concat static method to Stream and >>>> primitive Streams. >>>> >>>> http://cr.openjdk.java.net/~henryjen/ccc/8015315.0/webrev/ >>>> >>>> Cheers, >>>> Henry >>> >>> Hi Henry, >>> I find the the cast to Spliterator in Streams.concat() dubious, >>> I can not see how it can be correct, could you explain why this cast >>> is Ok. >>> >>> cheers, >>> R?mi >>> >> >> Hi, > > Hi, > >> >> I think that if we want to concat say Stream with >> Stream, producing Stream, there would have to be an >> unsafe cast somewhere. Since Stream API apears to be covariant >> (like for example Iterator), casting Stream to >> Stream seems to be safe. > > if Stream is covariant, it should be possible to create a Stream > from a Spliterator, > so there is no need of such unsafe cast. Sorry, I meant so say: Spliterator API apears to be covariant (like for example Iterator), so casting Spliterator toSpliterator seems to be safe. Regarding creating Stream from a Spliterator it wouldn't help here, since we can't create Spliterator from two spliterators: Spliterator and Spliterator without unsafe cast in the first place... So maybe we should bury the unsafe cast in the ConcatSpliterator's constructor then... Regards, Peter > >> >> Regards, Peter >> > > cheers, > R?mi > From tbuktu at hotmail.com Mon Jul 1 16:06:08 2013 From: tbuktu at hotmail.com (Tim Buktu) Date: Mon, 1 Jul 2013 18:06:08 +0200 Subject: Code update for 8014319: Faster division of large integers In-Reply-To: References: Message-ID: Sorry, those links didn't include BigIntegerTest.java. Here are the correct ones: BigInteger.java https://raw.github.com/tbuktu/bigint/4c24162e99227e177f17f5db9b8ca2757820d2cd/src/main/java/java/math/BigInteger.java MutableBigInteger.java https://raw.github.com/tbuktu/bigint/95f1158d2205614c8739344df07ee35523b8ad89/src/main/java/java/math/MutableBigInteger.java BigIntegerTest.java https://raw.github.com/tbuktu/bigint/dad1934e9c682740361a114aea0053f13c82602a/src/test/java/BigIntegerTest.java Tim On 01.07.2013 01:20, Tim Buktu wrote: > Hi, > > I made a few changes to the BigInteger code in my GitHub repo: > * Moved Burnikel-Ziegler division to MutableBigInteger > * Added more comments to the Burnikel-Ziegler code > * Updated Barrett thresholds > * Merged BigInteger.java and BigIntegerTest.java with the latest from hg > > The files at the links below contain the latest code for bugs 8014319 > and 8014320. > Brian, if you want me to, I can make an updated patch for just 8014319. > > https://raw.github.com/tbuktu/bigint/4c24162e99227e177f17f5db9b8ca2757820d2cd/src/main/java/java/math/BigInteger.java > https://raw.github.com/tbuktu/bigint/95f1158d2205614c8739344df07ee35523b8ad89/src/main/java/java/math/MutableBigInteger.java > https://raw.github.com/tbuktu/bigint/95f1158d2205614c8739344df07ee35523b8ad89/src/main/java/java/math/MutableBigInteger.java > > Is 8014319 going to be next up for review? > Also, would it be okay to do a s/Reminder/Remainder/g on > MutableBigInteger.java and include it in 8014319? > Thanks, > > Tim > > From joe.darcy at oracle.com Mon Jul 1 16:08:44 2013 From: joe.darcy at oracle.com (Joe Darcy) Date: Mon, 01 Jul 2013 09:08:44 -0700 Subject: RFR: JAXP 1.5 for JDK8/7u40: 8016648: FEATURE_SECURE_PROCESSING set to true or false causes SAXParseException to be thrown In-Reply-To: <51D1A3F2.2000707@oracle.com> References: <51D13933.8090901@oracle.com> <51D1A3F2.2000707@oracle.com> Message-ID: <51D1A98C.70301@oracle.com> If you just want to test for platform version (7 vs 8), you might also look at javax.lang.model.SourceVersion.latest(). -Joe On 7/1/2013 8:44 AM, Alan Bateman wrote: > On 01/07/2013 09:09, huizhe wang wrote: >> Hi, >> >> There have been two revisions in JAXP 1.5 specification: 1) the >> relationship between the JAXP 1.5 properties and >> FEATURE_SECURE_PROCESSING (FSP) is now a recommendation. It is up to >> the implementation to decide if it wants to restrict when FSP is >> set. 2) System properties will override that may have been set by FSP. >> >> In the following patch, a JDK version detection code is added so that >> when FSP is set explicitly, for JDK7, there will be no restrictions, >> but for JDK8 and above, the restrictions are on. >> >> The effective order is changed so that JAXP 1.5 defined system >> properties will override that may be set by enabling FSP. >> >> Please review: >> http://cr.openjdk.java.net/~joehw/jdk8/8016648/webrev/ >> >> Note that the patch is identical for JDK7 and 8, and I plan to ask >> approval for 7u40 integration. >> >> Thanks, >> Joe > > Are there tests that can be used to verify this (both for 8 and 7u40? > Are you confident that tests cover all the overrides scenarios? > > I think isJDKandAbove has the assume the long standing format for > java.version. If someone really did change the format to what you are > suggesting then the code would fail with a value such as "7.40". > > In getJAXPSystemProperty's comment then I assume it should be > ${java.home}. > > -Alan > > > From paul.sandoz at oracle.com Mon Jul 1 16:19:39 2013 From: paul.sandoz at oracle.com (Paul Sandoz) Date: Mon, 1 Jul 2013 18:19:39 +0200 Subject: RFR 8019484 Sync j.u.c.ConcurrentHashMap from 166 to tl In-Reply-To: <51D181D0.9050106@cs.oswego.edu> References: <9055AD19-214B-4136-8F76-56FEC8E2E406@oracle.com> <51D181D0.9050106@cs.oswego.edu> Message-ID: <8B5CAC9D-0B6E-43BD-B0B3-16D56D937311@oracle.com> On Jul 1, 2013, at 3:19 PM, Doug Lea
wrote: > On 07/01/13 08:44, Paul Sandoz wrote: >> >> The following is the final j.u.c patch that syncs CMH classes from 166 j.u.c to tl. >> >> http://cr.openjdk.java.net/~psandoz/tl/JDK-8019484-chm/webrev/ > > Thanks for doing this! > Np. >> ConcurrentMap.replaceAll in tl was more up to date than that in 166. > > Yes, we knew this would happen a few weeks ago when Mike committed, > but I was still tracking lambda versions. Hopefully these mismatches > will soon be things of the past. > OK. IIRC Mike wanted to take another pass at this stuff, so i went for the basic merge option. >> >> Quite tricky to review CHM since there is a fair bit of code shuffling due to: >> >> 480 * This file is organized to make things a little easier to follow >> 481 * while reading than they might otherwise: First the main static >> 482 * declarations and utilities, then fields, then main public >> 483 * methods (with a few factorings of multiple public methods into >> 484 * internal ones), then sizing methods, trees, traversers, and >> 485 * bulk operations. >> > > Yes, sorry for the impact on diffs, but the old file organization > (based on the original version of CHM) was getting too chaotic, > so I rearranged in a way that better reflects structure. > I think the new arrangement is much better. JPRT results are good. FWIW I found it easier just to linearly read though the new code, and contrast with searches within the old code. Paul. From mike.duigou at oracle.com Mon Jul 1 16:42:46 2013 From: mike.duigou at oracle.com (Mike Duigou) Date: Mon, 1 Jul 2013 10:42:46 -0600 Subject: RFR: 8019381: HashMap.isEmpty is non-final, potential issues for get/remove In-Reply-To: <51D13323.9030601@linux.vnet.ibm.com> References: <51CBF181.1020301@linux.vnet.ibm.com> <51CCAAE5.4010707@univ-mlv.fr> <51CD896D.9030807@oracle.com> <51CDB453.5010003@linux.vnet.ibm.com> <51D13323.9030601@linux.vnet.ibm.com> Message-ID: <491162F5-4886-40CD-810E-868975CACA34@oracle.com> +1 On 2013-07-01, at 1:43, Shi Jun Zhang wrote: > On 6/29/2013 12:05 AM, Shi Jun Zhang wrote: >> On 6/28/2013 9:02 PM, Alan Bateman wrote: >>> On 27/06/2013 22:13, Remi Forax wrote: >>>> On 06/27/2013 10:02 AM, Shi Jun Zhang wrote: >>>>> Hi, >>>>> >>>>> There are some isEmpty() check added into get/remove methods since 8011200 to return directly if HashMap is empty. However isEmpty is a non-final public method which can be overridden by subclass. If the subclass defines isEmpty differently from HashMap, it would cause problem while getting or removing elements. >>>> >>>> yes, it's a bug. >>>> Could you report it ? >>>> >>>> R?mi >>> I've created a bug to track this: >>> >>> 8019381: HashMap.isEmpty is non-final, potential issues for get/remove >>> >>> -Alan >> Thanks, Alan. >> >> I'm quite busy today and do not have time to report it until now. Thanks for your help. >> >> I will provide a webrev next Monday for review. > Hi, > > Here is the webrev > > http://cr.openjdk.java.net/~zhangshj/8019381/webrev.00/ > > -- > Regards, > > Shi Jun Zhang > From mandy.chung at oracle.com Mon Jul 1 17:51:44 2013 From: mandy.chung at oracle.com (Mandy Chung) Date: Mon, 01 Jul 2013 10:51:44 -0700 Subject: RFR: JDK-7184195 - java.util.logging.Logger.getGlobal().info() doesn't log without configuration In-Reply-To: <51CECB3E.2010501@gmail.com> References: <51C1CEE9.9010200@oracle.com> <51CECB3E.2010501@gmail.com> Message-ID: <51D1C1B0.7050107@oracle.com> On 6/29/13 4:55 AM, Peter Levart wrote: > Hi, > > I haven't studied this deeply yet, but maybe somebody knows the > answer: Why is it necessary to add root and global loggers to > LogManager in it's static initializer? Global Logger could be created > and initialized lazily, when 1st requested (in static initialization > of Logger class), and the root Logger is always "ensured" lazily > before any other Logger is initialized. If the dependency on Logger > class was removed from LogManager static initialization, then Logger > static/lazy initialization could depend on LogManager (either just > LogManager.manager field when fully configured LogManager is not > needed/can't be requested or LogManager.getLogManager() for fully > configured LogManager) ... > > The initialization of LogManager, root & default Loggers is very > entangled currently and any change to such code can be fragile. > > What dou you think of untangling it? This is a good suggestion. Daniel has a patch to ensure both the root logger and global logger in the LoggerContext [1] and untangling the LogManager and Logger initialization would be possible. Mandy [1] http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-June/018518.html > > Regards, Peter > > On 06/19/2013 05:31 PM, Daniel Fuchs wrote: >> Hi, >> >> Please find below a proposed fix for: >> >> 7184195 - java.util.logging.Logger.getGlobal().info() >> doesn't log without configuration >> >> Jim who was the original evaluator of this bug find out >> that the root cause of the issue was that LogManager hadn't been >> initialized yet, and therefore the global Logger returned had its >> manager instance 'null' - and more to the point - had no configuration >> since the configuration is established by the LogManager. >> >> The fix proposed is simple. In getGlobal() we check whether >> the 'manager' variable is null - and if it is, we initialize it >> by calling LogManager.getLogManager(). >> This is a pattern which is already present at other places in >> the Logger.java class file. >> >> >> >> However - initialization of LogManager has proved to be fragile >> in the past - in particular wrt deadlocks between Logger and >> LogManager caused by circular class initialization. >> >> Therefore, I have added two test files TestGetGlobal.java and >> TestGetGlobal2.java which try to trigger such deadlocks by >> calling Logger.getGlobal() >> or Logger.getLogger(Logger.GLOBAL_LOGGER_NAME) before the >> LogManager class is initialized. >> >> The tests have a bunch of @run line trying to do so with >> different configurations, including by using custom LogManager >> subclasses, with and without a security manager on. >> >> I have seen no issue so far. >> >> best regards, >> >> -- daniel > From peter.levart at gmail.com Mon Jul 1 17:58:24 2013 From: peter.levart at gmail.com (Peter Levart) Date: Mon, 01 Jul 2013 19:58:24 +0200 Subject: RFR: 8015315: Stream.concat methods In-Reply-To: <51D1A562.4070409@gmail.com> References: <51CE3142.60800@oracle.com> <51D15168.2020403@univ-mlv.fr> <51D169C3.4040706@gmail.com> <51D181F5.6060106@univ-mlv.fr> <51D1A562.4070409@gmail.com> Message-ID: <51D1C340.7010602@gmail.com> Hi, Perhaps the Spliterator.trySplit() method should have been declared as: Spliterator trySplit(); Regards, Peter On 07/01/2013 05:50 PM, Peter Levart wrote: > > On 07/01/2013 03:19 PM, Remi Forax wrote: >> On 07/01/2013 01:36 PM, Peter Levart wrote: >>> >>> On 07/01/2013 11:52 AM, Remi Forax wrote: >>>> On 06/29/2013 02:58 AM, Henry Jen wrote: >>>>> Hi, >>>>> >>>>> Please review the webrev that add concat static method to Stream and >>>>> primitive Streams. >>>>> >>>>> http://cr.openjdk.java.net/~henryjen/ccc/8015315.0/webrev/ >>>>> >>>>> Cheers, >>>>> Henry >>>> >>>> Hi Henry, >>>> I find the the cast to Spliterator in Streams.concat() dubious, >>>> I can not see how it can be correct, could you explain why this >>>> cast is Ok. >>>> >>>> cheers, >>>> R?mi >>>> >>> >>> Hi, >> >> Hi, >> >>> >>> I think that if we want to concat say Stream with >>> Stream, producing Stream, there would have to be an >>> unsafe cast somewhere. Since Stream API apears to be covariant >>> (like for example Iterator), casting Stream to >>> Stream seems to be safe. >> >> if Stream is covariant, it should be possible to create a Stream >> from a Spliterator, >> so there is no need of such unsafe cast. > > Sorry, I meant so say: > > Spliterator API apears to be covariant (like for example > Iterator), so casting Spliterator toSpliterator > seems to be safe. > > Regarding creating Stream from a Spliterator it > wouldn't help here, since we can't create Spliterator > from two spliterators: Spliterator and Spliterator extends T> without unsafe cast in the first place... > > So maybe we should bury the unsafe cast in the ConcatSpliterator's > constructor then... > > Regards, Peter > >> >>> >>> Regards, Peter >>> >> >> cheers, >> R?mi >> > From mandy.chung at oracle.com Mon Jul 1 17:57:32 2013 From: mandy.chung at oracle.com (Mandy Chung) Date: Mon, 01 Jul 2013 10:57:32 -0700 Subject: RFR: JDK-7184195 - java.util.logging.Logger.getGlobal().info() doesn't log without configuration In-Reply-To: <51D18365.3040409@oracle.com> References: <51C1CEE9.9010200@oracle.com> <51CDE603.1030309@oracle.com> <51D18365.3040409@oracle.com> Message-ID: <51D1C30C.1070408@oracle.com> On 7/1/13 6:25 AM, Daniel Fuchs wrote: > >> Looks good in general. Some comments: >> >> Logger.global is deprecated. In LogManager static initializer, we >> should have @SuppressWarnings("deprecation") on Logger.global (probably >> need to define a local variable) to suppress the warning and together >> with your comment it will make it clear that accessing this deprecated >> field is intentional. > > Right. I can do that. But I don't see any warnings when compiling > (with make) - maybe they're turned out by default? Deprecation and a few other javac warnings are disabled (see jdk/makefiles/Setup.gmk). > >> >> As you pointed out, the same pattern is used in the checkPermission() >> method. Might be worth having a private getManager() method to replace >> direct access to the manager field in the Logger class - just a thought >> to prevent similar bug from happening again. > > Well - hmm - I'd prefer to do that in a later cleanup. > I'd want first to analyze all the places where manager is used. > Plus there is Peter's suggestion about changing the dynamics > between LogManager & Logger. > Both are excellent suggestions but I think I'd like to dedicate > a whole changeset for this kind of cleanup, without mixing it > with bug fix. Agree. It's good to do it in a separate fix especially it may involve untangling the Logger and LogManager initialization. Mandy From daniel.fuchs at oracle.com Mon Jul 1 18:07:33 2013 From: daniel.fuchs at oracle.com (Daniel Fuchs) Date: Mon, 01 Jul 2013 20:07:33 +0200 Subject: RFR: JDK-7184195 - java.util.logging.Logger.getGlobal().info() doesn't log without configuration In-Reply-To: <51D1C1B0.7050107@oracle.com> References: <51C1CEE9.9010200@oracle.com> <51CECB3E.2010501@gmail.com> <51D1C1B0.7050107@oracle.com> Message-ID: <51D1C565.7040004@oracle.com> On 7/1/13 7:51 PM, Mandy Chung wrote: > On 6/29/13 4:55 AM, Peter Levart wrote: >> Hi, >> >> I haven't studied this deeply yet, but maybe somebody knows the >> answer: Why is it necessary to add root and global loggers to >> LogManager in it's static initializer? Global Logger could be created >> and initialized lazily, when 1st requested (in static initialization >> of Logger class), and the root Logger is always "ensured" lazily >> before any other Logger is initialized. If the dependency on Logger >> class was removed from LogManager static initialization, then Logger >> static/lazy initialization could depend on LogManager (either just >> LogManager.manager field when fully configured LogManager is not >> needed/can't be requested or LogManager.getLogManager() for fully >> configured LogManager) ... >> >> The initialization of LogManager, root & default Loggers is very >> entangled currently and any change to such code can be fragile. >> >> What dou you think of untangling it? > > This is a good suggestion. Daniel has a patch to ensure both the root > logger and global logger in the LoggerContext [1] and untangling the > LogManager and Logger initialization would be possible. HI Peter, Mandy, Well - yes - this is certainly an excellent suggestion, but I think I'd like to do it in a separate changeset dedicated to cleanup. The trouble here is that we would want the LogManager instance to have a root and global logger added to it - but we would also not want any other private LogManager instances created by the application to have any such loggers added lazily. We would thus need a way to know whether 'this' LogManager instance is the default, and this can only be done by comparing to the value of the LogManager.manager field - which could pause interesting challenges if the said field is still null... I'd prefer to log that as a separate issue. But this is definitely something I want to investigate in the short term. Would that be OK with you Peter? best regards, -- daniel > > Mandy > [1] > http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-June/018518.html >> >> Regards, Peter >> >> On 06/19/2013 05:31 PM, Daniel Fuchs wrote: >>> Hi, >>> >>> Please find below a proposed fix for: >>> >>> 7184195 - java.util.logging.Logger.getGlobal().info() >>> doesn't log without configuration >>> >>> Jim who was the original evaluator of this bug find out >>> that the root cause of the issue was that LogManager hadn't been >>> initialized yet, and therefore the global Logger returned had its >>> manager instance 'null' - and more to the point - had no configuration >>> since the configuration is established by the LogManager. >>> >>> The fix proposed is simple. In getGlobal() we check whether >>> the 'manager' variable is null - and if it is, we initialize it >>> by calling LogManager.getLogManager(). >>> This is a pattern which is already present at other places in >>> the Logger.java class file. >>> >>> >>> >>> However - initialization of LogManager has proved to be fragile >>> in the past - in particular wrt deadlocks between Logger and >>> LogManager caused by circular class initialization. >>> >>> Therefore, I have added two test files TestGetGlobal.java and >>> TestGetGlobal2.java which try to trigger such deadlocks by >>> calling Logger.getGlobal() >>> or Logger.getLogger(Logger.GLOBAL_LOGGER_NAME) before the >>> LogManager class is initialized. >>> >>> The tests have a bunch of @run line trying to do so with >>> different configurations, including by using custom LogManager >>> subclasses, with and without a security manager on. >>> >>> I have seen no issue so far. >>> >>> best regards, >>> >>> -- daniel >> > From mandy.chung at oracle.com Mon Jul 1 18:14:04 2013 From: mandy.chung at oracle.com (Mandy Chung) Date: Mon, 01 Jul 2013 11:14:04 -0700 Subject: RFR: 8017463: [TEST_BUG] 2 tests from tools/pack200/ remain about 1 GB of data in work directory after execution In-Reply-To: <51CF91CD.9040901@oracle.com> References: <51CF91CD.9040901@oracle.com> Message-ID: <51D1C6EC.8040106@oracle.com> On 6/29/13 7:02 PM, Kumar Srinivasan wrote: > Hi, > > Please review changes to cleanup the test area after pack200 test > completion. Some tests generally use large jars and a local copy of > the JDK to > test with, created a generic utility to nuke most of the remains. > > The webrev: > http://cr.openjdk.java.net/~ksrini/8017463/webrev.0/ > In Utils.cleanup, it will delete the files with certain extensions in the current directory. I skimmed on the tests and look to me that those files can be altered with a different path and not necessary in the current directory. Just wonder if you want to make cleanup to take a path parameter instead of hardcoding the cwd. Otherwise, this change looks fine with me. Mandy > The bug: > http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8017463 > > Thanks > Kumar > From daniel.fuchs at oracle.com Mon Jul 1 18:23:47 2013 From: daniel.fuchs at oracle.com (Daniel Fuchs) Date: Mon, 01 Jul 2013 20:23:47 +0200 Subject: RFR: JDK-7184195 - java.util.logging.Logger.getGlobal().info() doesn't log without configuration In-Reply-To: <51D1C30C.1070408@oracle.com> References: <51C1CEE9.9010200@oracle.com> <51CDE603.1030309@oracle.com> <51D18365.3040409@oracle.com> <51D1C30C.1070408@oracle.com> Message-ID: <51D1C933.7040607@oracle.com> Hi Mandy, Please find an updated webrev. I have refactored the tests a bit: renamed "TestGetGlobal2" into "TestGetGlobalByName" put the auxiliary classes in a sub directory removed the 'Test' prefix from the auxiliary classes, added comments in the various LogManagerImpl* classes updated the 3 tests summary. added "." as default value for test.src. Hope you find it more to your liking! Best regards, -- daniel On 7/1/13 7:57 PM, Mandy Chung wrote: > On 7/1/13 6:25 AM, Daniel Fuchs wrote: >> >>> Looks good in general. Some comments: >>> >>> Logger.global is deprecated. In LogManager static initializer, we >>> should have @SuppressWarnings("deprecation") on Logger.global (probably >>> need to define a local variable) to suppress the warning and together >>> with your comment it will make it clear that accessing this deprecated >>> field is intentional. >> >> Right. I can do that. But I don't see any warnings when compiling >> (with make) - maybe they're turned out by default? > > Deprecation and a few other javac warnings are disabled (see > jdk/makefiles/Setup.gmk). >> >>> >>> As you pointed out, the same pattern is used in the checkPermission() >>> method. Might be worth having a private getManager() method to replace >>> direct access to the manager field in the Logger class - just a thought >>> to prevent similar bug from happening again. >> >> Well - hmm - I'd prefer to do that in a later cleanup. >> I'd want first to analyze all the places where manager is used. >> Plus there is Peter's suggestion about changing the dynamics >> between LogManager & Logger. >> Both are excellent suggestions but I think I'd like to dedicate >> a whole changeset for this kind of cleanup, without mixing it >> with bug fix. > > Agree. It's good to do it in a separate fix especially it may involve > untangling the Logger and LogManager initialization. > > Mandy From joe.darcy at oracle.com Mon Jul 1 18:24:52 2013 From: joe.darcy at oracle.com (Joe Darcy) Date: Mon, 01 Jul 2013 11:24:52 -0700 Subject: JDK 8 code review request for doclint issues in java.lang.instrument Message-ID: <51D1C974.80704@oracle.com> Hello, Yet another found of doclint fixes for review; this batch to java.lang.instrument. Thanks, -Joe diff -r 9eaeb1a0aa46 src/share/classes/java/lang/instrument/Instrumentation.java --- a/src/share/classes/java/lang/instrument/Instrumentation.java Sun Jun 30 17:15:47 2013 -0700 +++ b/src/share/classes/java/lang/instrument/Instrumentation.java Mon Jul 01 11:23:19 2013 -0700 @@ -363,6 +363,8 @@ * Primitive classes (for example, java.lang.Integer.TYPE) * and array classes are never modifiable. * + * @param theClass the class to check for being modifiable + * @return whether or not the argument class is modifiable * @throws java.lang.NullPointerException if the specified class is null. * * @see #retransformClasses @@ -549,14 +551,14 @@ * {@link java.lang.instrument.ClassFileTransformer ClassFileTransformer}, * it enables native methods to be * instrumented. - *

+ *

* Since native methods cannot be directly instrumented * (they have no bytecodes), they must be wrapped with * a non-native method which can be instrumented. * For example, if we had: *

       *   native boolean foo(int x);
- *

+ *

* We could transform the class file (with the * ClassFileTransformer during the initial definition * of the class) so that this becomes: @@ -567,14 +569,14 @@ * } * * native boolean wrapped_foo(int x); - *

+ *

* Where foo becomes a wrapper for the actual native * method with the appended prefix "wrapped_". Note that * "wrapped_" would be a poor choice of prefix since it * might conceivably form the name of an existing method * thus something like "$$$MyAgentWrapped$$$_" would be * better but would make these examples less readable. - *

+ *

* The wrapper will allow data to be collected on the native * method call, but now the problem becomes linking up the * wrapped method with the native implementation. @@ -583,7 +585,7 @@ * which might be: *

       *   Java_somePackage_someClass_foo(JNIEnv* env, jint x)
- *

+ *

* This function allows the prefix to be specified and the * proper resolution to occur. * Specifically, when the standard resolution fails, the @@ -596,29 +598,29 @@ *

{@code
       *   method(foo) -> nativeImplementation(foo)
       * }
- *

+ *

* When this fails, the resolution will be retried with * the specified prefix prepended to the method name, * yielding the correct resolution: *

{@code
       *   method(wrapped_foo) -> nativeImplementation(foo)
       * }
- *

+ *

* For automatic resolution, the JVM will attempt: *

{@code
       *   method(wrapped_foo) -> nativeImplementation(wrapped_foo)
       * }
- *

+ *

* When this fails, the resolution will be retried with * the specified prefix deleted from the implementation name, * yielding the correct resolution: *

{@code
       *   method(wrapped_foo) -> nativeImplementation(foo)
       * }
- *

+ *

* Note that since the prefix is only used when standard * resolution fails, native methods can be wrapped selectively. - *

+ *

* Since each ClassFileTransformer * can do its own transformation of the bytecodes, more * than one layer of wrappers may be applied. Thus each From mandy.chung at oracle.com Mon Jul 1 18:24:04 2013 From: mandy.chung at oracle.com (Mandy Chung) Date: Mon, 01 Jul 2013 11:24:04 -0700 Subject: RFR: JDK-7184195 - java.util.logging.Logger.getGlobal().info() doesn't log without configuration In-Reply-To: <51D1C933.7040607@oracle.com> References: <51C1CEE9.9010200@oracle.com> <51CDE603.1030309@oracle.com> <51D18365.3040409@oracle.com> <51D1C30C.1070408@oracle.com> <51D1C933.7040607@oracle.com> Message-ID: <51D1C944.9060801@oracle.com> On 7/1/13 11:23 AM, Daniel Fuchs wrote: > Hi Mandy, > > Please find an updated webrev. > > I have refactored the tests a bit: > > renamed "TestGetGlobal2" into "TestGetGlobalByName" > put the auxiliary classes in a sub directory > removed the 'Test' prefix from the auxiliary classes, > added comments in the various LogManagerImpl* classes > updated the 3 tests summary. > added "." as default value for test.src. > > Looks good. Thanks for the update. Mandy From brian.burkhalter at oracle.com Mon Jul 1 18:32:18 2013 From: brian.burkhalter at oracle.com (Brian Burkhalter) Date: Mon, 1 Jul 2013 11:32:18 -0700 Subject: Refresh - Java 8 RFR 8017540: Improve multi-threaded contention behavior of BigInteger.toString() radix conversion cache In-Reply-To: <51D13D6F.6010109@oracle.com> References: <51D13D6F.6010109@oracle.com> Message-ID: <9ABA8055-A4F6-4263-A776-24A97BDF44FE@oracle.com> On Jul 1, 2013, at 1:27 AM, Aleksey Shipilev wrote: > On 06/28/2013 10:24 PM, Brian Burkhalter wrote: >> http://cr.openjdk.java.net/~bpb/8017540/ > > Thumbs up. Thanks. Now all we need is the imprimatur of an OpenJDK Reviewer. > -Aleksey. > > N.B.: You can put me in with "Reviewed-by: shade". Done. Brian From huizhe.wang at oracle.com Mon Jul 1 18:33:56 2013 From: huizhe.wang at oracle.com (huizhe wang) Date: Mon, 01 Jul 2013 11:33:56 -0700 Subject: RFR: JAXP 1.5 for JDK8/7u40: 8016648: FEATURE_SECURE_PROCESSING set to true or false causes SAXParseException to be thrown In-Reply-To: <51D1A3F2.2000707@oracle.com> References: <51D13933.8090901@oracle.com> <51D1A3F2.2000707@oracle.com> Message-ID: <51D1CB94.90901@oracle.com> On 7/1/2013 8:44 AM, Alan Bateman wrote: > On 01/07/2013 09:09, huizhe wang wrote: >> Hi, >> >> There have been two revisions in JAXP 1.5 specification: 1) the >> relationship between the JAXP 1.5 properties and >> FEATURE_SECURE_PROCESSING (FSP) is now a recommendation. It is up to >> the implementation to decide if it wants to restrict when FSP is >> set. 2) System properties will override that may have been set by FSP. >> >> In the following patch, a JDK version detection code is added so that >> when FSP is set explicitly, for JDK7, there will be no restrictions, >> but for JDK8 and above, the restrictions are on. >> >> The effective order is changed so that JAXP 1.5 defined system >> properties will override that may be set by enabling FSP. >> >> Please review: >> http://cr.openjdk.java.net/~joehw/jdk8/8016648/webrev/ >> >> Note that the patch is identical for JDK7 and 8, and I plan to ask >> approval for 7u40 integration. >> >> Thanks, >> Joe > > Are there tests that can be used to verify this (both for 8 and 7u40? > Are you confident that tests cover all the overrides scenarios? I've updated the jaxp 1.5 tests. I'll send a separate link since it's internal. Indeed, I missed a couple of scenarios: 1) FSP can be set after jaxp 1.5 properties are set through the API; 2) Validator does not require, but does support FSP. > > I think isJDKandAbove has the assume the long standing format for > java.version. If someone really did change the format to what you are > suggesting then the code would fail with a value such as "7.40". The code does support both the current and possible new format by comparing the 0 element, e.g. Integer.parseInt(versions[0]) >= compareTo. But I see Joe's comment provided a better way to handle this. > > In getJAXPSystemProperty's comment then I assume it should be > ${java.home}. Ok. Thanks, Joe > > -Alan > > > From huizhe.wang at oracle.com Mon Jul 1 18:34:44 2013 From: huizhe.wang at oracle.com (huizhe wang) Date: Mon, 01 Jul 2013 11:34:44 -0700 Subject: RFR: JAXP 1.5 for JDK8/7u40: 8016648: FEATURE_SECURE_PROCESSING set to true or false causes SAXParseException to be thrown In-Reply-To: <51D1A98C.70301@oracle.com> References: <51D13933.8090901@oracle.com> <51D1A3F2.2000707@oracle.com> <51D1A98C.70301@oracle.com> Message-ID: <51D1CBC4.4050904@oracle.com> Thanks Joe! That's the API I was looking for! On 7/1/2013 9:08 AM, Joe Darcy wrote: > If you just want to test for platform version (7 vs 8), you might also > look at javax.lang.model.SourceVersion.latest(). > > -Joe > > On 7/1/2013 8:44 AM, Alan Bateman wrote: >> On 01/07/2013 09:09, huizhe wang wrote: >>> Hi, >>> >>> There have been two revisions in JAXP 1.5 specification: 1) the >>> relationship between the JAXP 1.5 properties and >>> FEATURE_SECURE_PROCESSING (FSP) is now a recommendation. It is up to >>> the implementation to decide if it wants to restrict when FSP is >>> set. 2) System properties will override that may have been set by FSP. >>> >>> In the following patch, a JDK version detection code is added so >>> that when FSP is set explicitly, for JDK7, there will be no >>> restrictions, but for JDK8 and above, the restrictions are on. >>> >>> The effective order is changed so that JAXP 1.5 defined system >>> properties will override that may be set by enabling FSP. >>> >>> Please review: >>> http://cr.openjdk.java.net/~joehw/jdk8/8016648/webrev/ >>> >>> Note that the patch is identical for JDK7 and 8, and I plan to ask >>> approval for 7u40 integration. >>> >>> Thanks, >>> Joe >> >> Are there tests that can be used to verify this (both for 8 and 7u40? >> Are you confident that tests cover all the overrides scenarios? >> >> I think isJDKandAbove has the assume the long standing format for >> java.version. If someone really did change the format to what you are >> suggesting then the code would fail with a value such as "7.40". >> >> In getJAXPSystemProperty's comment then I assume it should be >> ${java.home}. >> >> -Alan >> >> >> > From lance.andersen at oracle.com Mon Jul 1 18:38:43 2013 From: lance.andersen at oracle.com (Lance @ Oracle) Date: Mon, 1 Jul 2013 14:38:43 -0400 Subject: JDK 8 code review request for doclint issues in java.lang.instrument In-Reply-To: <51D1C974.80704@oracle.com> References: <51D1C974.80704@oracle.com> Message-ID: <83B8EC57-0197-45CE-B2FD-2C654304BC9E@oracle.com> Looks good Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 Oracle Java Engineering 1 Network Drive Burlington, MA 01803 Lance.Andersen at oracle.com Sent from my iPad On Jul 1, 2013, at 2:24 PM, Joe Darcy wrote: > Hello, > > Yet another found of doclint fixes for review; this batch to java.lang.instrument. > > Thanks, > > -Joe > > diff -r 9eaeb1a0aa46 src/share/classes/java/lang/instrument/Instrumentation.java > --- a/src/share/classes/java/lang/instrument/Instrumentation.java Sun Jun 30 17:15:47 2013 -0700 > +++ b/src/share/classes/java/lang/instrument/Instrumentation.java Mon Jul 01 11:23:19 2013 -0700 > @@ -363,6 +363,8 @@ > * Primitive classes (for example, java.lang.Integer.TYPE) > * and array classes are never modifiable. > * > + * @param theClass the class to check for being modifiable > + * @return whether or not the argument class is modifiable > * @throws java.lang.NullPointerException if the specified class is null. > * > * @see #retransformClasses > @@ -549,14 +551,14 @@ > * {@link java.lang.instrument.ClassFileTransformer ClassFileTransformer}, > * it enables native methods to be > * instrumented. > - *

> + *

> * Since native methods cannot be directly instrumented > * (they have no bytecodes), they must be wrapped with > * a non-native method which can be instrumented. > * For example, if we had: > *

>      *   native boolean foo(int x);
> - *

> + *

> * We could transform the class file (with the > * ClassFileTransformer during the initial definition > * of the class) so that this becomes: > @@ -567,14 +569,14 @@ > * } > * > * native boolean wrapped_foo(int x); > - *

> + *

> * Where foo becomes a wrapper for the actual native > * method with the appended prefix "wrapped_". Note that > * "wrapped_" would be a poor choice of prefix since it > * might conceivably form the name of an existing method > * thus something like "$$$MyAgentWrapped$$$_" would be > * better but would make these examples less readable. > - *

> + *

> * The wrapper will allow data to be collected on the native > * method call, but now the problem becomes linking up the > * wrapped method with the native implementation. > @@ -583,7 +585,7 @@ > * which might be: > *

>      *   Java_somePackage_someClass_foo(JNIEnv* env, jint x)
> - *

> + *

> * This function allows the prefix to be specified and the > * proper resolution to occur. > * Specifically, when the standard resolution fails, the > @@ -596,29 +598,29 @@ > *

{@code
>      *   method(foo) -> nativeImplementation(foo)
>      * }
> - *

> + *

> * When this fails, the resolution will be retried with > * the specified prefix prepended to the method name, > * yielding the correct resolution: > *

{@code
>      *   method(wrapped_foo) -> nativeImplementation(foo)
>      * }
> - *

> + *

> * For automatic resolution, the JVM will attempt: > *

{@code
>      *   method(wrapped_foo) -> nativeImplementation(wrapped_foo)
>      * }
> - *

> + *

> * When this fails, the resolution will be retried with > * the specified prefix deleted from the implementation name, > * yielding the correct resolution: > *

{@code
>      *   method(wrapped_foo) -> nativeImplementation(foo)
>      * }
> - *

> + *

> * Note that since the prefix is only used when standard > * resolution fails, native methods can be wrapped selectively. > - *

> + *

> * Since each ClassFileTransformer > * can do its own transformation of the bytecodes, more > * than one layer of wrappers may be applied. Thus each > From Alan.Bateman at oracle.com Mon Jul 1 18:47:34 2013 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Mon, 01 Jul 2013 19:47:34 +0100 Subject: JDK 8 code review request for doclint issues in java.lang.instrument In-Reply-To: <51D1C974.80704@oracle.com> References: <51D1C974.80704@oracle.com> Message-ID: <51D1CEC6.7080702@oracle.com> On 01/07/2013 19:24, Joe Darcy wrote: > Hello, > > Yet another found of doclint fixes for review; this batch to > java.lang.instrument. > > Thanks, > > -Joe This looks okay to me. -Alan From peter.levart at gmail.com Mon Jul 1 19:15:27 2013 From: peter.levart at gmail.com (Peter Levart) Date: Mon, 01 Jul 2013 21:15:27 +0200 Subject: RFR: JDK-7184195 - java.util.logging.Logger.getGlobal().info() doesn't log without configuration In-Reply-To: <51D1C565.7040004@oracle.com> References: <51C1CEE9.9010200@oracle.com> <51CECB3E.2010501@gmail.com> <51D1C1B0.7050107@oracle.com> <51D1C565.7040004@oracle.com> Message-ID: <51D1D54F.3000006@gmail.com> On 07/01/2013 08:07 PM, Daniel Fuchs wrote: > On 7/1/13 7:51 PM, Mandy Chung wrote: >> On 6/29/13 4:55 AM, Peter Levart wrote: >>> Hi, >>> >>> I haven't studied this deeply yet, but maybe somebody knows the >>> answer: Why is it necessary to add root and global loggers to >>> LogManager in it's static initializer? Global Logger could be created >>> and initialized lazily, when 1st requested (in static initialization >>> of Logger class), and the root Logger is always "ensured" lazily >>> before any other Logger is initialized. If the dependency on Logger >>> class was removed from LogManager static initialization, then Logger >>> static/lazy initialization could depend on LogManager (either just >>> LogManager.manager field when fully configured LogManager is not >>> needed/can't be requested or LogManager.getLogManager() for fully >>> configured LogManager) ... >>> >>> The initialization of LogManager, root & default Loggers is very >>> entangled currently and any change to such code can be fragile. >>> >>> What dou you think of untangling it? >> >> This is a good suggestion. Daniel has a patch to ensure both the root >> logger and global logger in the LoggerContext [1] and untangling the >> LogManager and Logger initialization would be possible. > > HI Peter, Mandy, > > Well - yes - this is certainly an excellent suggestion, but I think > I'd like to do it in a separate changeset dedicated to cleanup. > > The trouble here is that we would want the LogManager instance to have > a root and global logger added to it - but we would also not want > any other private LogManager instances created by the application to > have any such loggers added lazily. > > We would thus need a way to know whether 'this' LogManager instance > is the default, and this can only be done by comparing to the > value of the LogManager.manager field - which could pause interesting > challenges if the said field is still null... > > I'd prefer to log that as a separate issue. But this is definitely > something I want to investigate in the short term. > Would that be OK with you Peter? Of course. Regards, Peter > > best regards, > > -- daniel > >> >> Mandy >> [1] >> http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-June/018518.html >> >>> >>> Regards, Peter >>> >>> On 06/19/2013 05:31 PM, Daniel Fuchs wrote: >>>> Hi, >>>> >>>> Please find below a proposed fix for: >>>> >>>> 7184195 - java.util.logging.Logger.getGlobal().info() >>>> doesn't log without configuration >>>> >>>> Jim who was the original evaluator of this bug find out >>>> that the root cause of the issue was that LogManager hadn't been >>>> initialized yet, and therefore the global Logger returned had its >>>> manager instance 'null' - and more to the point - had no configuration >>>> since the configuration is established by the LogManager. >>>> >>>> The fix proposed is simple. In getGlobal() we check whether >>>> the 'manager' variable is null - and if it is, we initialize it >>>> by calling LogManager.getLogManager(). >>>> This is a pattern which is already present at other places in >>>> the Logger.java class file. >>>> >>>> >>>> >>>> However - initialization of LogManager has proved to be fragile >>>> in the past - in particular wrt deadlocks between Logger and >>>> LogManager caused by circular class initialization. >>>> >>>> Therefore, I have added two test files TestGetGlobal.java and >>>> TestGetGlobal2.java which try to trigger such deadlocks by >>>> calling Logger.getGlobal() >>>> or Logger.getLogger(Logger.GLOBAL_LOGGER_NAME) before the >>>> LogManager class is initialized. >>>> >>>> The tests have a bunch of @run line trying to do so with >>>> different configurations, including by using custom LogManager >>>> subclasses, with and without a security manager on. >>>> >>>> I have seen no issue so far. >>>> >>>> best regards, >>>> >>>> -- daniel >>> >> > From joe.darcy at oracle.com Mon Jul 1 18:59:03 2013 From: joe.darcy at oracle.com (joe.darcy at oracle.com) Date: Mon, 01 Jul 2013 18:59:03 +0000 Subject: hg: jdk8/tl/langtools: 7162089: Add support for repeating annotations to javax.annotation.processing Message-ID: <20130701185910.5457F486D4@hg.openjdk.java.net> Changeset: 1908e86ee49a Author: darcy Date: 2013-07-01 11:58 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/1908e86ee49a 7162089: Add support for repeating annotations to javax.annotation.processing Reviewed-by: abuckley, jjg, jfranck ! src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java ! src/share/classes/com/sun/tools/javac/processing/JavacRoundEnvironment.java ! src/share/classes/javax/annotation/processing/AbstractProcessor.java ! src/share/classes/javax/annotation/processing/Processor.java ! test/tools/javac/processing/environment/round/TestElementsAnnotatedWith.java + test/tools/javac/processing/environment/round/TpAnno.java + test/tools/javac/processing/environment/round/TypeParameterAnnotations.java From alan.bateman at oracle.com Mon Jul 1 19:41:10 2013 From: alan.bateman at oracle.com (alan.bateman at oracle.com) Date: Mon, 01 Jul 2013 19:41:10 +0000 Subject: hg: jdk8/tl/jdk: 8017540: Improve multi-threaded contention behavior of radix conversion cache Message-ID: <20130701194122.08C8B486DC@hg.openjdk.java.net> Changeset: c8cf01de8fa8 Author: bpb Date: 2013-07-01 11:30 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/c8cf01de8fa8 8017540: Improve multi-threaded contention behavior of radix conversion cache Summary: Replace array of ArrayList of BigIntegers with a volatile two-dimensional BigInteger array eliminate the synchronization of getRadixConversionCache() Reviewed-by: plevart, shade, bpb, alanb Contributed-by: Peter Levart , Dmitry Nadezhin , Aleksey Shipilev ! src/share/classes/java/math/BigInteger.java From brian.burkhalter at oracle.com Mon Jul 1 19:47:17 2013 From: brian.burkhalter at oracle.com (Brian Burkhalter) Date: Mon, 1 Jul 2013 12:47:17 -0700 Subject: Code update for 8014319: Faster division of large integers In-Reply-To: References: Message-ID: <5D364847-297D-4317-AA31-8B6A0ACD90BC@oracle.com> Tim, On Jun 30, 2013, at 4:20 PM, Tim Buktu wrote: > I made a few changes to the BigInteger code in my GitHub repo: > * Moved Burnikel-Ziegler division to MutableBigInteger > * Added more comments to the Burnikel-Ziegler code > * Updated Barrett thresholds > * Merged BigInteger.java and BigIntegerTest.java with the latest from hg That would be starting from this changeset? changeset: 7498:01fcca3d2b8c user: bpb date: Thu Jun 20 12:15:24 2013 -0700 summary: 4641897: Faster string conversion of large integers > The files at the links below contain the latest code for bugs 8014319 and 8014320. > Brian, if you want me to, I can make an updated patch for just 8014319. That would be helpful if you don't mind. Note that this changeset modifying BigInteger http://hg.openjdk.java.net/jdk8/tl/jdk/rev/c8cf01de8fa8 was just applied today. > https://raw.github.com/tbuktu/bigint/4c24162e99227e177f17f5db9b8ca2757820d2cd/src/main/java/java/math/BigInteger.java > https://raw.github.com/tbuktu/bigint/95f1158d2205614c8739344df07ee35523b8ad89/src/main/java/java/math/MutableBigInteger.java > https://raw.github.com/tbuktu/bigint/95f1158d2205614c8739344df07ee35523b8ad89/src/main/java/java/math/MutableBigInteger.java > > Is 8014319 going to be next up for review? I had planned to try to post it this week, but I am not certain at this point, especially given the short week due to the US July 4 holiday. > Also, would it be okay to do a s/Reminder/Remainder/g on > MutableBigInteger.java and include it in 8014319? That's already been done in the phase{3,4} patched provided by Alan: http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-May/016783.html Thanks, Brian From Alan.Bateman at oracle.com Mon Jul 1 19:54:37 2013 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Mon, 01 Jul 2013 20:54:37 +0100 Subject: RFR: JAXP 1.5 for JDK8/7u40: 8016648: FEATURE_SECURE_PROCESSING set to true or false causes SAXParseException to be thrown In-Reply-To: <51D1CB94.90901@oracle.com> References: <51D13933.8090901@oracle.com> <51D1A3F2.2000707@oracle.com> <51D1CB94.90901@oracle.com> Message-ID: <51D1DE7D.3030105@oracle.com> On 01/07/2013 19:33, huizhe wang wrote: > : > > I've updated the jaxp 1.5 tests. I'll send a separate link since it's > internal. Indeed, I missed a couple of scenarios: 1) FSP can be set > after jaxp 1.5 properties are set through the API; 2) Validator does > not require, but does support FSP. Given the number of parsers involved, the various ways to set properties, the FSP hammer, security manager, ... then it's really important that there is a good set of tests that exercise all the combinations. So I encourage you to put in as much effort as it required to get a good set of tests. It would be great to get them into OpenJDK too, if that is possible. >> >> I think isJDKandAbove has the assume the long standing format for >> java.version. If someone really did change the format to what you are >> suggesting then the code would fail with a value such as "7.40". > > The code does support both the current and possible new format by > comparing the 0 element, e.g. Integer.parseInt(versions[0]) >= > compareTo. But I see Joe's comment provided a better way to handle this. > Okay, I'll wait for the second webrev to see how this looks. -Alan. From joe.darcy at oracle.com Mon Jul 1 20:30:53 2013 From: joe.darcy at oracle.com (joe.darcy at oracle.com) Date: Mon, 01 Jul 2013 20:30:53 +0000 Subject: hg: jdk8/tl/jdk: 8019527: Fix doclint issues in java.lang.instrument Message-ID: <20130701203106.934D4486DE@hg.openjdk.java.net> Changeset: 3736ad2636aa Author: darcy Date: 2013-07-01 13:29 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/3736ad2636aa 8019527: Fix doclint issues in java.lang.instrument Reviewed-by: lancea, alanb ! src/share/classes/java/lang/instrument/Instrumentation.java From joe.darcy at oracle.com Mon Jul 1 20:35:18 2013 From: joe.darcy at oracle.com (Joe Darcy) Date: Mon, 01 Jul 2013 13:35:18 -0700 Subject: JDK 8 code review request for doclint issues in java.util.spi Message-ID: <51D1E806.9000002@oracle.com> Hello, There are a few doclint issues to be fixed in java.util.spi; thanks, -Joe diff -r 3736ad2636aa src/share/classes/java/util/spi/LocaleServiceProvider.java --- a/src/share/classes/java/util/spi/LocaleServiceProvider.java Mon Jul 01 13:29:32 2013 -0700 +++ b/src/share/classes/java/util/spi/LocaleServiceProvider.java Mon Jul 01 13:34:11 2013 -0700 @@ -42,7 +42,7 @@ * interfaces to offer support for locales beyond the set of locales * supported by the Java runtime environment itself. *

- *

Packaging of Locale Sensitive Service Provider Implementations

+ *

Packaging of Locale Sensitive Service Provider Implementations

* Implementations of these locale sensitive services are packaged using the * Java Extension Mechanism * as installed extensions. A provider identifies itself with a @@ -165,7 +165,7 @@ /** * Returns {@code true} if the given {@code locale} is supported by * this locale service provider. The given {@code locale} may contain - * extensions that should be + * extensions that should be * taken into account for the support determination. * *

The default implementation returns {@code true} if the given {@code locale} From lance.andersen at oracle.com Mon Jul 1 20:37:47 2013 From: lance.andersen at oracle.com (Lance @ Oracle) Date: Mon, 1 Jul 2013 16:37:47 -0400 Subject: JDK 8 code review request for doclint issues in java.util.spi In-Reply-To: <51D1E806.9000002@oracle.com> References: <51D1E806.9000002@oracle.com> Message-ID: <818344E8-FF11-423F-BB1E-D6464EB6D342@oracle.com> Looks fine Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 Oracle Java Engineering 1 Network Drive Burlington, MA 01803 Lance.Andersen at oracle.com Sent from my iPad On Jul 1, 2013, at 4:35 PM, Joe Darcy wrote: > Hello, > > There are a few doclint issues to be fixed in java.util.spi; thanks, > > -Joe > > diff -r 3736ad2636aa src/share/classes/java/util/spi/LocaleServiceProvider.java > --- a/src/share/classes/java/util/spi/LocaleServiceProvider.java Mon Jul 01 13:29:32 2013 -0700 > +++ b/src/share/classes/java/util/spi/LocaleServiceProvider.java Mon Jul 01 13:34:11 2013 -0700 > @@ -42,7 +42,7 @@ > * interfaces to offer support for locales beyond the set of locales > * supported by the Java runtime environment itself. > *

> - *

Packaging of Locale Sensitive Service Provider Implementations

> + *

Packaging of Locale Sensitive Service Provider Implementations

> * Implementations of these locale sensitive services are packaged using the > * Java Extension Mechanism > * as installed extensions. A provider identifies itself with a > @@ -165,7 +165,7 @@ > /** > * Returns {@code true} if the given {@code locale} is supported by > * this locale service provider. The given {@code locale} may contain > - * extensions that should be > + * extensions that should be > * taken into account for the support determination. > * > *

The default implementation returns {@code true} if the given {@code locale} > From martinrb at google.com Mon Jul 1 20:38:23 2013 From: martinrb at google.com (Martin Buchholz) Date: Mon, 1 Jul 2013 13:38:23 -0700 Subject: RFR 8019481 Sync misc j.u.c classes from 166 to tl In-Reply-To: References: Message-ID: Looks Good To Me! On Mon, Jul 1, 2013 at 3:52 AM, Paul Sandoz wrote: > Hi, > > The following patch syncs misc-related classes from 166 j.u.c to tl. > Basically stuff that has not already been committed or submitted for review > except CHM stuff (which i will submit next). > > Again this contains docs (+ formatting changes) in addition to > improvements (mainly to Exchanger and Phaser): > > http://cr.openjdk.java.net/~psandoz/tl/JDK-8019481-concur-misc/webrev/ > > Paul. From joe.darcy at oracle.com Mon Jul 1 20:43:20 2013 From: joe.darcy at oracle.com (joe.darcy at oracle.com) Date: Mon, 01 Jul 2013 20:43:20 +0000 Subject: hg: jdk8/tl/jdk: 8019529: Fix doclint issues in java.util.spi Message-ID: <20130701204333.CB309486DF@hg.openjdk.java.net> Changeset: 8e5376324e4b Author: darcy Date: 2013-07-01 13:42 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/8e5376324e4b 8019529: Fix doclint issues in java.util.spi Reviewed-by: lancea ! src/share/classes/java/util/spi/LocaleServiceProvider.java From joe.darcy at oracle.com Mon Jul 1 20:55:27 2013 From: joe.darcy at oracle.com (Joe Darcy) Date: Mon, 01 Jul 2013 13:55:27 -0700 Subject: JDK 8 code review request for doclint fixes in java.time.format Message-ID: <51D1ECBF.6040603@oracle.com> Hello, The patch below resolves the two remaining doclint issues in java.time.format. Thanks, -Joe --- a/src/share/classes/java/time/format/DateTimeFormatter.java Mon Jul 01 13:42:03 2013 -0700 +++ b/src/share/classes/java/time/format/DateTimeFormatter.java Mon Jul 01 13:53:45 2013 -0700 @@ -1304,6 +1304,7 @@ * LocalTime time = parsed.query(LocalTime::from); * Period extraDays = parsed.query(DateTimeFormatter.parsedExcessDays()); * + * @return a query that provides access to the excess days that were parsed */ public static final TemporalQuery parsedExcessDays() { return PARSED_EXCESS_DAYS; @@ -1344,6 +1345,7 @@ * // validate leap-second is correct and apply correct smoothing * } * + * @return a query that provides access to whether a leap-second was parsed */ public static final TemporalQuery parsedLeapSecond() { return PARSED_LEAP_SECOND; From joe.darcy at oracle.com Mon Jul 1 21:12:19 2013 From: joe.darcy at oracle.com (Joseph Darcy) Date: Mon, 01 Jul 2013 14:12:19 -0700 Subject: JDK-8016285: Add java.lang.reflect.Parameter.isNamePresent() In-Reply-To: <51D19A6C.7090406@oracle.com> References: <51C4B02B.7040004@oracle.com> <51C4B47E.4060702@oracle.com> <51C4E010.1050603@oracle.com> <51C89C00.20604@oracle.com> <51D19A6C.7090406@oracle.com> Message-ID: <51D1F0B3.2020909@oracle.com> We generally don't delve into low-level presentation details, but the change looks fine -- approved to go back. Cheers, -Joe On 7/1/2013 8:04 AM, Eric McCorkle wrote: > Pinging this one again... > > On 06/24/13 15:20, Eric McCorkle wrote: >> Pinging this RFR. It still needs a capital R reviewer. >> http://cr.openjdk.java.net/~emc/8016285/ >> >> On 06/21/13 19:21, Eric McCorkle wrote: >>> On 06/21/13 16:15, Aleksey Shipilev wrote: >>>> On 06/21/2013 11:57 PM, Eric McCorkle wrote: >>>>> The webrev is here: >>>>> http://cr.openjdk.java.net/~emc/8016285/ >>>> Looks generally good (but not a Reviewer). >>>> >>>> A few questions though: >>>> a) Are we em-bracing the brace-less control flow blocks? >>> Fixed it. >>> >>>> b) Should hasRealParameterData be transient? >>>> c) Should hasRealParameterData be volatile? (now is being implicitly >>>> protected by $parameters volatile write/read, but it is fragile) >>> Transient yes. Volatile, I'd say I think not, since It's written before >>> it's read on all possible paths, and all writes are the same value. >>> But... I set it volatile just to be safe from reordering problems. >>> >>> Webrev's been updated. >>> http://cr.openjdk.java.net/~emc/8016285/ >>> From roger.riggs at oracle.com Mon Jul 1 21:09:45 2013 From: roger.riggs at oracle.com (roger riggs) Date: Mon, 01 Jul 2013 17:09:45 -0400 Subject: JDK 8 code review request for doclint fixes in java.time.format In-Reply-To: <51D1ECBF.6040603@oracle.com> References: <51D1ECBF.6040603@oracle.com> Message-ID: <51D1F019.2010102@oracle.com> These look fine. (But I'm not an official reviewer.) On 7/1/2013 4:55 PM, Joe Darcy wrote: > Hello, > > The patch below resolves the two remaining doclint issues in > java.time.format. > > Thanks, > > -Joe > > --- a/src/share/classes/java/time/format/DateTimeFormatter.java Mon > Jul 01 13:42:03 2013 -0700 > +++ b/src/share/classes/java/time/format/DateTimeFormatter.java Mon > Jul 01 13:53:45 2013 -0700 > @@ -1304,6 +1304,7 @@ > * LocalTime time = parsed.query(LocalTime::from); > * Period extraDays = > parsed.query(DateTimeFormatter.parsedExcessDays()); > * > + * @return a query that provides access to the excess days that > were parsed > */ > public static final TemporalQuery parsedExcessDays() { > return PARSED_EXCESS_DAYS; > @@ -1344,6 +1345,7 @@ > * // validate leap-second is correct and apply correct smoothing > * } > * > + * @return a query that provides access to whether a leap-second > was parsed > */ > public static final TemporalQuery parsedLeapSecond() { > return PARSED_LEAP_SECOND; > From kumar.x.srinivasan at oracle.com Mon Jul 1 21:11:37 2013 From: kumar.x.srinivasan at oracle.com (Kumar Srinivasan) Date: Mon, 01 Jul 2013 14:11:37 -0700 Subject: RFR: 8017463: [TEST_BUG] 2 tests from tools/pack200/ remain about 1 GB of data in work directory after execution In-Reply-To: <51D1C6EC.8040106@oracle.com> References: <51CF91CD.9040901@oracle.com> <51D1C6EC.8040106@oracle.com> Message-ID: <51D1F089.80300@oracle.com> On 7/1/2013 11:14 AM, Mandy Chung wrote: > On 6/29/13 7:02 PM, Kumar Srinivasan wrote: >> Hi, >> >> Please review changes to cleanup the test area after pack200 test >> completion. Some tests generally use large jars and a local copy of >> the JDK to >> test with, created a generic utility to nuke most of the remains. >> >> The webrev: >> http://cr.openjdk.java.net/~ksrini/8017463/webrev.0/ >> > > In Utils.cleanup, it will delete the files with certain extensions in > the current directory. I skimmed on the tests and look to me that > those files can be altered with a different path and not necessary in > the current directory. Just wonder if you want to make cleanup to > take a path parameter instead of hardcoding the cwd. Otherwise, this > change looks fine with me. AFAICT all the test files are in "." which is the scratch directory that jtreg provides, some tests may/could obtain the absolute path to this. Can you please point me to the place where you found the doubt ? Kumar > > Mandy > >> The bug: >> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8017463 >> >> Thanks >> Kumar >> > From Lance.Andersen at oracle.com Mon Jul 1 21:24:14 2013 From: Lance.Andersen at oracle.com (Lance Andersen) Date: Mon, 1 Jul 2013 17:24:14 -0400 Subject: JDK 8 code review request for doclint fixes in java.time.format In-Reply-To: <51D1ECBF.6040603@oracle.com> References: <51D1ECBF.6040603@oracle.com> Message-ID: <28BD87F9-9A16-4579-872C-A9C55BC90B08@oracle.com> +1 joe -- Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 Oracle Java Engineering 1 Network Drive Burlington, MA 01803 Lance.Andersen at oracle.com Sent from my iPhone On Jul 1, 2013, at 4:55 PM, Joe Darcy wrote: > Hello, > > The patch below resolves the two remaining doclint issues in java.time.format. > > Thanks, > > -Joe > > --- a/src/share/classes/java/time/format/DateTimeFormatter.java Mon Jul 01 13:42:03 2013 -0700 > +++ b/src/share/classes/java/time/format/DateTimeFormatter.java Mon Jul 01 13:53:45 2013 -0700 > @@ -1304,6 +1304,7 @@ > * LocalTime time = parsed.query(LocalTime::from); > * Period extraDays = parsed.query(DateTimeFormatter.parsedExcessDays()); > * > + * @return a query that provides access to the excess days that were parsed > */ > public static final TemporalQuery parsedExcessDays() { > return PARSED_EXCESS_DAYS; > @@ -1344,6 +1345,7 @@ > * // validate leap-second is correct and apply correct smoothing > * } > * > + * @return a query that provides access to whether a leap-second was parsed > */ > public static final TemporalQuery parsedLeapSecond() { > return PARSED_LEAP_SECOND; > From mandy.chung at oracle.com Mon Jul 1 21:45:42 2013 From: mandy.chung at oracle.com (Mandy Chung) Date: Mon, 01 Jul 2013 14:45:42 -0700 Subject: RFR: 8017463: [TEST_BUG] 2 tests from tools/pack200/ remain about 1 GB of data in work directory after execution In-Reply-To: <51D1F089.80300@oracle.com> References: <51CF91CD.9040901@oracle.com> <51D1C6EC.8040106@oracle.com> <51D1F089.80300@oracle.com> Message-ID: <51D1F886.2060000@oracle.com> On 7/1/2013 2:11 PM, Kumar Srinivasan wrote: >> In Utils.cleanup, it will delete the files with certain extensions in >> the current directory. I skimmed on the tests and look to me that >> those files can be altered with a different path and not necessary in >> the current directory. Just wonder if you want to make cleanup to >> take a path parameter instead of hardcoding the cwd. Otherwise, this >> change looks fine with me. > > AFAICT all the test files are in "." which is the scratch directory > that jtreg provides, > some tests may/could obtain the absolute path to this. > > Can you please point me to the place where you found the doubt ? Your fix is fine as all the test files follow the convention to put under ".". My question was led by these methods in the Utils class: static void pack(JarFile jarFile, File packFile) static void unpackj(File inFile, JarOutputStream jarStream) For example Pack200Test calls these methods by passing a File object and JarOutputStream and the test itself uses the basename that makes sure that the file is in ".". Is the cleanup() trying to delete the files created during pack and unpack in the test? That's what my comment is about. Mandy From joe.darcy at oracle.com Mon Jul 1 21:34:19 2013 From: joe.darcy at oracle.com (joe.darcy at oracle.com) Date: Mon, 01 Jul 2013 21:34:19 +0000 Subject: hg: jdk8/tl/jdk: 8019535: Fix doclint issues in java.time.format Message-ID: <20130701213430.EA27D486E0@hg.openjdk.java.net> Changeset: 5427f7316633 Author: darcy Date: 2013-07-01 14:33 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/5427f7316633 8019535: Fix doclint issues in java.time.format Reviewed-by: lancea, rriggs ! src/share/classes/java/time/format/DateTimeFormatter.java From kumar.x.srinivasan at oracle.com Mon Jul 1 23:12:10 2013 From: kumar.x.srinivasan at oracle.com (Kumar Srinivasan) Date: Mon, 01 Jul 2013 16:12:10 -0700 Subject: RFR: 8017463: [TEST_BUG] 2 tests from tools/pack200/ remain about 1 GB of data in work directory after execution In-Reply-To: <51D1F886.2060000@oracle.com> References: <51CF91CD.9040901@oracle.com> <51D1C6EC.8040106@oracle.com> <51D1F089.80300@oracle.com> <51D1F886.2060000@oracle.com> Message-ID: <51D20CCA.8070700@oracle.com> On 7/1/2013 2:45 PM, Mandy Chung wrote: > > On 7/1/2013 2:11 PM, Kumar Srinivasan wrote: >>> In Utils.cleanup, it will delete the files with certain extensions >>> in the current directory. I skimmed on the tests and look to me >>> that those files can be altered with a different path and not >>> necessary in the current directory. Just wonder if you want to make >>> cleanup to take a path parameter instead of hardcoding the cwd. >>> Otherwise, this change looks fine with me. >> >> AFAICT all the test files are in "." which is the scratch directory >> that jtreg provides, >> some tests may/could obtain the absolute path to this. >> >> Can you please point me to the place where you found the doubt ? > > Your fix is fine as all the test files follow the convention to > put under ".". > > My question was led by these methods in the Utils class: > > static void pack(JarFile jarFile, File packFile) > static void unpackj(File inFile, JarOutputStream jarStream) > > For example Pack200Test calls these methods by passing a File object > and JarOutputStream and the test itself uses the basename that > makes sure that the file is in ".". Is the cleanup() trying to > delete the files created during pack and unpack in the test? Yes. and other temporary/transient files that might turn up. Thanks for reviewing Mandy. Kumar > That's what my comment is about. > > Mandy > From joe.darcy at oracle.com Tue Jul 2 00:37:45 2013 From: joe.darcy at oracle.com (Joe Darcy) Date: Mon, 01 Jul 2013 17:37:45 -0700 Subject: Java 8 RFR: 6178739 - Formatter - Zero padding flag with zero width In-Reply-To: <227132A3-5CC5-4D8C-A57A-20A3E36A21C4@oracle.com> References: <227132A3-5CC5-4D8C-A57A-20A3E36A21C4@oracle.com> Message-ID: <51D220D9.5080101@oracle.com> On 06/28/2013 12:10 PM, Brian Burkhalter wrote: > Continuing this thread > > http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-June/018326.html > > with respect to this issue > > http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6178739 > > this Request for Review proposes the following change to the Formatter javadoc specification: > > diff -r 8d577b3a6ca4 src/share/classes/java/util/Formatter.java > --- a/src/share/classes/java/util/Formatter.java Fri Jun 28 11:09:10 2013 -0700 > +++ b/src/share/classes/java/util/Formatter.java Fri Jun 28 11:58:45 2013 -0700 > @@ -190,7 +190,7 @@ > *

The optional flags is a set of characters that modify the output > * format. The set of valid flags depends on the conversion. > * > - *

The optional width is a non-negative decimal integer indicating > + *

The optional width is a positive decimal integer indicating > * the minimum number of characters to be written to the output. > * > *

The optional precision is a non-negative decimal integer usually > > The change is to require the field width to be positive rather than non-negative. Allowing a zero minimum field width seems meaningless. This matches the current behavior as defined by the format specifier regular expression: > > private static final String formatSpecifier > = "%(\\d+\\$)?([-#+ 0,(\\<]*)?(\\d+)?(\\.\\d+)?([tT])?([a-zA-Z%])"; > > A CCC request for the above would naturally need to be approved if this is change were deemed acceptable. > > An alternative, as previously stated, would be to handle cases like %0.4f specially but this seems to violate the letter of the specification as currently written. It would however match the behavior of C and not require a CCC request, FWIW. > > Thanks, > > Brian Hello, Our default policy when a case like this is found is to change the specification to match the implementation. While matching the C behavior is generally desirable, if no one has requested that in the many years Formatter has been in the platform, I think it is reasonable to change the specification to require a positive argument in this case. Cheers, -Joe From jason.uh at oracle.com Tue Jul 2 00:46:46 2013 From: jason.uh at oracle.com (jason.uh at oracle.com) Date: Tue, 02 Jul 2013 00:46:46 +0000 Subject: hg: jdk8/tl/jdk: 8019539: Fix doclint errors in java.security and its subpackages Message-ID: <20130702004713.5D7BC486E3@hg.openjdk.java.net> Changeset: 17f44b2dde41 Author: juh Date: 2013-07-01 17:46 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/17f44b2dde41 8019539: Fix doclint errors in java.security and its subpackages Reviewed-by: darcy ! src/share/classes/java/security/KeyStore.java ! src/share/classes/java/security/Provider.java ! src/share/classes/java/security/Security.java ! src/share/classes/java/security/cert/X509CRL.java ! src/share/classes/java/security/cert/X509CRLEntry.java ! src/share/classes/java/security/cert/X509Certificate.java From david.holmes at oracle.com Tue Jul 2 04:38:10 2013 From: david.holmes at oracle.com (David Holmes) Date: Tue, 02 Jul 2013 14:38:10 +1000 Subject: RFR: 8016341 java/lang/ref/OOMEInReferenceHandler.java failing intermittently Message-ID: <51D25932.7040303@oracle.com> This recently added test was found to fail under some conditions - namely client compiler with -Xcomp. It seems that the use of all local variables enabled the compiler to optimize things in a way that stopped the weakref from being enqueued as expected. Simple fix was to make the weakref a field. http://cr.openjdk.java.net/~dholmes/8016341/webrev/ Thanks, David From peter.levart at gmail.com Tue Jul 2 07:19:33 2013 From: peter.levart at gmail.com (Peter Levart) Date: Tue, 02 Jul 2013 09:19:33 +0200 Subject: RFR: 8016341 java/lang/ref/OOMEInReferenceHandler.java failing intermittently In-Reply-To: <51D25932.7040303@oracle.com> References: <51D25932.7040303@oracle.com> Message-ID: <51D27F05.5020201@gmail.com> Hi David, Looking at original code once again, I think this was actually a bug. The WeakReference instance constructed in (old) line 82, can be GCed right away, since nobody is using the local variable after assignment. I f WeakReference is GCed it can not be enqueued. The promotion of local variable into a field is one way to fix this. The other would be to use the local variable somewhere down the code path, like for example in a final throw statement: 110 throw new IllegalStateException("Reference Handler thread stuck. weakRef.get(): " + weakRef.get()); This would also reveal some more info about the WeakReference when there's no sure answer after 10 seconds and could be added to the test anyway. Regards, Peter On 07/02/2013 06:38 AM, David Holmes wrote: > This recently added test was found to fail under some conditions - > namely client compiler with -Xcomp. It seems that the use of all local > variables enabled the compiler to optimize things in a way that > stopped the weakref from being enqueued as expected. Simple fix was to > make the weakref a field. > > http://cr.openjdk.java.net/~dholmes/8016341/webrev/ > > Thanks, > David From Alan.Bateman at oracle.com Tue Jul 2 09:11:30 2013 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Tue, 02 Jul 2013 10:11:30 +0100 Subject: RFR: 8019500: Exclude MemoryTest.java and MemoryTestAllGC.sh to enable integration In-Reply-To: <20130701153202.GE2213@ehelin-thinkpad> References: <20130701153202.GE2213@ehelin-thinkpad> Message-ID: <51D29942.4090802@oracle.com> On 01/07/2013 16:32, Erik Helin wrote: > Hi all, > > this change excludes the following two MemoryMXBean tests: > - java/lang/management/MemoryMXBean/MemoryTestAllGC.sh > - java/lang/management/MemoryMXBean/MemoryTest.java > > This is needed since a change in hotspot added a new memory pool for > metaspace: > >> hg log hotspot-main/hotspot: >> changeset: 4861:71963b3f802a >> user: ehelin >> date: Wed Jun 26 16:58:37 2013 >> summary: 8013590: NPG: Add a memory pool MXBean for Metaspace > These tests need to be excluded for a (very short) time to be able to > integrate hotspot-main into jdk8/jdk8. > > Webrev: http://cr.openjdk.java.net/~ehelin/8019500/webrev.00/ > > Please note that the change is for jdk8/jdk8 (not jdk8/tl) since hotspot > needs to be integrated into jdk8/jdk8. > > I have also sent out a review request for a change that fixes the test > and removes the tests from ProblemList.txt. This change can be applied > to jdk8/tl as soon as hotspot has been integrated and pulled down to jdk8/tl. > > Thanks, > Erik This looks okay to me, although you might want to push-out "generic-all" so that it's consistent with the other lines. -Alan From vicente.romero at oracle.com Tue Jul 2 09:22:30 2013 From: vicente.romero at oracle.com (vicente.romero at oracle.com) Date: Tue, 02 Jul 2013 09:22:30 +0000 Subject: hg: jdk8/tl/langtools: 8019397: javap does not show SourceDebugExtension properly Message-ID: <20130702092238.4CEA6486F9@hg.openjdk.java.net> Changeset: 27a2e8c78bd0 Author: vromero Date: 2013-07-02 10:21 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/27a2e8c78bd0 8019397: javap does not show SourceDebugExtension properly Reviewed-by: jjg Contributed-by: dmytro_sheyko at hotmail.com ! src/share/classes/com/sun/tools/classfile/SourceDebugExtension_attribute.java ! src/share/classes/com/sun/tools/javap/AttributeWriter.java From erik.helin at oracle.com Tue Jul 2 09:27:44 2013 From: erik.helin at oracle.com (Erik Helin) Date: Tue, 2 Jul 2013 11:27:44 +0200 Subject: RFR: 8019500: Exclude MemoryTest.java and MemoryTestAllGC.sh to enable integration In-Reply-To: <51D29942.4090802@oracle.com> References: <20130701153202.GE2213@ehelin-thinkpad> <51D29942.4090802@oracle.com> Message-ID: <20130702092744.GE1976@ehelin-thinkpad> On 2013-07-02, Alan Bateman wrote: > On 01/07/2013 16:32, Erik Helin wrote: > >Hi all, > > > >this change excludes the following two MemoryMXBean tests: > >- java/lang/management/MemoryMXBean/MemoryTestAllGC.sh > >- java/lang/management/MemoryMXBean/MemoryTest.java > > > >This is needed since a change in hotspot added a new memory pool for > >metaspace: > > > >>hg log hotspot-main/hotspot: > >> changeset: 4861:71963b3f802a > >> user: ehelin > >> date: Wed Jun 26 16:58:37 2013 > >> summary: 8013590: NPG: Add a memory pool MXBean for Metaspace > >These tests need to be excluded for a (very short) time to be able to > >integrate hotspot-main into jdk8/jdk8. > > > >Webrev: http://cr.openjdk.java.net/~ehelin/8019500/webrev.00/ > > > >Please note that the change is for jdk8/jdk8 (not jdk8/tl) since hotspot > >needs to be integrated into jdk8/jdk8. > > > >I have also sent out a review request for a change that fixes the test > >and removes the tests from ProblemList.txt. This change can be applied > >to jdk8/tl as soon as hotspot has been integrated and pulled down to jdk8/tl. > > > >Thanks, > >Erik > This looks okay to me, although you might want to push-out > "generic-all" so that it's consistent with the other lines. Thanks! I will make sure to use the correct alignment for "generic-all" before I push. Again, thanks for your quick reply! Erik > -Alan From daniel.fuchs at oracle.com Tue Jul 2 10:07:24 2013 From: daniel.fuchs at oracle.com (daniel.fuchs at oracle.com) Date: Tue, 02 Jul 2013 10:07:24 +0000 Subject: hg: jdk8/tl/jdk: 8017174: NPE when using Logger.getAnonymousLogger or LogManager.getLogManager().getLogger Message-ID: <20130702100749.8AFAA486FB@hg.openjdk.java.net> Changeset: 020f023f87d1 Author: dfuchs Date: 2013-07-02 11:30 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/020f023f87d1 8017174: NPE when using Logger.getAnonymousLogger or LogManager.getLogManager().getLogger Summary: This patch makes sure that LoggerContext instances created for applets have a root and global logger. Reviewed-by: mchung ! src/share/classes/java/util/logging/LogManager.java ! test/java/util/logging/LogManagerInstanceTest.java + test/java/util/logging/TestAppletLoggerContext.java From kumar.x.srinivasan at oracle.com Tue Jul 2 12:30:26 2013 From: kumar.x.srinivasan at oracle.com (kumar.x.srinivasan at oracle.com) Date: Tue, 02 Jul 2013 12:30:26 +0000 Subject: hg: jdk8/tl/jdk: 8017463: [TEST_BUG] 2 tests from tools/pack200/ remain about 1 GB of data in work directory after execution Message-ID: <20130702123051.57A2948703@hg.openjdk.java.net> Changeset: b1fffbbdf58c Author: ksrini Date: 2013-07-02 05:28 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/b1fffbbdf58c 8017463: [TEST_BUG] 2 tests from tools/pack200/ remain about 1 GB of data in work directory after execution Reviewed-by: mchung ! test/tools/pack200/AttributeTests.java ! test/tools/pack200/BandIntegrity.java ! test/tools/pack200/CommandLineTests.java ! test/tools/pack200/InstructionTests.java ! test/tools/pack200/Pack200Props.java ! test/tools/pack200/Pack200Test.java ! test/tools/pack200/PackageVersionTest.java ! test/tools/pack200/RepackTest.java ! test/tools/pack200/T7007157.java ! test/tools/pack200/TestExceptions.java ! test/tools/pack200/TimeStamp.java ! test/tools/pack200/UnpackerMemoryTest.java ! test/tools/pack200/Utils.java ! test/tools/pack200/typeannos/TestTypeAnnotations.java From sundararajan.athijegannathan at oracle.com Tue Jul 2 13:21:03 2013 From: sundararajan.athijegannathan at oracle.com (sundararajan.athijegannathan at oracle.com) Date: Tue, 02 Jul 2013 13:21:03 +0000 Subject: hg: jdk8/tl/nashorn: 12 new changesets Message-ID: <20130702132114.5AF2E48706@hg.openjdk.java.net> Changeset: 218c2833c344 Author: sundar Date: 2013-06-28 19:36 +0530 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/218c2833c344 8019365: Error stack format Reviewed-by: hannesw ! src/jdk/nashorn/api/scripting/NashornException.java ! src/jdk/nashorn/internal/objects/NativeError.java ! test/script/basic/JDK-8014781.js.EXPECTED ! test/script/basic/JDK-8017950.js.EXPECTED ! test/script/basic/JDK-8019226.js ! test/script/basic/JDK-8019226.js.EXPECTED Changeset: 02588d68399d Author: sundar Date: 2013-07-01 12:38 +0530 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/02588d68399d 8019473: Parser issues related to functions and blocks Reviewed-by: lagergren ! src/jdk/nashorn/internal/parser/Parser.java + test/script/basic/JDK-8019473.js Changeset: 10c7a1e9e24f Author: sundar Date: 2013-07-01 14:15 +0530 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/10c7a1e9e24f 8019478: Object.prototype.toString.call(/a/.exec("a")) === "[object Array]" should be true Reviewed-by: hannesw ! src/jdk/nashorn/internal/objects/NativeRegExpExecResult.java + test/script/basic/JDK-8019478.js Changeset: 47099609a48b Author: sundar Date: 2013-07-01 17:21 +0530 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/47099609a48b 8019482: Number("0x0.0p0") should evaluate to NaN Reviewed-by: lagergren ! src/jdk/nashorn/internal/objects/NativeError.java ! src/jdk/nashorn/internal/runtime/ECMAException.java ! src/jdk/nashorn/internal/runtime/JSType.java + test/script/basic/JDK-8019482.js Changeset: ab3ea5b3e507 Author: sundar Date: 2013-07-01 19:52 +0530 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/ab3ea5b3e507 8019488: switch on literals result in NoSuchMethodError or VerifyError Reviewed-by: hannesw ! src/jdk/nashorn/internal/codegen/CodeGenerator.java ! src/jdk/nashorn/internal/runtime/ScriptRuntime.java + test/script/basic/JDK-8019488.js Changeset: 9165138b427c Author: sundar Date: 2013-07-01 23:36 +0530 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/9165138b427c 8019508: Comma handling in object literal parsing is wrong Reviewed-by: hannesw ! src/jdk/nashorn/internal/parser/Parser.java ! src/jdk/nashorn/internal/runtime/resources/Messages.properties + test/script/basic/JDK-8019508.js + test/script/basic/JDK-8019508.js.EXPECTED Changeset: 5f9abeb0bb50 Author: jlaskey Date: 2013-07-02 07:45 -0300 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/5f9abeb0bb50 8019580: Build Script Change for Nashorn promotion testing Reviewed-by: jlaskey Contributed-by: eugene.drobitko at oracle.com ! make/build.xml Changeset: a7b82e333c31 Author: lagergren Date: 2013-07-02 13:50 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/a7b82e333c31 8016667: Wrong bytecode when testing/setting due to null check shortcut checking against primitive too Reviewed-by: jlaskey, sundar ! src/jdk/nashorn/internal/codegen/CodeGenerator.java + test/script/basic/JDK-8016667.js Changeset: 74049fe3ba46 Author: sundar Date: 2013-07-02 18:00 +0530 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/74049fe3ba46 8019553: NPE on illegal l-value for increment and decrement Reviewed-by: jlaskey, attila, lagergren ! src/jdk/nashorn/internal/parser/Parser.java ! src/jdk/nashorn/internal/runtime/resources/Messages.properties + test/script/basic/JDK-8019553.js + test/script/basic/JDK-8019553.js.EXPECTED ! test/script/basic/NASHORN-51.js ! test/script/basic/NASHORN-51.js.EXPECTED ! test/script/error/NASHORN-57.js.EXPECTED Changeset: 9396e42bae4f Author: lagergren Date: 2013-07-02 14:50 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/9396e42bae4f 8017082: Long array literals were slightly broken Reviewed-by: sundar, attila ! src/jdk/nashorn/internal/codegen/CodeGenerator.java ! src/jdk/nashorn/internal/codegen/types/Type.java ! src/jdk/nashorn/internal/ir/LiteralNode.java + test/script/basic/JDK-8017082.js Changeset: 69ec02d12a31 Author: lagergren Date: 2013-07-02 15:01 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/69ec02d12a31 Merge Changeset: 16c4535abcf8 Author: sundar Date: 2013-07-02 18:39 +0530 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/16c4535abcf8 Merge From Alan.Bateman at oracle.com Tue Jul 2 15:41:10 2013 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Tue, 02 Jul 2013 16:41:10 +0100 Subject: Request for Review: 5049299: (process) Use posix_spawn, not fork, on S10 to avoid swap exhaustion In-Reply-To: <50D65C3F.2040004@oracle.com> References: <50AE98B1.2040200@oracle.com> <50B81A8D.2040403@oracle.com> <50B82C94.90109@oracle.com> <50D277BE.8060705@oracle.com> <50D65C3F.2040004@oracle.com> Message-ID: <51D2F496.6050400@oracle.com> On 23/12/2012 01:19, Rob McKenna wrote: > Hi Martin, thanks a lot for this. > > I've renamed LINKFLAG to the more appropriate (and common) ARCHFLAG. > It seems to pop up all around our source but if build-dev know of a > better (or canonical) way of doing it I'll take it! > > The BUILD_JEXEC differences don't show up in my webrev or hg diff, but > I see them in the jdk.patch generated by webrev. I have no idea why > this is. (I did use the JEXEC stuff as a template for the JSPAWNHELPER > code, but I don't recall altering the JEXEC stuff in any way. It looks > like its limited to indentation. Strange.) > > W.r.t. useFork, I'll discuss this with Alan once he has a spare > minute. I believe he may have had some concerns, but I'll let you know > how that goes either way. > > The only __APPLE__ should be to get the call to _NSGetEnviron(). > Everything else should be bsd. > > I've put a webrev at: > > http://cr.openjdk.java.net/~robm/5049299/webrev.03/ > > > I hope this addresses the rest of your comments. > > -Rob Rob - this was great work but I don't think we brought it to a conclusion. Are you planning to re-base the patch and send out a new webrev? -Alan From brian.burkhalter at oracle.com Tue Jul 2 18:01:39 2013 From: brian.burkhalter at oracle.com (Brian Burkhalter) Date: Tue, 2 Jul 2013 11:01:39 -0700 Subject: Java 8 RFR: 6178739 - Formatter - Zero padding flag with zero width In-Reply-To: <51D220D9.5080101@oracle.com> References: <227132A3-5CC5-4D8C-A57A-20A3E36A21C4@oracle.com> <51D220D9.5080101@oracle.com> Message-ID: <29900BE1-FDF4-4172-831F-9A840EA1FD84@oracle.com> On Jul 1, 2013, at 5:37 PM, Joe Darcy wrote: > While matching the C behavior is generally desirable, if no one has requested that in the many years Formatter has been in the platform, I think it is reasonable to change the specification to require a positive argument in this case. All right, I will pursue this CCC. Thanks, Brian From kumar.x.srinivasan at oracle.com Tue Jul 2 18:02:51 2013 From: kumar.x.srinivasan at oracle.com (kumar.x.srinivasan at oracle.com) Date: Tue, 02 Jul 2013 18:02:51 +0000 Subject: hg: jdk8/tl/langtools: 8019460: tests in changeset do not have @bug tag Message-ID: <20130702180256.6783C48710@hg.openjdk.java.net> Changeset: 565341d436e2 Author: ksrini Date: 2013-07-01 16:36 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/565341d436e2 8019460: tests in changeset do not have @bug tag Reviewed-by: darcy ! test/tools/javac/warnings/AuxiliaryClass/ClassUsingAnotherAuxiliary.java ! test/tools/javac/warnings/AuxiliaryClass/ClassUsingAnotherAuxiliary.out ! test/tools/javac/warnings/AuxiliaryClass/ClassUsingAuxiliary.java ! test/tools/javac/warnings/AuxiliaryClass/ClassUsingAuxiliary1.out ! test/tools/javac/warnings/AuxiliaryClass/ClassUsingAuxiliary2.out ! test/tools/javac/warnings/AuxiliaryClass/SelfClassWithAux.java From daniel.fuchs at oracle.com Tue Jul 2 18:26:15 2013 From: daniel.fuchs at oracle.com (daniel.fuchs at oracle.com) Date: Tue, 02 Jul 2013 18:26:15 +0000 Subject: hg: jdk8/tl/jdk: 7184195: java.util.logging.Logger.getGlobal().info() doesn't log without configuration Message-ID: <20130702182637.740EA48712@hg.openjdk.java.net> Changeset: 70bff2d12af0 Author: dfuchs Date: 2013-07-02 19:47 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/70bff2d12af0 7184195: java.util.logging.Logger.getGlobal().info() doesn't log without configuration Summary: Due to subtle synchronization issues between LogManager & Logger class initialization the global logger doesn't have its 'manager' field initialized until the LogManager is initialized. This fix will ensure that the global logger has its 'manager' field set when getGlobal() is called. Reviewed-by: mchung, plevart ! src/share/classes/java/util/logging/LogManager.java ! src/share/classes/java/util/logging/Logger.java + test/java/util/logging/Logger/getGlobal/TestGetGlobal.java + test/java/util/logging/Logger/getGlobal/TestGetGlobalByName.java + test/java/util/logging/Logger/getGlobal/TestGetGlobalConcurrent.java + test/java/util/logging/Logger/getGlobal/logging.properties + test/java/util/logging/Logger/getGlobal/policy + test/java/util/logging/Logger/getGlobal/testgetglobal/BadLogManagerImpl.java + test/java/util/logging/Logger/getGlobal/testgetglobal/DummyLogManagerImpl.java + test/java/util/logging/Logger/getGlobal/testgetglobal/HandlerImpl.java + test/java/util/logging/Logger/getGlobal/testgetglobal/LogManagerImpl1.java + test/java/util/logging/Logger/getGlobal/testgetglobal/LogManagerImpl2.java + test/java/util/logging/Logger/getGlobal/testgetglobal/LogManagerImpl3.java From xueming.shen at oracle.com Tue Jul 2 18:29:08 2013 From: xueming.shen at oracle.com (Xueming Shen) Date: Tue, 02 Jul 2013 11:29:08 -0700 Subject: RFR: 8015666: test/tools/pack200/TimeStamp.java failing In-Reply-To: <51CDA1ED.9040302@oracle.com> References: <51C34E6D.4000502@oracle.com> <51CC7099.2050007@oracle.com> <51CC7291.1080602@oracle.com> <51CDA1ED.9040302@oracle.com> Message-ID: <51D31BF4.3000900@oracle.com> On 06/28/2013 07:47 AM, Kumar Srinivasan wrote: > Some nits while reading the changes: > 1. ZipEntry.java > a. typo: > > + * Sets the laste access time of the entry. > > > b. extra space > > + case EXTID_ZIP64 : > > 2. ZipOutputStream.java > I think it would be nice to have the flags 0x1, 0x2 and 0x4 defined > as constants, this will also help a casual reader as to what this means. > > > Besides my previous concern with finish(), everything else appears to be ok. Kumar, I have the dostime "cached" in XEntry, so the writeCEN() and writeLOC() will always write out the same local msdos time. The cache should help the perf a little, as the javaToDosTime() now only invoked once for the same entry. Nothing needs to be updated in unpack side now. (I took a look at the API, it appears there is no way to do anything on unpack side to workaround this issue, without the possibility of breaking someone's code) http://cr.openjdk.java.net/~sherman/8015666/webrev/ -Sherman > > Kumar > > >> On 06/27/2013 10:04 AM, Kumar Srinivasan wrote: >>> Hi Sherman, >>> >>> I started looking at this, my initial comment, the Unpacker.unpack >>> does not close its output and we allow multiple pack files to be concatenated, >>> I am assuming out.finish() will allow further jar files to be appended ? >>> or would this cause a problem ? >> >> No, out.finish() will not allow further entry appending. Then, it appears >> we need to have a different approach to "finish" the Jar/ZipOutputStream. >> What need to be done here is that either out.close/finish() need to be >> invoked under the UTC locale as well (to output the time stamps in cen >> table correctly). This is another "incompatible" change of the previous >> change, in which the msdosTime<->javaTime conversion no longer >> occurs during the ZipEntry.set/getTime(), but during the read and write >> the ZipEntry from/to the zip file. >> >> -Sherman >> >> >>> >>> Kumar >>> >>>> Hi, >>>> >>>> The zip time related changes[1] I pushed back last month appears >>>> to have the compatibility risk of breaking existing code. The main >>>> idea in that changeset is to use the more accurate and timezone >>>> insensitive utc time stored in the extra field for the ZipEntry.set/getTime() >>>> if possible. However it turns out the reality is that the code out there >>>> might have already had some interesting workaround/hack solution >>>> to workaround the problem that the time stamp stored in the "standard' >>>> zip entry header is a MS-DOS standard date/time, which is a "local >>>> date/time" and sensitive to timezone, in which, if the zip is archived >>>> in time zone A (our implementation converts the "java" time to dos >>>> time by using the default tz A) and then transferred/un-archived in >>>> a different zone B (use default tz B to convert back to java time), we >>>> have a time stamp mess up. The "workaround" from pack200 for this >>>> issue when pack/unpacking a jar file is to "specify/recommend/suggest" >>>> in its spec that the "time zone" in a jar file entry is assumed to be "UTC", >>>> so the pack/unpack200 implementation set the "default time" to utc >>>> before the pack/unpack and set it back to the original after that. It worked >>>> "perfectly" for a roundtrip pack/unpacking, until the changeset [2], in >>>> which ZipEntry.getTime() (packing) returns a real utc time and the following >>>> ZipEntry.setTime() (unpacking), then mess up the MS-DOS date/time >>>> entry, this is the root cause of this regression. >>>> >>>> Given the facts that >>>> (1) there are actually two real physical time stamps in a zip file header, >>>> one is in the date/time fields, which is MS-DOS-local-date/time-with-2- >>>> seconds-granularity , one is in the extra data field, which is UTC-1-second >>>> -granularity >>>> (2) and there are applications over there that have dependency on the >>>> MS-DOS date/time stamp. >>>> >>>> I'm proposing the following approach to add the functionality of supporting >>>> the "utc-date/time-with-1-second granularity" and keep the old behavior >>>> of the get/setTime() of the ZipEntry. >>>> >>>> (1) keep the time/setTime()/getTime() for the MS-DOS standard date/time. >>>> To set via the old setTime() will only store the time into zip's standard >>>> date/time field, which is in MS-DOS date/time. And getTime() only returns >>>> the date/time from that field, when read from the zip file/stream. >>>> (2) add mtime/set/getLastModifiedTime() to work on the UTC time fields, >>>> and the last modified time set via the new method will also set the "time", >>>> and the getLastModifiedTime() also returns the "time", if the UTC time >>>> stamp fields are not set in the zip file header. The idea is that for the new >>>> application, the recommendation is to use ZipEntry.set/getLastModifiedTime() >>>> for better/correct time stamp, but the existing apps keep the same behavior. >>>> (3) jar and ZipOutputStream are updated to use the set/getLastModifiedTime(). >>>> (4) Pack/unpack continues to use the set/getTime(), so the current workaround >>>> continues work. I will leave this to Kuma to decide how it should be handled >>>> going forward. (there are two facts need to be considered here, a) the >>>> existing jar file might not have the utc time instored, and b) all "extra" data >>>> are wiped out during the pack/unpacking process) >>>> (5) additionally add another pair of atime/get/setLastAccessTime and >>>> ctime/get/setCreationTime(). >>>> (6) The newly added 3 pairs of the m/a/ctime get/set methods use the "new" >>>> nio FileTime, instead of the "long". This may add some additional cost of >>>> conversion when working with them, but may also help improve the >>>> performance if the time stamps are directly from nio file system when >>>> get/set XYZTime. Good/bad? >>>> >>>> http://cr.openjdk.java.net/~sherman/8015666/webrev/ >>>> >>>> Comment, option and suggestion are appreciated. >>>> >>>> -Sherman >>>> >>>> [1] http://hg.openjdk.java.net/jdk8/tl/jdk/rev/90df6756406f >>> >> > From vicente.romero at oracle.com Tue Jul 2 21:50:44 2013 From: vicente.romero at oracle.com (vicente.romero at oracle.com) Date: Tue, 02 Jul 2013 21:50:44 +0000 Subject: hg: jdk8/tl/langtools: 6326693: variable x might already have been assigned, when assignment is in catch block Message-ID: <20130702215049.B6D8C48724@hg.openjdk.java.net> Changeset: 3b4f92a3797f Author: vromero Date: 2013-07-02 22:49 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/3b4f92a3797f 6326693: variable x might already have been assigned, when assignment is in catch block Reviewed-by: mcimadamore ! src/share/classes/com/sun/tools/javac/comp/Flow.java + test/tools/javac/T6326693/FinalVariableAssignedToInCatchBlockTest.java + test/tools/javac/T6326693/FinalVariableAssignedToInCatchBlockTest.out From tbuktu at hotmail.com Tue Jul 2 22:31:36 2013 From: tbuktu at hotmail.com (Tim Buktu) Date: Wed, 3 Jul 2013 00:31:36 +0200 Subject: Code update for 8014319: Faster division of large integers In-Reply-To: <5D364847-297D-4317-AA31-8B6A0ACD90BC@oracle.com> References: <5D364847-297D-4317-AA31-8B6A0ACD90BC@oracle.com> Message-ID: Hi Brian, > > That would be helpful if you don't mind. Note that this changeset > modifying BigInteger > > http://hg.openjdk.java.net/jdk8/tl/jdk/rev/c8cf01de8fa8 > > was just applied today. The latest files for phase 3 are up at https://gist.github.com/tbuktu/1576025/raw/f93093a412eac86d8d81e03b8b9135eb827f2a84/BigInteger.java.phase3 https://gist.github.com/tbuktu/1576025/raw/237f2687b9a6cb49ab17ddffd77412b2e8bbc518/MutableBigInteger.java.phase3 https://gist.github.com/tbuktu/1576025/raw/4c3faad4cdebffbd77485482a1e61c9a7a475060/BigIntegerTest.java.phase3 >> Also, would it be okay to do a s/Reminder/Remainder/g on >> MutableBigInteger.java and include it in 8014319? > > That's already been done in the phase{3,4} patched provided by Alan: > > http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-May/016783.html > The MutableBigInteger.java.* files I extracted from BigIntegerPatch.zip still say "reminder". Maybe I have an older version of the .zip file. Anyway, I fixed it in the files linked above. Tim From mandy.chung at oracle.com Tue Jul 2 23:01:31 2013 From: mandy.chung at oracle.com (mandy.chung at oracle.com) Date: Tue, 02 Jul 2013 23:01:31 +0000 Subject: hg: jdk8/tl/jdk: 8007035: deprecate public void SecurityManager.checkMemberAccess(Class clazz, int which) Message-ID: <20130702230213.79CF848732@hg.openjdk.java.net> Changeset: cf7202b32a34 Author: mchung Date: 2013-07-02 15:58 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/cf7202b32a34 8007035: deprecate public void SecurityManager.checkMemberAccess(Class clazz, int which) Reviewed-by: jrose, alanb, dfuchs ! src/share/classes/java/lang/Class.java ! src/share/classes/java/lang/SecurityManager.java ! src/share/classes/java/lang/invoke/MethodHandles.java ! src/share/classes/java/lang/reflect/Member.java ! test/java/lang/invoke/InvokeDynamicPrintArgs.java + test/java/lang/invoke/TestPrivateMember.java From brian.burkhalter at oracle.com Wed Jul 3 00:21:06 2013 From: brian.burkhalter at oracle.com (Brian Burkhalter) Date: Tue, 2 Jul 2013 17:21:06 -0700 Subject: Code update for 8014319: Faster division of large integers In-Reply-To: References: <5D364847-297D-4317-AA31-8B6A0ACD90BC@oracle.com> Message-ID: <93545924-32EE-44EF-9CC3-8F88174DAA8D@oracle.com> Hi Tim, On Jul 2, 2013, at 3:31 PM, Tim Buktu wrote: >> That would be helpful if you don't mind. Note that this changeset >> modifying BigInteger >> >> http://hg.openjdk.java.net/jdk8/tl/jdk/rev/c8cf01de8fa8 >> >> was just applied today. > The latest files for phase 3 are up at > > https://gist.github.com/tbuktu/1576025/raw/f93093a412eac86d8d81e03b8b9135eb827f2a84/BigInteger.java.phase3 > > https://gist.github.com/tbuktu/1576025/raw/237f2687b9a6cb49ab17ddffd77412b2e8bbc518/MutableBigInteger.java.phase3 > > https://gist.github.com/tbuktu/1576025/raw/4c3faad4cdebffbd77485482a1e61c9a7a475060/BigIntegerTest.java.phase3 Great! >>> Also, would it be okay to do a s/Reminder/Remainder/g on >>> MutableBigInteger.java and include it in 8014319? >> >> That's already been done in the phase{3,4} patched provided by Alan: >> >> http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-May/016783.html >> > The MutableBigInteger.java.* files I extracted from BigIntegerPatch.zip > still say "reminder". Maybe I have an older version of the .zip file. > Anyway, I fixed it in the files linked above. Now I recall that I changed that myself after Alan pointed it out. Thanks, Brian From joe.darcy at oracle.com Wed Jul 3 02:06:08 2013 From: joe.darcy at oracle.com (Joseph Darcy) Date: Tue, 02 Jul 2013 19:06:08 -0700 Subject: RFC 6910473: BigInteger negative bit length, value range, and future prospects In-Reply-To: <3C28D178-09DF-4CBC-93B2-272C0407D27C@oracle.com> References: <3C28D178-09DF-4CBC-93B2-272C0407D27C@oracle.com> Message-ID: <51D38710.30804@oracle.com> Hello, A quick note on this issue, before the recent work to use better algorithms for BigInteger arithmetic operation, working with huge numbers was impractical and thus BigInteger.bitLength misbehavior was mostly an academic concern. With the better algorithms, exposure to these large values is likely to increase so BigInteger.bitLength should do something reasonable. There are at least two implementation limits of note in the current code: * Total bit length given a single backing array * Max size of serializable BigInteger given old byte-array based format. My preference for addressing this issue includes adding an implementation note along the lines of "in JDK 8, BigInteger operates on values in the range ...." without requiring that range to be part of the specification. Cheers, -Joe On 6/25/2013 6:18 PM, Brian Burkhalter wrote: > This request for comment regards this issue > > http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6910473 > BigInteger.bigLength() may return negative value for large numbers > > but more importantly Dmitry's thread > > http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-June/018345.html > What is the range of BigInteger values? > > The issue may be fixed superficially simply by throwing an ArithmeticException if the bit length as an int would be negative. A better fix suggested both in the issue description and in the aforementioned thread (option 1 of 3), is to define BigInteger to support a limited range and to clamp to that range in the constructor, throwing an ArithmeticException if the supplied parameter(s) would cause the BigInteger to overflow. This check would be relatively inexpensive. The suggested constraint range is > [ -pow(2, pow(2,31) - 1), pow(2, pow(2,31) - 1) ) > This constraint would guarantee that all BigInteger instances are capable of accurately returning their properties such as bit length, bit count, etc. > > This naturally would require a minor specification change to BigInteger. The question is whether this change would limit any future developments of this and related classes. For example, one could envision BigInteger supporting bit lengths representable by a long instead of an int. In this case the second option would be preferable. > > It has been suggested that an alternative to extending the ranges supported by BigInteger would be to define a different class altogether to handle the larger ranges, keeping BigInteger as a well-specified API for the ranges it supports. Other related classes for arbitrary precision binary floating point and rational numbers might also be considered. > > In summary the specific questions being posed here are: > > 1) what is the general opinion on clamping the range of BigInteger and the various options suggested at the end of > > http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-June/018345.html ? > > 2) what are the forward looking thoughts on handling integers outside the current BigInteger range? > > From a practical point of view, any changes need to be considered with respect to what may be done in the short term (JDK 8) versus the long (JDK 9), so to speak. > > Thanks, > > Brian From zhangshj at linux.vnet.ibm.com Wed Jul 3 03:04:52 2013 From: zhangshj at linux.vnet.ibm.com (Shi Jun Zhang) Date: Wed, 03 Jul 2013 11:04:52 +0800 Subject: RFR: 8019381: HashMap.isEmpty is non-final, potential issues for get/remove In-Reply-To: <450D0C6E-3BA7-40AD-B415-6659A6FDDA91@oracle.com> References: <51CBF181.1020301@linux.vnet.ibm.com> <51CCAAE5.4010707@univ-mlv.fr> <51CD896D.9030807@oracle.com> <51CDB453.5010003@linux.vnet.ibm.com> <51D13323.9030601@linux.vnet.ibm.com> <51D19EAE.2010201@univ-mlv.fr> <450D0C6E-3BA7-40AD-B415-6659A6FDDA91@oracle.com> Message-ID: <51D394D4.7090706@linux.vnet.ibm.com> On 7/1/2013 11:49 PM, Chris Hegarty wrote: > On 1 Jul 2013, at 17:22, Remi Forax wrote: > >> On 07/01/2013 09:43 AM, Shi Jun Zhang wrote: >>> On 6/29/2013 12:05 AM, Shi Jun Zhang wrote: >>>> On 6/28/2013 9:02 PM, Alan Bateman wrote: >>>>> On 27/06/2013 22:13, Remi Forax wrote: >>>>>> On 06/27/2013 10:02 AM, Shi Jun Zhang wrote: >>>>>>> Hi, >>>>>>> >>>>>>> There are some isEmpty() check added into get/remove methods since 8011200 to return directly if HashMap is empty. However isEmpty is a non-final public method which can be overridden by subclass. If the subclass defines isEmpty differently from HashMap, it would cause problem while getting or removing elements. >>>>>> yes, it's a bug. >>>>>> Could you report it ? >>>>>> >>>>>> R?mi >>>>> I've created a bug to track this: >>>>> >>>>> 8019381: HashMap.isEmpty is non-final, potential issues for get/remove >>>>> >>>>> -Alan >>>> Thanks, Alan. >>>> >>>> I'm quite busy today and do not have time to report it until now. Thanks for your help. >>>> >>>> I will provide a webrev next Monday for review. >>> Hi, >>> >>> Here is the webrev >>> >>> http://cr.openjdk.java.net/~zhangshj/8019381/webrev.00/ >> This looks Ok for me. > +1 > > -Chris > >> R?mi >> Thanks all for the review. Jonathan, Could you help to push the changeset? -- Regards, Shi Jun Zhang From henry.jen at oracle.com Wed Jul 3 08:03:03 2013 From: henry.jen at oracle.com (Henry Jen) Date: Wed, 03 Jul 2013 01:03:03 -0700 Subject: RFR: 8017231: Add StringJoiner.merge Message-ID: <51D3DAB7.9050109@oracle.com> Hi, Please review a simple addition of StringJoiner.merge method. This is useful to combine StringJoiners used in parallel doing joining works. The webrev can be found at http://cr.openjdk.java.net/~henryjen/ccc/8017231.0/webrev/ Also included is a little clean up for StringJoinerTest. Cheers, Henry From peter.levart at gmail.com Wed Jul 3 09:18:01 2013 From: peter.levart at gmail.com (Peter Levart) Date: Wed, 03 Jul 2013 11:18:01 +0200 Subject: RFR: 8015315: Stream.concat methods In-Reply-To: <51CE3142.60800@oracle.com> References: <51CE3142.60800@oracle.com> Message-ID: <51D3EC49.2020003@gmail.com> Hi Henry, I think that ConcatSpliterator.characteristics() method is not honoring the spec which says: * Returns a set of characteristics of this Spliterator and its * elements. The result is represented as ORed values from {@link * #ORDERED}, {@link #DISTINCT}, {@link #SORTED}, {@link #SIZED}, * {@link #NONNULL}, {@link #IMMUTABLE}, {@link #CONCURRENT}, * {@link #SUBSIZED}. *Repeated calls to {@code characteristics()} on** ** * a given spliterator should always return the same result.* * *

If a Spliterator reports an inconsistent set of * characteristics (either those returned from a single invocation * or across multiple invocations), no guarantees can be made * about any computation using this Spliterator. * * @return a representation of characteristics */ int characteristics(); The implementation: 736 @Override 737 public int characteristics() { 738 if (beforeSplit) { 739 // Concatenation loses DISTINCT and SORTED characteristics 740 return aSpliterator.characteristics() & bSpliterator.characteristics() 741 & ~(Spliterator.DISTINCT | Spliterator.SORTED 742 | (unsized ? Spliterator.SIZED | Spliterator.SUBSIZED : 0)); 743 } 744 else { 745 return bSpliterator.characteristics(); 746 } 747 } ...is such that repeated calls to the method can return different results over time. The question is whether the spec. is OK as it is. No constraints are put on the characteristics of the Spliterator returned from the trySplit() method, so why should "this" Spliterator have constant characteristics for the entire lifetime? That is not symmetric. Perhaps the spec. should only constrain characteristics to be constant between two consecutive calls to trySplit() and only allow characteristics to change as a result of trySplit() returning non-null... Regards, Peter On 06/29/2013 02:58 AM, Henry Jen wrote: > Hi, > > Please review the webrev that add concat static method to Stream and > primitive Streams. > > http://cr.openjdk.java.net/~henryjen/ccc/8015315.0/webrev/ > > Cheers, > Henry From paul.sandoz at oracle.com Wed Jul 3 09:31:59 2013 From: paul.sandoz at oracle.com (Paul Sandoz) Date: Wed, 3 Jul 2013 11:31:59 +0200 Subject: RFR: 8017231: Add StringJoiner.merge In-Reply-To: <51D3DAB7.9050109@oracle.com> References: <51D3DAB7.9050109@oracle.com> Message-ID: <57C58D2D-54F2-4F5B-A2A9-DA02C4F85DF6@oracle.com> On Jul 3, 2013, at 10:03 AM, Henry Jen wrote: > Hi, > > Please review a simple addition of StringJoiner.merge method. This is > useful to combine StringJoiners used in parallel doing joining works. > > The webrev can be found at > http://cr.openjdk.java.net/~henryjen/ccc/8017231.0/webrev/ > In StringJoiner: For: + *

A {@code StringJoiner} is empty if {@link add(CharSequence) add()} + * has never been called, and if {@code merge()} has never been called + * with a non- empty {@code StringJoiner} argument. Suggest: *

A {@code StringJoiner} is empty if neither {@link add(CharSequence) add()} * or {@code merge()} have been called with a non-empty {@code StringJoiner} * argument. Missing a "then" after the ",": + *

If the other {@code StringJoiner} is using a different delimiter, + * elements from the other {@code StringJoiner} are concatenated with that Otherwise looks good. Paul. From paul.sandoz at oracle.com Wed Jul 3 09:44:29 2013 From: paul.sandoz at oracle.com (Paul Sandoz) Date: Wed, 3 Jul 2013 11:44:29 +0200 Subject: RFR: 8015315: Stream.concat methods In-Reply-To: <51D3EC49.2020003@gmail.com> References: <51CE3142.60800@oracle.com> <51D3EC49.2020003@gmail.com> Message-ID: <3A169692-CD56-4093-8AFA-27E2603131C3@oracle.com> On Jul 3, 2013, at 11:18 AM, Peter Levart wrote: > Hi Henry, > > I think that ConcatSpliterator.characteristics() method is not honoring > the spec which says: > > * Returns a set of characteristics of this Spliterator and its > * elements. The result is represented as ORed values from {@link > * #ORDERED}, {@link #DISTINCT}, {@link #SORTED}, {@link #SIZED}, > * {@link #NONNULL}, {@link #IMMUTABLE}, {@link #CONCURRENT}, > * {@link #SUBSIZED}. *Repeated calls to {@code characteristics()} on** > ** * a given spliterator should always return the same result.* > * > *

If a Spliterator reports an inconsistent set of > * characteristics (either those returned from a single invocation > * or across multiple invocations), no guarantees can be made > * about any computation using this Spliterator. > * > * @return a representation of characteristics > */ > int characteristics(); > > > The implementation: > > 736 @Override > 737 public int characteristics() { > 738 if (beforeSplit) { > 739 // Concatenation loses DISTINCT and SORTED characteristics > 740 return aSpliterator.characteristics() & bSpliterator.characteristics() > 741 & ~(Spliterator.DISTINCT | Spliterator.SORTED > 742 | (unsized ? Spliterator.SIZED | Spliterator.SUBSIZED : 0)); > 743 } > 744 else { > 745 return bSpliterator.characteristics(); > 746 } > 747 } > > > ...is such that repeated calls to the method can return different > results over time. > > > The question is whether the spec. is OK as it is. No constraints are put > on the characteristics of the Spliterator returned from the trySplit() > method, so why should "this" Spliterator have constant characteristics > for the entire lifetime? That is not symmetric. Perhaps the spec. should > only constrain characteristics to be constant between two consecutive > calls to trySplit() and only allow characteristics to change as a result > of trySplit() returning non-null... > Yes, I think that was the general intention. A given spliterator "morphs" into another when it is split. Many spliterators will change characteristics when split e.g. for maps the top level spliterator will report SIZED, but when split it will not. I think we can say: * {@link #SUBSIZED}. Repeated calls to {@code characteristics()} on * a given spliterator, prior to splitting, should always return the same result. Paul. From paul.sandoz at oracle.com Wed Jul 3 12:54:18 2013 From: paul.sandoz at oracle.com (paul.sandoz at oracle.com) Date: Wed, 03 Jul 2013 12:54:18 +0000 Subject: hg: jdk8/tl/jdk: 2 new changesets Message-ID: <20130703125507.2369B4875F@hg.openjdk.java.net> Changeset: dfd7fb0ce54b Author: psandoz Date: 2013-07-03 11:58 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/dfd7fb0ce54b 8011427: java.util.concurrent collection Spliterator implementations Reviewed-by: martin Contributed-by: Doug Lea

! src/share/classes/java/util/concurrent/ArrayBlockingQueue.java ! src/share/classes/java/util/concurrent/BlockingDeque.java ! src/share/classes/java/util/concurrent/BlockingQueue.java ! src/share/classes/java/util/concurrent/ConcurrentLinkedDeque.java ! src/share/classes/java/util/concurrent/ConcurrentLinkedQueue.java ! src/share/classes/java/util/concurrent/ConcurrentSkipListMap.java ! src/share/classes/java/util/concurrent/ConcurrentSkipListSet.java ! src/share/classes/java/util/concurrent/CopyOnWriteArrayList.java ! src/share/classes/java/util/concurrent/CopyOnWriteArraySet.java ! src/share/classes/java/util/concurrent/DelayQueue.java ! src/share/classes/java/util/concurrent/Delayed.java ! src/share/classes/java/util/concurrent/LinkedBlockingDeque.java ! src/share/classes/java/util/concurrent/LinkedBlockingQueue.java ! src/share/classes/java/util/concurrent/LinkedTransferQueue.java ! src/share/classes/java/util/concurrent/PriorityBlockingQueue.java ! src/share/classes/java/util/concurrent/SynchronousQueue.java Changeset: bb4ae17c98cf Author: psandoz Date: 2013-07-03 11:58 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/bb4ae17c98cf 8019481: Sync misc j.u.c classes from 166 to tl Reviewed-by: martin Contributed-by: Doug Lea
! src/share/classes/java/util/concurrent/BrokenBarrierException.java ! src/share/classes/java/util/concurrent/CountDownLatch.java ! src/share/classes/java/util/concurrent/CyclicBarrier.java ! src/share/classes/java/util/concurrent/Exchanger.java ! src/share/classes/java/util/concurrent/Phaser.java ! src/share/classes/java/util/concurrent/TimeUnit.java ! src/share/classes/java/util/concurrent/TimeoutException.java ! src/share/classes/java/util/concurrent/package-info.java From Alan.Bateman at oracle.com Wed Jul 3 14:51:30 2013 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Wed, 03 Jul 2013 15:51:30 +0100 Subject: 7122142 : (ann) Race condition between isAnnotationPresent and getAnnotations In-Reply-To: <51C88EBF.9020704@gmail.com> References: <51C1BEC6.1080308@gmail.com> <51C1FE64.3020000@oracle.com> <51C88EBF.9020704@gmail.com> Message-ID: <51D43A72.8090508@oracle.com> On 24/06/2013 19:23, Peter Levart wrote: > > Hi Alan, > > I have prepared the 2nd revision of the patch: > > http://cr.openjdk.java.net/~plevart/jdk8-tl/AnnotationType/webrev.02/ > > There is a little change in AnnotationParser's alternative parsing > method. This time the parser does not assume anything about > annotations being parsed (previously it assumed that they had RUNTIME > retention). The only difference from standard parsing is that only the > select annotation types are parsed and the rest are quickly skipped. > Infinite recursion is broken by the special cased evaluation in > AnnotationType constructor: > > 129 // Initialize retention,& inherited fields. Special treatment > 130 // of the corresponding annotation types breaks infinite recursion. > 131 if (annotationClass != Retention.class&& > 132 annotationClass != Inherited.class) { > 133 JavaLangAccess jla = sun.misc.SharedSecrets.getJavaLangAccess(); > 134 Map, Annotation> metaAnnotations = > 135 AnnotationParser.parseAnnotations( > 136 jla.getRawClassAnnotations(annotationClass), > 137 jla.getConstantPool(annotationClass), > 138 annotationClass, > 139 Retention.class, Inherited.class > 140 ); > 141 Retention ret = (Retention) metaAnnotations.get(Retention.class); > 142 retention = (ret == null ? RetentionPolicy.CLASS : ret.value()); > 143 inherited = metaAnnotations.containsKey(Inherited.class); > 144 } > 145 else { > 146 retention = RetentionPolicy.RUNTIME; > 147 inherited = false; > 148 } > > This is enough to break recursion. The RUNTIME and !inherited > assumptions for @Retention and @Inherited meta-annotations are > therefore localized in this code only. > > I have also added two tests. The one for detecting deadlock situation > and the other for consistent parsing of mutually recursive annotations > in presence of separate compilation. Sorry for the delay getting back to you on this, I've been busy with other things. I'm not an expert on the annotation code but the updated approach to break the recursion looks good good to me (and a clever approach). Joel has been on vacation but he told me that he plans to look at this too (I'm happy to sponsor it in the mean-time as I think the approach is good and we should get this fix in). There's another usage of AnnotationParser.parseAnnotation in TypeAnnotationParser that will need to be updated (I only noticed it when I grabbed your patch to try it). A minor comment is that the alignment of the parameter declarations when they go over multiple lines should probably be fixed up to be consistent with the other usages. Thanks for adding tests. One comment on AnnotationTypeDeadlockTest is that the join(500) might not be sufficient on a very busy system (say when running tests concurrently) or on a low-end embedded system. So I think it would be good to bump this up x10. An alternative would be to not set the daemon status and just let the test timeout if there is a deadlock. The spin-waits can consume cycles when running tests concurrently but I don't expect it's an issue here. A typo in the @summary of AnnotationTypeRuntimeAssumptionTest ("si" -> "is"). I guess I'd go for slightly shorter lines to make future side-by-side reviews easier. Otherwise, this looks good to me. -Alan. From brian.burkhalter at oracle.com Wed Jul 3 15:46:51 2013 From: brian.burkhalter at oracle.com (Brian Burkhalter) Date: Wed, 3 Jul 2013 08:46:51 -0700 Subject: Java 8 RFR 6480539: BigDecimal.stripTrailingZeros() has no effect on zero itself ("0.0") Message-ID: Hello, The patch here http://cr.openjdk.java.net/~bpb/6480539/ is proposed to resolve this issue http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6480539 which was most recently discussed in this thread http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-February/014252.html The proposed fix in this prior thread is withdrawn. Thanks, Brian From Alan.Bateman at oracle.com Wed Jul 3 16:09:30 2013 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Wed, 03 Jul 2013 17:09:30 +0100 Subject: RFR: 8017231: Add StringJoiner.merge In-Reply-To: <51D3DAB7.9050109@oracle.com> References: <51D3DAB7.9050109@oracle.com> Message-ID: <51D44CBA.8010001@oracle.com> On 03/07/2013 09:03, Henry Jen wrote: > Hi, > > Please review a simple addition of StringJoiner.merge method. This is > useful to combine StringJoiners used in parallel doing joining works. > > The webrev can be found at > http://cr.openjdk.java.net/~henryjen/ccc/8017231.0/webrev/ > > Also included is a little clean up for StringJoinerTest. > > Cheers, > Henry Is this named "merge" to disambiguate it from "add"? Just wondering. A minor point but I think the wider javadoc tends to use "the given XYZ" when referring to parameters rather than the "the supplied XYZ". Typo "nonempty" -> "non-empty". I assume you meant to name the local otherBuilder rather than an otherBuffer. Also is there any reason not to use append(CharSequence,int,int) here? The test looks good to me, I guess an alternative would be to just add to the existing test so that we have one test for StringJoiner (it doesn't matter either way). -Alan. From Alan.Bateman at oracle.com Wed Jul 3 16:15:02 2013 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Wed, 03 Jul 2013 17:15:02 +0100 Subject: 8019622: (sl) ServiceLoadet.next incorrect when creation and usages are in different contexts Message-ID: <51D44E06.6030204@oracle.com> When running with a security manager, ServiceLoader isn't currently very predictable when created and used in different contexts. For the ServiceLoader usages in the JDK then isn't a problem because all (bar one or two uninteresting cases) involve creating the ServiceLoader and immediately iterating over the providers. However for other usages then it may be an issue as the iteration over the providers may or may not have the expected permissions. The webrev with the proposed changes is here: http://cr.openjdk.java.net/~alanb/8019622/webrev/ Mandy - this is one that we've chatted about a few times so you are probably the best to review it (if you have time of course). -Alan. From forax at univ-mlv.fr Wed Jul 3 16:24:51 2013 From: forax at univ-mlv.fr (Remi Forax) Date: Wed, 03 Jul 2013 18:24:51 +0200 Subject: 8019622: (sl) ServiceLoadet.next incorrect when creation and usages are in different contexts In-Reply-To: <51D44E06.6030204@oracle.com> References: <51D44E06.6030204@oracle.com> Message-ID: <51D45053.6030509@univ-mlv.fr> On 07/03/2013 06:15 PM, Alan Bateman wrote: > > When running with a security manager, ServiceLoader isn't currently > very predictable when created and used in different contexts. For the > ServiceLoader usages in the JDK then isn't a problem because all (bar > one or two uninteresting cases) involve creating the ServiceLoader and > immediately iterating over the providers. However for other usages > then it may be an issue as the iteration over the providers may or may > not have the expected permissions. The webrev with the proposed > changes is here: > > http://cr.openjdk.java.net/~alanb/8019622/webrev/ > > Mandy - this is one that we've chatted about a few times so you are > probably the best to review it (if you have time of course). > > -Alan. Hi Alan, you can use a method reference instead a lambda here, so PrivilegedAction action = () -> hasNextService(); return AccessController.doPrivileged(action, acc); can be written return AccessController.doPrivileged(this::hasNextService, acc); (me crossing my fingers in hope that the compiler will not be confused by the overloads). cheers, R?mi From henry.jen at oracle.com Wed Jul 3 16:57:23 2013 From: henry.jen at oracle.com (Henry Jen) Date: Wed, 3 Jul 2013 09:57:23 -0700 Subject: RFR: 8017231: Add StringJoiner.merge In-Reply-To: <51D44CBA.8010001@oracle.com> References: <51D3DAB7.9050109@oracle.com> <51D44CBA.8010001@oracle.com> Message-ID: On Jul 3, 2013, at 9:09 AM, Alan Bateman wrote: > On 03/07/2013 09:03, Henry Jen wrote: >> Hi, >> >> Please review a simple addition of StringJoiner.merge method. This is >> useful to combine StringJoiners used in parallel doing joining works. >> >> The webrev can be found at >> http://cr.openjdk.java.net/~henryjen/ccc/8017231.0/webrev/ >> >> Also included is a little clean up for StringJoinerTest. >> >> Cheers, >> Henry > Is this named "merge" to disambiguate it from "add"? Just wondering. > I think it's a better reflection on the fact of "merge" of elements like collections, instead of feels like add(StringJoiner.toString()). > A minor point but I think the wider javadoc tends to use "the given XYZ" when referring to parameters rather than the "the supplied XYZ". > > Typo "nonempty" -> "non-empty". > Will fix those. > I assume you meant to name the local otherBuilder rather than an otherBuffer. Also is there any reason not to use append(CharSequence,int,int) here? > Will fix the naming as well. As for append, I don't think there is a particular reason. It would be best if we can do append(char[], start, end), but I don't see there is any way to do that. I suspect append(CS, int, int) should be a little faster without increasing the count each time give a check of range. I'll update it to use append(CharSequence, int, int). > The test looks good to me, I guess an alternative would be to just add to the existing test so that we have one test for StringJoiner (it doesn't matter either way). > I'll leave it out, I think it is easier to navigate that way. Do we need another round for above updates? Cheers, Henry From Alan.Bateman at oracle.com Wed Jul 3 17:01:27 2013 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Wed, 03 Jul 2013 18:01:27 +0100 Subject: 8019622: (sl) ServiceLoadet.next incorrect when creation and usages are in different contexts In-Reply-To: <51D45053.6030509@univ-mlv.fr> References: <51D44E06.6030204@oracle.com> <51D45053.6030509@univ-mlv.fr> Message-ID: <51D458E7.7080107@oracle.com> On 03/07/2013 17:24, Remi Forax wrote: > > Hi Alan, > you can use a method reference instead a lambda here, > so > PrivilegedAction action = () -> hasNextService(); > return AccessController.doPrivileged(action, acc); > can be written > return AccessController.doPrivileged(this::hasNextService, acc); > (me crossing my fingers in hope that the compiler will not be confused > by the overloads). There is a problem using method references here that need to be tracked down. In TypeConvertingMethodAdapter where it handles boxing then String.format is used but that triggers the loading of formatter providers and recursive initialization that blows the stack and manifests as a BootstrapMethodError. I need to ask Robert about this or bring it up on lambda-dev as I'm not sure why this doesn't happen with a lambda. If we have a bootstrapping issue then it may be that ServiceLoader will need to use an inner class here. AccessController.doPrivileged does have overloads that javac reports as ambiguous. As it happens someone made a good suggestion recently on security-dev that the new limited doPrivlieged methods take this into account. -Alan. From joel.franck at oracle.com Wed Jul 3 17:09:49 2013 From: joel.franck at oracle.com (=?iso-8859-1?Q?Joel_Borggr=E9n-Franck?=) Date: Wed, 3 Jul 2013 19:09:49 +0200 Subject: 7122142 : (ann) Race condition between isAnnotationPresent and getAnnotations In-Reply-To: <51C88EBF.9020704@gmail.com> References: <51C1BEC6.1080308@gmail.com> <51C1FE64.3020000@oracle.com> <51C88EBF.9020704@gmail.com> Message-ID: <00288C7A-5455-48E3-A5D3-0D3330B8E796@oracle.com> Hi Peter, As Alan said, a big thanks for looking into this. I have been toying with a slightly different approach to breaking the infinite recursion by pre-construct AnnotationType instances for Retention and Inherited. While cleaner in some places others became uglier. I'm fine with this approach. As Alan said, you need to update the patch with a modification in TypeAnnotationParser. After doing that all java/lang tests in the jdk/test directory passes. Also, can you please explain to me why the update race is safe. I have done the/some research myself but I would like to know which angles you have covered. Given that and that you fix Alan's comments I think this is good to go. Thanks again! cheers /Joel On Jun 24, 2013, at 8:23 PM, Peter Levart wrote: > On 06/19/2013 08:54 PM, Alan Bateman wrote: >> Thank you for coming back to this. >> >> I've looked over the webrev and the approach looks good to me. Joel might want to look at this too. Do you think you could include a test (as we try to include a test with all fixes if we can)? >> >> It would be good to remove the synchronizaiton on initAnnotationsIfNecessary too, but one step as time (and smaller changes are always easier to discuss). >> >> -Alan > > Hi Alan, > > I have prepared the 2nd revision of the patch: > > http://cr.openjdk.java.net/~plevart/jdk8-tl/AnnotationType/webrev.02/ > > There is a little change in AnnotationParser's alternative parsing method. This time the parser does not assume anything about annotations being parsed (previously it assumed that they had RUNTIME retention). The only difference from standard parsing is that only the select annotation types are parsed and the rest are quickly skipped. Infinite recursion is broken by the special cased evaluation in AnnotationType constructor: > > 129 // Initialize retention, & inherited fields. Special treatment > 130 // of the corresponding annotation types breaks infinite recursion. > 131 if (annotationClass != Retention.class && > 132 annotationClass != Inherited.class) { > 133 JavaLangAccess jla = sun.misc.SharedSecrets.getJavaLangAccess(); > 134 Map, Annotation> metaAnnotations = > 135 AnnotationParser.parseAnnotations( > 136 jla.getRawClassAnnotations(annotationClass), > 137 jla.getConstantPool(annotationClass), > 138 annotationClass, > 139 Retention.class, Inherited.class > 140 ); > 141 Retention ret = (Retention) metaAnnotations.get(Retention.class); > 142 retention = (ret == null ? RetentionPolicy.CLASS : ret.value()); > 143 inherited = metaAnnotations.containsKey(Inherited.class); > 144 } > 145 else { > 146 retention = RetentionPolicy.RUNTIME; > 147 inherited = false; > 148 } > > > This is enough to break recursion. The RUNTIME and !inherited assumptions for @Retention and @Inherited meta-annotations are therefore localized in this code only. > > I have also added two tests. The one for detecting deadlock situation and the other for consistent parsing of mutually recursive annotations in presence of separate compilation. > > > > Regards, Peter > From ivan.gerasimov at oracle.com Wed Jul 3 17:12:44 2013 From: ivan.gerasimov at oracle.com (Ivan Gerasimov) Date: Wed, 03 Jul 2013 21:12:44 +0400 Subject: RFR [8016838] java/lang/instrument/RedefineBigClass.sh needs modification Message-ID: <51D45B8C.7010109@oracle.com> Hello everybody! We have a request to improve jtreg test. The test had been written to verify fix for memory leak during class redefinition. The problem is that it always is reported as PASSED even in the presence of the leak. The proposed change is platform specific. It allows memory leak detection only on Linux. This is because the memory leak was in native code, so there's no easy way to detect it from within Java code. Here's the webrev for JDK8 repository: http://cr.openjdk.java.net/~igerasim/8016838/0/webrev/ The surprising thing is that modified test detected the leak with the latest JDK8! Latest 6 and 7 are fine, so it might be regression in JDK8. I've filled a bug http://bugs.sun.com/view_bug.do?bug_id=8019845 "Memory leak during class redefenition" (not yet available.) Sincerely yours, Ivan Gerasimov From henry.jen at oracle.com Wed Jul 3 17:14:02 2013 From: henry.jen at oracle.com (Henry Jen) Date: Wed, 3 Jul 2013 10:14:02 -0700 Subject: RFR: 8017231: Add StringJoiner.merge In-Reply-To: References: <51D3DAB7.9050109@oracle.com> <51D44CBA.8010001@oracle.com> Message-ID: On Jul 3, 2013, at 9:57 AM, Henry Jen wrote: > > On Jul 3, 2013, at 9:09 AM, Alan Bateman wrote: > >> On 03/07/2013 09:03, Henry Jen wrote: >>> Hi, >>> >>> Please review a simple addition of StringJoiner.merge method. This is >>> useful to combine StringJoiners used in parallel doing joining works. >>> >>> The webrev can be found at >>> http://cr.openjdk.java.net/~henryjen/ccc/8017231.0/webrev/ >>> >>> Also included is a little clean up for StringJoinerTest. >>> >>> Cheers, >>> Henry >> Is this named "merge" to disambiguate it from "add"? Just wondering. >> > > I think it's a better reflection on the fact of "merge" of elements like collections, instead of feels like add(StringJoiner.toString()). > >> A minor point but I think the wider javadoc tends to use "the given XYZ" when referring to parameters rather than the "the supplied XYZ". >> >> Typo "nonempty" -> "non-empty". >> > > Will fix those. > >> I assume you meant to name the local otherBuilder rather than an otherBuffer. Also is there any reason not to use append(CharSequence,int,int) here? >> > > Will fix the naming as well. > > As for append, I don't think there is a particular reason. > I should said the range check is the reason. Cheers, Henry > It would be best if we can do append(char[], start, end), but I don't see there is any way to do that. I suspect append(CS, int, int) should be a little faster without increasing the count each time give a check of range. > > I'll update it to use append(CharSequence, int, int). > From mandy.chung at oracle.com Wed Jul 3 17:29:53 2013 From: mandy.chung at oracle.com (Mandy Chung) Date: Wed, 03 Jul 2013 10:29:53 -0700 Subject: 8019622: (sl) ServiceLoadet.next incorrect when creation and usages are in different contexts In-Reply-To: <51D44E06.6030204@oracle.com> References: <51D44E06.6030204@oracle.com> Message-ID: <51D45F91.8040709@oracle.com> On 7/3/13 9:15 AM, Alan Bateman wrote: > > When running with a security manager, ServiceLoader isn't currently > very predictable when created and used in different contexts. For the > ServiceLoader usages in the JDK then isn't a problem because all (bar > one or two uninteresting cases) involve creating the ServiceLoader and > immediately iterating over the providers. However for other usages > then it may be an issue as the iteration over the providers may or may > not have the expected permissions. The webrev with the proposed > changes is here: > > http://cr.openjdk.java.net/~alanb/8019622/webrev/ > > Mandy - this is one that we've chatted about a few times so you are > probably the best to review it (if you have time of course). > We've talked about this a few times and it's good to see this fixed. The fix is reasonable to capture the ACC at creation time and use that for iteration. Looks good. Mandy From joe.darcy at oracle.com Wed Jul 3 17:35:47 2013 From: joe.darcy at oracle.com (Joe Darcy) Date: Wed, 03 Jul 2013 10:35:47 -0700 Subject: Java 8 RFR 6480539: BigDecimal.stripTrailingZeros() has no effect on zero itself ("0.0") In-Reply-To: References: Message-ID: <51D460F3.5070103@oracle.com> Hi Brian, I have some concerns with this patch. First, I think the stripTrailingZeros specification should explicitly call out what happens with a numerically zero value. Second, I would have expected the code change to be limited to the stripTrailingZeros method. The private createAndStripZerosToMatchScale methods are used during rounding operations and unconditionally set the scale of a zero value to zero, which is incorrect according to the specification. I believe sufficiently thorough tests of divide should fail with the current changes to createAndStripZerosToMatchScale. Cheers, -Joe On 07/03/2013 08:46 AM, Brian Burkhalter wrote: > Hello, > > The patch here > > http://cr.openjdk.java.net/~bpb/6480539/ > > is proposed to resolve this issue > > http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6480539 > > which was most recently discussed in this thread > > http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-February/014252.html > > The proposed fix in this prior thread is withdrawn. > > Thanks, > > Brian From brian.burkhalter at oracle.com Wed Jul 3 17:47:47 2013 From: brian.burkhalter at oracle.com (Brian Burkhalter) Date: Wed, 3 Jul 2013 10:47:47 -0700 Subject: Java 8 RFR 6480539: BigDecimal.stripTrailingZeros() has no effect on zero itself ("0.0") In-Reply-To: <51D460F3.5070103@oracle.com> References: <51D460F3.5070103@oracle.com> Message-ID: Hi Joe, Thanks for pointing out the problems with modifying the private methods. I'll update this only to change the one public method and to modify its specification. Thanks, Brian On Jul 3, 2013, at 10:35 AM, Joe Darcy wrote: > I have some concerns with this patch. > > First, I think the stripTrailingZeros specification should explicitly call out what happens with a numerically zero value. > > Second, I would have expected the code change to be limited to the stripTrailingZeros method. The private createAndStripZerosToMatchScale methods are used during rounding operations and unconditionally set the scale of a zero value to zero, which is incorrect according to the specification. > > I believe sufficiently thorough tests of divide should fail with the current changes to createAndStripZerosToMatchScale. From forax at univ-mlv.fr Wed Jul 3 17:56:19 2013 From: forax at univ-mlv.fr (Remi Forax) Date: Wed, 03 Jul 2013 19:56:19 +0200 Subject: 8019622: (sl) ServiceLoadet.next incorrect when creation and usages are in different contexts In-Reply-To: <51D458E7.7080107@oracle.com> References: <51D44E06.6030204@oracle.com> <51D45053.6030509@univ-mlv.fr> <51D458E7.7080107@oracle.com> Message-ID: <51D465C3.9080900@univ-mlv.fr> On 07/03/2013 07:01 PM, Alan Bateman wrote: > On 03/07/2013 17:24, Remi Forax wrote: >> >> Hi Alan, >> you can use a method reference instead a lambda here, >> so >> PrivilegedAction action = () -> hasNextService(); >> return AccessController.doPrivileged(action, acc); >> can be written >> return AccessController.doPrivileged(this::hasNextService, acc); >> (me crossing my fingers in hope that the compiler will not be >> confused by the overloads). > There is a problem using method references here that need to be > tracked down. In TypeConvertingMethodAdapter where it handles boxing > then String.format is used but that triggers the loading of formatter > providers and recursive initialization that blows the stack and > manifests as a BootstrapMethodError. I need to ask Robert about this > or bring it up on lambda-dev as I'm not sure why this doesn't happen > with a lambda. If we have a bootstrapping issue then it may be that > ServiceLoader will need to use an inner class here. Interesting ! it's related to the way the compiler desugar lambda vs method reference. I've not taken a look to the generated code but I think I know why the behaviour is different. If the code uses a lambda: PrivilegedAction action = () -> hasNextService(); the compiler will create a private method lambda$n and will infer it's parameter type and return type, here the infered return type is Boolean and not boolean, so the boxing of the result of hasNextService() is done inside the method lambda$n. If the code uses a method reference: PrivilegedAction action = this::hasNextService; No method lambda$n is generated, the compiler uses the method hasNextService, so the boxing need to be done in the generated proxy at runtime. So the way to fix this issue is to not use String.format in boxingDescriptor (It's the only method in TypeConvertingMethodAdapter that uses format) private static String boxingDescriptor(Wrapper w) { return '(' + w.basicTypeChar() + ")L" + wrapperName(w) + ';' } > > AccessController.doPrivileged does have overloads that javac reports > as ambiguous. Yes, after sending this mail, I recall that the EG decide to not disambiguate overloads based on the fact that the lambda/method reference declare to throw an exception or not. > As it happens someone made a good suggestion recently on security-dev > that the new limited doPrivlieged methods take this into account. or to write two lines instead of one: PrivilegedAction action = this::hasNextService; return AccessController.doPrivileged(action, acc); > > -Alan. > > R?mi From brian.burkhalter at oracle.com Wed Jul 3 18:09:01 2013 From: brian.burkhalter at oracle.com (Brian Burkhalter) Date: Wed, 3 Jul 2013 11:09:01 -0700 Subject: Java 8 RFR 6480539: BigDecimal.stripTrailingZeros() has no effect on zero itself ("0.0") In-Reply-To: References: <51D460F3.5070103@oracle.com> Message-ID: On Jul 3, 2013, at 10:47 AM, Brian Burkhalter wrote: > I'll update this only to change the one public method and to modify its specification. I've updated the webrev http://cr.openjdk.java.net/~bpb/6480539/ and rerun JTREG as well as modifying and resubmitting the CCC request (it had been filed for the previous fix proposal). Thanks, Brian From joe.darcy at oracle.com Wed Jul 3 18:40:03 2013 From: joe.darcy at oracle.com (Joe Darcy) Date: Wed, 03 Jul 2013 11:40:03 -0700 Subject: Java 8 RFR 6480539: BigDecimal.stripTrailingZeros() has no effect on zero itself ("0.0") In-Reply-To: References: <51D460F3.5070103@oracle.com> Message-ID: <51D47003.3050302@oracle.com> On 07/03/2013 11:09 AM, Brian Burkhalter wrote: > On Jul 3, 2013, at 10:47 AM, Brian Burkhalter wrote: > >> I'll update this only to change the one public method and to modify its specification. > I've updated the webrev > > http://cr.openjdk.java.net/~bpb/6480539/ > > and rerun JTREG as well as modifying and resubmitting the CCC request (it had been filed for the previous fix proposal). > The compareMagnitude method is private so shouldn't be used in the behavioral description. I recommend something like, "If this {@code BigDecimal} is numerically equal to zero, {@code BigDecimal.ZERO} is returned." Also, in the initial check, instead of 2604 if (compareMagnitude(BigDecimal.ZERO) == 0) { 2605 return BigDecimal.ZERO; 2606 } else if (intCompact != INFLATED) { something like if (intCompact == 0 or intVal.signum() == 0) might be faster. Also, I recommend adding a few more test cases for zeros with small exponents, e.g. "0e2", "0e-2". thanks, -Joe From Alan.Bateman at oracle.com Wed Jul 3 18:41:56 2013 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Wed, 03 Jul 2013 19:41:56 +0100 Subject: RFR 8017329 8b92-lambda regression: TreeSet("a", "b").stream().substream(1).parallel().iterator() is empty In-Reply-To: <6C3ED24A-9A28-403E-B995-9C09C69571C2@oracle.com> References: <6C3ED24A-9A28-403E-B995-9C09C69571C2@oracle.com> Message-ID: <51D47074.3030009@oracle.com> On 27/06/2013 10:38, Paul Sandoz wrote: > Hi, > > Please review a fix for a regression with using Stream.substream for an ORDERED but not SUBSIZED spliterator that does not split. > > This is based off: > > http://cr.openjdk.java.net/~psandoz/tl/JDK-8012987-slice/webrev/ > > which is blocked waiting for the Comparator API webrev to go into tl, which should be soon (waiting on CCC approval). > > Paul. > From what I understand of this then it looks fine to me. -Alan. From christian.thalinger at oracle.com Wed Jul 3 18:35:35 2013 From: christian.thalinger at oracle.com (christian.thalinger at oracle.com) Date: Wed, 03 Jul 2013 18:35:35 +0000 Subject: hg: jdk8/tl/jdk: 8019184: MethodHandles.catchException() fails when methods have 8 args + varargs Message-ID: <20130703183551.94D184877E@hg.openjdk.java.net> Changeset: bd6949f9dbb2 Author: twisti Date: 2013-07-03 11:35 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/bd6949f9dbb2 8019184: MethodHandles.catchException() fails when methods have 8 args + varargs Reviewed-by: jrose ! src/share/classes/java/lang/invoke/MethodHandleImpl.java + test/java/lang/invoke/TestCatchExceptionWithVarargs.java From Alan.Bateman at oracle.com Wed Jul 3 19:35:29 2013 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Wed, 03 Jul 2013 20:35:29 +0100 Subject: 8019622: (sl) ServiceLoadet.next incorrect when creation and usages are in different contexts In-Reply-To: <51D465C3.9080900@univ-mlv.fr> References: <51D44E06.6030204@oracle.com> <51D45053.6030509@univ-mlv.fr> <51D458E7.7080107@oracle.com> <51D465C3.9080900@univ-mlv.fr> Message-ID: <51D47D01.80201@oracle.com> On 03/07/2013 18:56, Remi Forax wrote: > > Interesting ! > it's related to the way the compiler desugar lambda vs method reference. > > I've not taken a look to the generated code but I think I know why the > behaviour is different. > If the code uses a lambda: > PrivilegedAction action = () -> hasNextService(); > the compiler will create a private method lambda$n and will infer it's > parameter type and return type, > here the infered return type is Boolean and not boolean, so the boxing > of the result of hasNextService() > is done inside the method lambda$n. > > If the code uses a method reference: > PrivilegedAction action = this::hasNextService; > No method lambda$n is generated, the compiler uses the method > hasNextService, so the boxing > need to be done in the generated proxy at runtime. I've checked the generated code and this does seem to be the case (thanks!). > > So the way to fix this issue is to not use String.format in > boxingDescriptor > (It's the only method in TypeConvertingMethodAdapter that uses format) > > private static String boxingDescriptor(Wrapper w) { > return '(' + w.basicTypeChar() + ")L" + wrapperName(w) + ';' > } I assume you mean "(" to avoid another puzzle :-) That should fix it but I worry that this might be a bit brittle and maybe there be other code paths that will trigger loading of providers when building call sites that result in the same thing. It might be safer for now to just use inner classes here. -Alan. From henry.jen at oracle.com Wed Jul 3 19:46:06 2013 From: henry.jen at oracle.com (Henry Jen) Date: Wed, 03 Jul 2013 12:46:06 -0700 Subject: RFR (2nd): 8017231: Add StringJoiner.merge Message-ID: <51D47F7E.4080600@oracle.com> Hi, Adapted comments from Alan and Paul, thanks for reviewing. http://cr.openjdk.java.net/~henryjen/ccc/8017231.1/webrev/ Cheers, Henry From paul.sandoz at oracle.com Wed Jul 3 19:45:33 2013 From: paul.sandoz at oracle.com (paul.sandoz at oracle.com) Date: Wed, 03 Jul 2013 19:45:33 +0000 Subject: hg: jdk8/tl/jdk: 8017329: 8b92-lambda regression: TreeSet("a", "b").stream().substream(1).parallel().iterator() is empty Message-ID: <20130703194555.B9B5748789@hg.openjdk.java.net> Changeset: 7532bb2d6476 Author: psandoz Date: 2013-07-03 21:19 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/7532bb2d6476 8017329: 8b92-lambda regression: TreeSet("a", "b").stream().substream(1).parallel().iterator() is empty Reviewed-by: alanb ! src/share/classes/java/util/stream/SliceOps.java ! test/java/util/stream/test/org/openjdk/tests/java/util/stream/SliceOpTest.java From jason.uh at oracle.com Wed Jul 3 19:52:27 2013 From: jason.uh at oracle.com (jason.uh at oracle.com) Date: Wed, 03 Jul 2013 19:52:27 +0000 Subject: hg: jdk8/tl/jdk: 8019772: Fix doclint issues in javax.crypto and javax.security subpackages Message-ID: <20130703195302.91BF24878A@hg.openjdk.java.net> Changeset: d5de500c99a3 Author: juh Date: 2013-07-03 12:51 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/d5de500c99a3 8019772: Fix doclint issues in javax.crypto and javax.security subpackages Reviewed-by: darcy ! src/share/classes/javax/crypto/Cipher.java ! src/share/classes/javax/crypto/CipherInputStream.java ! src/share/classes/javax/crypto/ExemptionMechanism.java ! src/share/classes/javax/crypto/KeyAgreement.java ! src/share/classes/javax/crypto/KeyGenerator.java ! src/share/classes/javax/crypto/NullCipher.java ! src/share/classes/javax/security/auth/Subject.java ! src/share/classes/javax/security/cert/X509Certificate.java From brian.burkhalter at oracle.com Wed Jul 3 20:01:41 2013 From: brian.burkhalter at oracle.com (Brian Burkhalter) Date: Wed, 3 Jul 2013 13:01:41 -0700 Subject: Java 8 RFR 8019857: Fix doclint errors in java.util.Format* Message-ID: <9A7DE880-5213-4B31-8E7F-00C65C245C19@oracle.com> Reviewers: For this issue http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8019857 (should be public "soon"). here is the proposed update http://cr.openjdk.java.net/~bpb/8019857/ Note that the diff starting at line 2593 is to correct a warning, not an error, and would require a CCC request (I think). Thanks, Brian From joe.darcy at oracle.com Wed Jul 3 20:26:15 2013 From: joe.darcy at oracle.com (Joe Darcy) Date: Wed, 03 Jul 2013 13:26:15 -0700 Subject: Java 8 RFR 8019857: Fix doclint errors in java.util.Format* In-Reply-To: <9A7DE880-5213-4B31-8E7F-00C65C245C19@oracle.com> References: <9A7DE880-5213-4B31-8E7F-00C65C245C19@oracle.com> Message-ID: <51D488E7.70504@oracle.com> Hi Brian, Looks good; approved to go back. The enum BigDecimalLayoutForm seems to have escaped notice previously; since the comments being added are "obvious", I don't think a ccc request is necessary. Thanks for fixing these, -Joe On 07/03/2013 01:01 PM, Brian Burkhalter wrote: > Reviewers: > > For this issue > > http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8019857 (should be public "soon"). > > here is the proposed update > > http://cr.openjdk.java.net/~bpb/8019857/ > > Note that the diff starting at line 2593 is to correct a warning, not an error, and would require a CCC request (I think). > > Thanks, > > Brian From Alan.Bateman at oracle.com Wed Jul 3 20:36:02 2013 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Wed, 03 Jul 2013 21:36:02 +0100 Subject: RFR (2nd): 8017231: Add StringJoiner.merge In-Reply-To: <51D47F7E.4080600@oracle.com> References: <51D47F7E.4080600@oracle.com> Message-ID: <51D48B32.6020508@oracle.com> On 03/07/2013 20:46, Henry Jen wrote: > Hi, > > Adapted comments from Alan and Paul, thanks for reviewing. > > http://cr.openjdk.java.net/~henryjen/ccc/8017231.1/webrev/ > This looks good to me. (I see you took the suggestion to s/supplied/given. There's another one in the add(CharSequence) method that could be changed too). -Alan From henry.jen at oracle.com Wed Jul 3 21:10:01 2013 From: henry.jen at oracle.com (Henry Jen) Date: Wed, 3 Jul 2013 14:10:01 -0700 Subject: RFR (2nd): 8017231: Add StringJoiner.merge In-Reply-To: <51D48B32.6020508@oracle.com> References: <51D47F7E.4080600@oracle.com> <51D48B32.6020508@oracle.com> Message-ID: Yes, when I looked at it, there are other places as well. But I decided to leave those alone as for delimiter/prefix/suffix, 'supplied' seems to be fine and consistent. add() is perhaps a good change. I updated the webrev with this simple change, then I'll need a sponsor to push for me. Cheers, Henry On Jul 3, 2013, at 1:36 PM, Alan Bateman wrote: > On 03/07/2013 20:46, Henry Jen wrote: >> Hi, >> >> Adapted comments from Alan and Paul, thanks for reviewing. >> >> http://cr.openjdk.java.net/~henryjen/ccc/8017231.1/webrev/ >> > This looks good to me. > > (I see you took the suggestion to s/supplied/given. There's another one in the add(CharSequence) method that could be changed too). > > -Alan From bill.pittore at oracle.com Wed Jul 3 21:17:29 2013 From: bill.pittore at oracle.com (BILL PITTORE) Date: Wed, 03 Jul 2013 17:17:29 -0400 Subject: RFR - Changes to address CCC 8014135: Support for statically linked agents Message-ID: <51D494E9.2020200@oracle.com> These changes address bug 8014135 which adds support for statically linked agents in the VM. This is a followup to the recent JNI spec changes that addressed statically linked JNI libraries( 8005716). The JEP for this change is the same JEP as the JNI changes: http://openjdk.java.net/jeps/178 Webrevs are here: http://cr.openjdk.java.net/~bpittore/8014135/jdk/webrev.00/ http://cr.openjdk.java.net/~bpittore/8014135/hotspot/webrev.00/ The changes to jvmti.xml can also be seen in the output file that I placed here: http://cr.openjdk.java.net/~bpittore/8014135/hotspot/webrev.00/jvmti.html Thanks, bill From henry.jen at oracle.com Wed Jul 3 21:20:55 2013 From: henry.jen at oracle.com (Henry Jen) Date: Wed, 03 Jul 2013 14:20:55 -0700 Subject: RFR: 8015315: Stream.concat methods In-Reply-To: <51D15168.2020403@univ-mlv.fr> References: <51CE3142.60800@oracle.com> <51D15168.2020403@univ-mlv.fr> Message-ID: <51D495B7.5030304@oracle.com> On 07/01/2013 02:52 AM, Remi Forax wrote: > On 06/29/2013 02:58 AM, Henry Jen wrote: >> Hi, >> >> Please review the webrev that add concat static method to Stream and >> primitive Streams. >> >> http://cr.openjdk.java.net/~henryjen/ccc/8015315.0/webrev/ >> >> Cheers, >> Henry > > Hi Henry, > I find the the cast to Spliterator in Streams.concat() dubious, > I can not see how it can be correct, could you explain why this cast is Ok. > As Peter pointed out, it's convariant like Iterator, so it is a safe cast. The public API had correct signature, as the internal implementation, looks like we just have to push the cast around as we work out the Spliterator type system with primitives. Thus current implementation seems to be just fine. Cheers, Henry From vincent.x.ryan at oracle.com Wed Jul 3 21:38:21 2013 From: vincent.x.ryan at oracle.com (vincent.x.ryan at oracle.com) Date: Wed, 03 Jul 2013 21:38:21 +0000 Subject: hg: jdk8/tl/jdk: 2 new changesets Message-ID: <20130703213902.CE2F048792@hg.openjdk.java.net> Changeset: e594ee7a7c2f Author: vinnie Date: 2013-07-02 16:38 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/e594ee7a7c2f 7165807: Non optimized initialization of NSS crypto library leads to scalability issues Reviewed-by: mullan, valeriep ! make/sun/security/pkcs11/mapfile-vers ! makefiles/mapfiles/libj2pkcs11/mapfile-vers ! src/share/classes/sun/security/pkcs11/Config.java ! src/share/classes/sun/security/pkcs11/Secmod.java ! src/share/classes/sun/security/pkcs11/SunPKCS11.java ! src/share/native/sun/security/pkcs11/j2secmod.c ! src/solaris/native/sun/security/pkcs11/j2secmod_md.h ! src/windows/native/sun/security/pkcs11/j2secmod_md.h Changeset: cbee2e595600 Author: vinnie Date: 2013-07-03 14:35 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/cbee2e595600 Merge From joe.darcy at oracle.com Wed Jul 3 21:42:32 2013 From: joe.darcy at oracle.com (joe.darcy at oracle.com) Date: Wed, 03 Jul 2013 21:42:32 +0000 Subject: hg: jdk8/tl/jdk: 8019857: Fix doclint errors in java.util.Format* Message-ID: <20130703214302.B967148793@hg.openjdk.java.net> Changeset: a49208237599 Author: bpb Date: 2013-07-03 13:30 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/a49208237599 8019857: Fix doclint errors in java.util.Format* Summary: Fix doclint errors in java.util.Format*. Reviewed-by: darcy Contributed-by: Brian Burkhalter ! src/share/classes/java/util/Formattable.java ! src/share/classes/java/util/Formatter.java From brian.burkhalter at oracle.com Wed Jul 3 22:21:16 2013 From: brian.burkhalter at oracle.com (Brian Burkhalter) Date: Wed, 3 Jul 2013 15:21:16 -0700 Subject: Java 8 RFR: 8019862: Fix doclint errors in java.lang.*. Message-ID: Reviewers: For this issue http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8019862 (should be public "soon"). here is the proposed update http://cr.openjdk.java.net/~bpb/8019862/ Thanks, Brian From brian.burkhalter at oracle.com Wed Jul 3 22:24:08 2013 From: brian.burkhalter at oracle.com (Brian Burkhalter) Date: Wed, 3 Jul 2013 15:24:08 -0700 Subject: Java 8 RFR: 8019862: Fix doclint errors in java.lang.*. In-Reply-To: References: Message-ID: <25768AED-CE21-4618-95D6-BFC8E1AC72BA@oracle.com> Oops - hold off on this one pending a correction. Thanks, Brian On Jul 3, 2013, at 3:21 PM, Brian Burkhalter wrote: > Reviewers: > > For this issue > > http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8019862 (should be public "soon"). > > here is the proposed update > > http://cr.openjdk.java.net/~bpb/8019862/ > > Thanks, > > Brian From jeremymanson at google.com Wed Jul 3 22:32:10 2013 From: jeremymanson at google.com (Jeremy Manson) Date: Wed, 3 Jul 2013 15:32:10 -0700 Subject: RFR - Changes to address CCC 8014135: Support for statically linked agents In-Reply-To: <51D494E9.2020200@oracle.com> References: <51D494E9.2020200@oracle.com> Message-ID: I know that this is mentioned in the JEP, but does it really make sense to have -agentpath work here, rather than just -agentlib? I would think that specifying a full pathname and getting the library loaded out of the launcher would be a little surprising to people who are basically saying "please load this agent from the given path". Also, in practice, we do something very similar at Google, and, when testing, I find it occasionally useful to be able to say "please load this agent on the command line via the agentpath I gave you, rather than loading the one with the same name I baked into the launcher". (FWIW, when we did this internally at Google, we added a special -XX flag for when the agent is in the launcher. I know that you don't want to go that way, though.) On Wed, Jul 3, 2013 at 2:17 PM, BILL PITTORE wrote: > These changes address bug 8014135 which adds support for statically linked > agents in the VM. This is a followup to the recent JNI spec changes that > addressed statically linked JNI libraries( 8005716). > The JEP for this change is the same JEP as the JNI changes: > http://openjdk.java.net/jeps/**178 > > Webrevs are here: > > http://cr.openjdk.java.net/~**bpittore/8014135/jdk/webrev.**00/ > http://cr.openjdk.java.net/~**bpittore/8014135/hotspot/**webrev.00/ > > The changes to jvmti.xml can also be seen in the output file that I placed > here: > http://cr.openjdk.java.net/~**bpittore/8014135/hotspot/** > webrev.00/jvmti.html > > Thanks, > bill > > > From henry.jen at oracle.com Wed Jul 3 22:51:58 2013 From: henry.jen at oracle.com (Henry Jen) Date: Wed, 03 Jul 2013 15:51:58 -0700 Subject: RFR: 8017141: java.util/stream Spliterators from sequential sources should not catch OOME Message-ID: <51D4AB0E.8090501@oracle.com> Hi, Please review the webrev at http://cr.openjdk.java.net/~henryjen/tl/8017141.0/webrev/ Cheers, Henry From dl at cs.oswego.edu Wed Jul 3 22:55:22 2013 From: dl at cs.oswego.edu (Doug Lea) Date: Wed, 03 Jul 2013 18:55:22 -0400 Subject: Possible HashMap update Message-ID: <51D4ABDA.7010801@cs.oswego.edu> A few weeks ago, in the course of doing a (hopefully-last) reworking of JDK8 ConcurrentHashMap (CHM) internals based on experience with preview versions, I noticed that the balanced tree scheme now in place as a fallback in the case of usages with many keys all with the same hashCode could also be profitably used in other cases: CHM (like HashMap) previously performed some bit-scrambling of user hashCodes to make it less likely that user hashCodes that were non-identical but highly-non-random will collide in the same bins (thus with O(n) vs the expected O(1) performance). This bit-scrambling is an anti-optimization in many usages that do not contain the kinds of systematic hashCode bias that most hurt performance. While it is reasonably fast, it still places computation where you do not want it: in front of the likely cache-miss to access an entry. Plus, bit-scrambling is only statistically likely to help. It is still possible to encounter hashCodes that systematically collide. It would be nice to provide O(log N) guarantees for these cases as well. So, CHM now omits bit-scrambling (well, almost -- just a single xor to avoid losing impact of top bits), and instead rolls over into using trees for bins that contain a statistically unlikely number of keys, and rolling back into simple bin form if/when they don't due to deletions or resizings. ("Statistically unlikely" is a surprisingly low number. More than 8 nodes are expected only about once per ten million under perfectly random keys; this is also often (depending on cost of equals() methods, additional dispatch overhead, etc), around the break-even point for using trees vs lists). The updated tree mechanics now provide O(log N) worst-case performance in either of two cases: (colliding non-identical-hashCodes), and (identical hashCodes but mutually Comparable keys). And does so while also speeding up by a little those typical usages that do not encounter systematic collisions. Also, there is no sense at all in using any form of hashSeed in this scheme. It basically behaves the same whether or not you use one. The overall impact appears to be a net win. Non-heavily-colliding cases are a bit faster. Some colliding cases are a little slower and use more memory (tree-based nodes are bigger than plain ones), but have much better worst (and typical) case bounds unless people use crazily-bad keys that all have same hashCodes but are never equal or comparable to others, in which case treeification is wasted effort (but only by a constant factor of about 2 in both time and space). This seemed to be enough of an improvement in terms of both worst-case and expected performance to try applying it to TreeBin-enabled HashMap. So I gave it a try. To enable bidirectional tree<->plain node conversion, I used the subclassing strategy mentioned during discussion of the initial balanced tree version. This in turn requires a completely different within-package internal API to allow LinkedHashMap to continue to subclass HashMap. A couple of internal constructions exist solely to allow the same source code to be identical in HashMap and ConcurrenHashMap (but not the same compiled code, since the types they operate on are and must be unrelated in the two classes, and because they live in different packages, there's no nice way to express their commonalities without exposing.) This note serves as a pre-proposal request for comment, as well a request for anyone interested in trying it out, especially in any weird/unusual use cases, to report experiences before seriously considering it as a replacement. To simplify logistics, I checked in the code in a workspace directory in jsr166: http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/src/dl/java/util/HashMap.java?view=log http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/src/dl/java/util/LinkedHashMap.java?view=log From brian.burkhalter at oracle.com Wed Jul 3 23:40:50 2013 From: brian.burkhalter at oracle.com (Brian Burkhalter) Date: Wed, 3 Jul 2013 16:40:50 -0700 Subject: Java 8 RFR: 8019862: Fix doclint errors in java.lang.*. In-Reply-To: References: Message-ID: <5C5155DE-D703-47E4-950D-D01EDD6B1055@oracle.com> OK, this is ready to go now. This error src/share/classes/java/lang/ThreadLocal.java:139: warning: no @param for public static ThreadLocal withInitial(Supplier supplier) { ^ Note: src/share/classes/java/lang/Boolean.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 1 warning is still reported but I don't see the problem so perhaps it's a bug in the doclint option? Brian On Jul 3, 2013, at 3:21 PM, Brian Burkhalter wrote: > Reviewers: > > For this issue > > http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8019862 (should be public "soon"). > > here is the proposed update > > http://cr.openjdk.java.net/~bpb/8019862/ > > Thanks, > > Brian From eric.mccorkle at oracle.com Wed Jul 3 23:47:43 2013 From: eric.mccorkle at oracle.com (eric.mccorkle at oracle.com) Date: Wed, 03 Jul 2013 23:47:43 +0000 Subject: hg: jdk8/tl/jdk: 8016285: Add java.lang.reflect.Parameter.isNamePresent() Message-ID: <20130703234807.76FD2487A5@hg.openjdk.java.net> Changeset: a8f51c3341a5 Author: emc Date: 2013-07-03 19:47 -0400 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/a8f51c3341a5 8016285: Add java.lang.reflect.Parameter.isNamePresent() Summary: Add isNamePresent method to parameter reflection library, which indicates whether or real parameter data is available Reviewed-by: darcy ! src/share/classes/java/lang/reflect/Executable.java ! src/share/classes/java/lang/reflect/Parameter.java ! test/java/lang/reflect/Parameter/WithParameters.java ! test/java/lang/reflect/Parameter/WithoutParameters.java From joe.darcy at oracle.com Wed Jul 3 23:59:53 2013 From: joe.darcy at oracle.com (Joe Darcy) Date: Wed, 03 Jul 2013 16:59:53 -0700 Subject: Java 8 RFR: 8019862: Fix doclint errors in java.lang.*. In-Reply-To: <5C5155DE-D703-47E4-950D-D01EDD6B1055@oracle.com> References: <5C5155DE-D703-47E4-950D-D01EDD6B1055@oracle.com> Message-ID: <51D4BAF9.60701@oracle.com> On 07/03/2013 04:40 PM, Brian Burkhalter wrote: > OK, this is ready to go now. > > This error > > src/share/classes/java/lang/ThreadLocal.java:139: warning: no @param for > public static ThreadLocal withInitial(Supplier supplier) { > ^ > Note: src/share/classes/java/lang/Boolean.java uses unchecked or unsafe operations. > Note: Recompile with -Xlint:unchecked for details. > 1 warning > > is still reported but I don't see the problem so perhaps it's a bug in the doclint option? I believe the doclint option is correct, the T in that method is *not* the T in the class declaration; it is a local type variable on the method. Therefore, this change would resolve the warning: diff -r a49208237599 src/share/classes/java/lang/ThreadLocal.java --- a/src/share/classes/java/lang/ThreadLocal.java Wed Jul 03 13:30:46 2013 -0700 +++ b/src/share/classes/java/lang/ThreadLocal.java Wed Jul 03 16:57:54 2013 -0700 @@ -131,12 +131,13 @@ * Creates a thread local variable. The initial value of the variable is * determined by invoking the {@code get} method on the {@code Supplier}. * + * @param the type of the thread local's value * @param supplier the supplier to be used to determine the initial value * @return a new thread local variable * @throws NullPointerException if the specified supplier is null * @since 1.8 */ - public static ThreadLocal withInitial(Supplier supplier) { + public static ThreadLocal withInitial(Supplier supplier) { return new SuppliedThreadLocal<>(supplier); } as would diff -r a49208237599 src/share/classes/java/lang/ThreadLocal.java --- a/src/share/classes/java/lang/ThreadLocal.java Wed Jul 03 13:30:46 2013 -0700 +++ b/src/share/classes/java/lang/ThreadLocal.java Wed Jul 03 16:58:38 2013 -0700 @@ -131,6 +131,7 @@ * Creates a thread local variable. The initial value of the variable is * determined by invoking the {@code get} method on the {@code Supplier}. * + * @param the type of the thread local's value * @param supplier the supplier to be used to determine the initial value * @return a new thread local variable * @throws NullPointerException if the specified supplier is null However, I would recommend the first of these. Otherwise, the change looks good to go back. -Joe > > Brian > > On Jul 3, 2013, at 3:21 PM, Brian Burkhalter wrote: > >> Reviewers: >> >> For this issue >> >> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8019862 (should be public "soon"). >> >> here is the proposed update >> >> http://cr.openjdk.java.net/~bpb/8019862/ >> >> Thanks, >> >> Brian From brian.burkhalter at oracle.com Thu Jul 4 00:12:40 2013 From: brian.burkhalter at oracle.com (Brian Burkhalter) Date: Wed, 3 Jul 2013 17:12:40 -0700 Subject: Java 8 RFR: 8019862: Fix doclint errors in java.lang.*. In-Reply-To: <51D4BAF9.60701@oracle.com> References: <5C5155DE-D703-47E4-950D-D01EDD6B1055@oracle.com> <51D4BAF9.60701@oracle.com> Message-ID: <38115316-8334-49E6-8431-62A92A316E00@oracle.com> All right, I update the patch at the same location with the first of the proposed corrections. Thanks, Brian On Jul 3, 2013, at 4:59 PM, Joe Darcy wrote: > However, I would recommend the first of these. > > Otherwise, the change looks good to go back. > > -Joe > >> >> Brian >> >> On Jul 3, 2013, at 3:21 PM, Brian Burkhalter wrote: >> >>> Reviewers: >>> >>> For this issue >>> >>> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8019862 (should be public "soon"). >>> >>> here is the proposed update >>> >>> http://cr.openjdk.java.net/~bpb/8019862/ From joe.darcy at oracle.com Thu Jul 4 00:20:39 2013 From: joe.darcy at oracle.com (joe.darcy at oracle.com) Date: Thu, 04 Jul 2013 00:20:39 +0000 Subject: hg: jdk8/tl/jdk: 8019862: Fix doclint errors in java.lang.*. Message-ID: <20130704002121.C1D9D487A6@hg.openjdk.java.net> Changeset: 043b2eb76b0e Author: bpb Date: 2013-07-03 17:08 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/043b2eb76b0e 8019862: Fix doclint errors in java.lang.*. Summary: Fix doclint errors in java.lang.* Reviewed-by: darcy Contributed-by: Brian Burkhalter ! src/share/classes/java/lang/CharSequence.java ! src/share/classes/java/lang/Character.java ! src/share/classes/java/lang/ClassLoader.java ! src/share/classes/java/lang/Double.java ! src/share/classes/java/lang/Float.java ! src/share/classes/java/lang/ProcessBuilder.java ! src/share/classes/java/lang/Runtime.java ! src/share/classes/java/lang/Thread.java ! src/share/classes/java/lang/ThreadLocal.java From iris.clark at oracle.com Thu Jul 4 03:32:51 2013 From: iris.clark at oracle.com (Iris Clark) Date: Wed, 3 Jul 2013 20:32:51 -0700 (PDT) Subject: Java 8 RFR 8019857: Fix doclint errors in java.util.Format* In-Reply-To: <9A7DE880-5213-4B31-8E7F-00C65C245C19@oracle.com> References: <9A7DE880-5213-4B31-8E7F-00C65C245C19@oracle.com> Message-ID: <4d9df7c1-5267-497e-93d2-fe58d6f15c48@default> Looks good to me. iris -----Original Message----- From: Brian Burkhalter Sent: Wednesday, July 03, 2013 1:02 PM To: Java Core Libs Subject: Java 8 RFR 8019857: Fix doclint errors in java.util.Format* Reviewers: For this issue http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8019857 (should be public "soon"). here is the proposed update http://cr.openjdk.java.net/~bpb/8019857/ Note that the diff starting at line 2593 is to correct a warning, not an error, and would require a CCC request (I think). Thanks, Brian From paul.sandoz at oracle.com Thu Jul 4 07:01:04 2013 From: paul.sandoz at oracle.com (Paul Sandoz) Date: Thu, 4 Jul 2013 09:01:04 +0200 Subject: RFR: 8017141: java.util/stream Spliterators from sequential sources should not catch OOME In-Reply-To: <51D4AB0E.8090501@oracle.com> References: <51D4AB0E.8090501@oracle.com> Message-ID: On Jul 4, 2013, at 12:51 AM, Henry Jen wrote: > Hi, > > Please review the webrev at > > http://cr.openjdk.java.net/~henryjen/tl/8017141.0/webrev/ > Note that the same change has already been fixed/pushed forrelevant implementations in j.u.c. This change in part of a wider change to fix rampant resource usage in some scenarios (other impl changes will follow from lambda to tl later on). Paul. From henry.jen at oracle.com Thu Jul 4 07:31:33 2013 From: henry.jen at oracle.com (Henry Jen) Date: Thu, 04 Jul 2013 00:31:33 -0700 Subject: RFR (2nd): 8015315: Stream.concat methods Message-ID: <51D524D5.4030404@oracle.com> Hi, I updated the test, and split the ConcatTest.java so we don't encounter the ClassNotFoundException issue on test-ng. Please review the webrev at http://cr.openjdk.java.net/~henryjen/ccc/8015315.1/webrev/ Cheers, Henry From paul.sandoz at oracle.com Thu Jul 4 07:46:39 2013 From: paul.sandoz at oracle.com (Paul Sandoz) Date: Thu, 4 Jul 2013 09:46:39 +0200 Subject: RFR (2nd): 8015315: Stream.concat methods In-Reply-To: <51D524D5.4030404@oracle.com> References: <51D524D5.4030404@oracle.com> Message-ID: On Jul 4, 2013, at 9:31 AM, Henry Jen wrote: > Hi, > > I updated the test, and split the ConcatTest.java so we don't encounter > the ClassNotFoundException issue on test-ng. > > Please review the webrev at > > http://cr.openjdk.java.net/~henryjen/ccc/8015315.1/webrev/ > Looks good. I would like to get this in quickly as it will unblock the F/J patch and others. I can push this for you. Peter's keen observation on Spliterator characteristics can be addressed as a separate issue. I think the remarks on should be also be treated as a separate discussion as it has wider implications. Paul. From huizhe.wang at oracle.com Thu Jul 4 09:11:22 2013 From: huizhe.wang at oracle.com (huizhe wang) Date: Thu, 04 Jul 2013 02:11:22 -0700 Subject: RFR: JAXP 1.5 for JDK8/7u40: 8016648: FEATURE_SECURE_PROCESSING set to true or false causes SAXParseException to be thrown In-Reply-To: <51D1DE7D.3030105@oracle.com> References: <51D13933.8090901@oracle.com> <51D1A3F2.2000707@oracle.com> <51D1CB94.90901@oracle.com> <51D1DE7D.3030105@oracle.com> Message-ID: <51D53C3A.6000708@oracle.com> On 7/1/2013 12:54 PM, Alan Bateman wrote: > On 01/07/2013 19:33, huizhe wang wrote: >> : >> >> I've updated the jaxp 1.5 tests. I'll send a separate link since it's >> internal. Indeed, I missed a couple of scenarios: 1) FSP can be set >> after jaxp 1.5 properties are set through the API; 2) Validator does >> not require, but does support FSP. > Given the number of parsers involved, the various ways to set > properties, the FSP hammer, security manager, ... then it's really > important that there is a good set of tests that exercise all the > combinations. So I encourage you to put in as much effort as it > required to get a good set of tests. It would be great to get them > into OpenJDK too, if that is possible. Daniel has helped adding many tests. The 1st one of the two scenarios above are tested. It appeared that the properties set through the factory or parser are always taken into account the last, therefore take preference in consistence with the spec. We still have the 2nd scenario to test. But here's the latest webrev: http://cr.openjdk.java.net/~joehw/jdk8/8016648/webrev/ It also uses the SourceVersion Joe suggested to determine the version of the JDK. -Joe > >>> >>> I think isJDKandAbove has the assume the long standing format for >>> java.version. If someone really did change the format to what you >>> are suggesting then the code would fail with a value such as "7.40". >> >> The code does support both the current and possible new format by >> comparing the 0 element, e.g. Integer.parseInt(versions[0]) >= >> compareTo. But I see Joe's comment provided a better way to handle >> this. >> > Okay, I'll wait for the second webrev to see how this looks. > > -Alan. > > From vicente.romero at oracle.com Thu Jul 4 09:36:38 2013 From: vicente.romero at oracle.com (vicente.romero at oracle.com) Date: Thu, 04 Jul 2013 09:36:38 +0000 Subject: hg: jdk8/tl/langtools: 8009924: some langtools tools do not accept -cp as an alias for -classpath Message-ID: <20130704093643.35F32487C1@hg.openjdk.java.net> Changeset: d6158f8d7235 Author: vromero Date: 2013-07-04 10:35 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/d6158f8d7235 8009924: some langtools tools do not accept -cp as an alias for -classpath Reviewed-by: jjg ! src/share/classes/com/sun/tools/doclets/internal/toolkit/Configuration.java ! src/share/classes/com/sun/tools/doclint/DocLint.java ! src/share/classes/com/sun/tools/doclint/resources/doclint.properties ! src/share/classes/com/sun/tools/javadoc/ToolOption.java ! src/share/classes/com/sun/tools/javadoc/resources/javadoc.properties ! src/share/classes/com/sun/tools/javah/JavahTask.java ! src/share/classes/com/sun/tools/javah/resources/l10n.properties ! src/share/classes/com/sun/tools/javap/JavapTask.java ! src/share/classes/com/sun/tools/javap/resources/javap.properties ! test/tools/doclint/tool/HelpTest.out From vicente.romero at oracle.com Thu Jul 4 09:43:43 2013 From: vicente.romero at oracle.com (vicente.romero at oracle.com) Date: Thu, 04 Jul 2013 09:43:43 +0000 Subject: hg: jdk8/tl/langtools: 6356530: -Xlint:serial does not flag abstract classes with concrete methods/members Message-ID: <20130704094348.55780487C2@hg.openjdk.java.net> Changeset: 79c3146e417b Author: vromero Date: 2013-07-04 10:41 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/79c3146e417b 6356530: -Xlint:serial does not flag abstract classes with concrete methods/members Reviewed-by: mcimadamore ! src/share/classes/com/sun/tools/javac/code/Scope.java ! src/share/classes/com/sun/tools/javac/comp/Attr.java + test/tools/javac/T6356530/SerializableAbstractClassWithNonAbstractMethodsTest.java + test/tools/javac/T6356530/SerializableAbstractClassWithNonAbstractMethodsTest.out From serguei.spitsyn at oracle.com Thu Jul 4 10:25:29 2013 From: serguei.spitsyn at oracle.com (serguei.spitsyn at oracle.com) Date: Thu, 04 Jul 2013 03:25:29 -0700 Subject: RFR - Changes to address CCC 8014135: Support for statically linked agents In-Reply-To: <51D494E9.2020200@oracle.com> References: <51D494E9.2020200@oracle.com> Message-ID: <51D54D99.8090103@oracle.com> Hi Bill, I've already had a chance to read your webrev several weeks ago, but need more time. Thanks, Serguei On 7/3/13 2:17 PM, BILL PITTORE wrote: > These changes address bug 8014135 which adds support for statically > linked agents in the VM. This is a followup to the recent JNI spec > changes that addressed statically linked JNI libraries( 8005716). > The JEP for this change is the same JEP as the JNI changes: > http://openjdk.java.net/jeps/178 > > Webrevs are here: > > http://cr.openjdk.java.net/~bpittore/8014135/jdk/webrev.00/ > http://cr.openjdk.java.net/~bpittore/8014135/hotspot/webrev.00/ > > The changes to jvmti.xml can also be seen in the output file that I > placed here: > http://cr.openjdk.java.net/~bpittore/8014135/hotspot/webrev.00/jvmti.html > > Thanks, > bill > > From Alan.Bateman at oracle.com Thu Jul 4 10:28:24 2013 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Thu, 04 Jul 2013 11:28:24 +0100 Subject: RFR: JAXP 1.5 for JDK8/7u40: 8016648: FEATURE_SECURE_PROCESSING set to true or false causes SAXParseException to be thrown In-Reply-To: <51D53C3A.6000708@oracle.com> References: <51D13933.8090901@oracle.com> <51D1A3F2.2000707@oracle.com> <51D1CB94.90901@oracle.com> <51D1DE7D.3030105@oracle.com> <51D53C3A.6000708@oracle.com> Message-ID: <51D54E48.6060503@oracle.com> On 04/07/2013 10:11, huizhe wang wrote: > > Daniel has helped adding many tests. The 1st one of the two scenarios > above are tested. It appeared that the properties set through the > factory or parser are always taken into account the last, therefore > take preference in consistence with the spec. We still have the 2nd > scenario to test. But here's the latest webrev: > > http://cr.openjdk.java.net/~joehw/jdk8/8016648/webrev/ > > It also uses the SourceVersion Joe suggested to determine the version > of the JDK. We can't have a dependency on SourceVersion here as it would cause problems for modules. I assume it will also break the profiles build because the javax.lang.model API is not in compact1 or compact2. So I think this need to be reverted to just look at the java.version property and I would suggest keeping it simple -- ie: assume the long standing format as that cannot be changed without causing wide-spread breakage. I skimmed over the rest of the webrev and don't see any other issues. It's great to hear that Daniel is helping to add tests as that is key to having confidence with these changes. -Alan. From scolebourne at joda.org Thu Jul 4 11:27:38 2013 From: scolebourne at joda.org (Stephen Colebourne) Date: Thu, 4 Jul 2013 12:27:38 +0100 Subject: Java 8 RFR 6480539: BigDecimal.stripTrailingZeros() has no effect on zero itself ("0.0") In-Reply-To: References: <51D460F3.5070103@oracle.com> Message-ID: Just to note that I am supportive of this bug fix (compared to the previous proposal) Stephen On 3 July 2013 19:09, Brian Burkhalter wrote: > On Jul 3, 2013, at 10:47 AM, Brian Burkhalter wrote: > >> I'll update this only to change the one public method and to modify its specification. > > I've updated the webrev > > http://cr.openjdk.java.net/~bpb/6480539/ > > and rerun JTREG as well as modifying and resubmitting the CCC request (it had been filed for the previous fix proposal). > > Thanks, > > Brian From rob.mckenna at oracle.com Thu Jul 4 13:41:28 2013 From: rob.mckenna at oracle.com (Rob McKenna) Date: Thu, 04 Jul 2013 14:41:28 +0100 Subject: Request for Review: 5049299: (process) Use posix_spawn, not fork, on S10 to avoid swap exhaustion In-Reply-To: <51D2F496.6050400@oracle.com> References: <50AE98B1.2040200@oracle.com> <50B81A8D.2040403@oracle.com> <50B82C94.90109@oracle.com> <50D277BE.8060705@oracle.com> <50D65C3F.2040004@oracle.com> <51D2F496.6050400@oracle.com> Message-ID: <51D57B88.3050707@oracle.com> Hi Alan, I've just uploaded the latest changes which rebase the fix to the current repo. (required post 8008118) I've also swapped out useFork for jdk.lang.Process.launchMechanism. (it affords us the flexibility to enable or disable other mechanisms on the various platforms at a later date) I have a couple of questions about this: 1) I'm thinking of including a unit test which will run through the various permutations across each platform making sure we fail when expected. 2) Should we simply ignore the flag on Windows or should we throw the same error if its provided? cc'ing Erik for a build review. http://cr.openjdk.java.net/~robm/5049299/webrev.04/ -Rob On 02/07/13 16:41, Alan Bateman wrote: > On 23/12/2012 01:19, Rob McKenna wrote: >> Hi Martin, thanks a lot for this. >> >> I've renamed LINKFLAG to the more appropriate (and common) ARCHFLAG. >> It seems to pop up all around our source but if build-dev know of a >> better (or canonical) way of doing it I'll take it! >> >> The BUILD_JEXEC differences don't show up in my webrev or hg diff, >> but I see them in the jdk.patch generated by webrev. I have no idea >> why this is. (I did use the JEXEC stuff as a template for the >> JSPAWNHELPER code, but I don't recall altering the JEXEC stuff in any >> way. It looks like its limited to indentation. Strange.) >> >> W.r.t. useFork, I'll discuss this with Alan once he has a spare >> minute. I believe he may have had some concerns, but I'll let you >> know how that goes either way. >> >> The only __APPLE__ should be to get the call to _NSGetEnviron(). >> Everything else should be bsd. >> >> I've put a webrev at: >> >> http://cr.openjdk.java.net/~robm/5049299/webrev.03/ >> >> >> I hope this addresses the rest of your comments. >> >> -Rob > Rob - this was great work but I don't think we brought it to a > conclusion. Are you planning to re-base the patch and send out a new > webrev? > > -Alan From Alan.Bateman at oracle.com Thu Jul 4 13:53:54 2013 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Thu, 04 Jul 2013 14:53:54 +0100 Subject: 8019622: (sl) ServiceLoadet.next incorrect when creation and usages are in different contexts In-Reply-To: <51D47D01.80201@oracle.com> References: <51D44E06.6030204@oracle.com> <51D45053.6030509@univ-mlv.fr> <51D458E7.7080107@oracle.com> <51D465C3.9080900@univ-mlv.fr> <51D47D01.80201@oracle.com> Message-ID: <51D57E72.9090308@oracle.com> On 03/07/2013 20:35, Alan Bateman wrote: > : > > That should fix it but I worry that this might be a bit brittle and > maybe there be other code paths that will trigger loading of providers > when building call sites that result in the same thing. It might be > safer for now to just use inner classes here. Mandy and I chatted again about this yesterday and concluded it would be the safest thing for now to just use inner classes here. It can be re-visited again later. -Alan From ivan.gerasimov at oracle.com Thu Jul 4 14:14:53 2013 From: ivan.gerasimov at oracle.com (Ivan Gerasimov) Date: Thu, 04 Jul 2013 18:14:53 +0400 Subject: RFR [8016838] java/lang/instrument/RedefineBigClass.sh needs modification In-Reply-To: <51D45B8C.7010109@oracle.com> References: <51D45B8C.7010109@oracle.com> Message-ID: <51D5835D.606@oracle.com> Hello again! > > We have a request to improve jtreg test. > The test had been written to verify fix for memory leak during class > redefinition. > The problem is that it always is reported as PASSED even in the > presence of the leak. > > The proposed change is platform specific. > It allows memory leak detection only on Linux. > This is because the memory leak was in native code, so there's no easy > way to detect it from within Java code. > > Here's the webrev for JDK8 repository: > http://cr.openjdk.java.net/~igerasim/8016838/0/webrev/ > > The surprising thing is that modified test detected the leak with the > latest JDK8! > Latest 6 and 7 are fine, so it might be regression in JDK8. > > I've filled a bug http://bugs.sun.com/view_bug.do?bug_id=8019845 > "Memory leak during class redefenition" (not yet available.) > As pointed out by Stefan Karlsson, the detected leak may not be related to the class redefinition and be related to [1] instead. However the webrev is still relevant, so welcome to review! [1] http://bugs.sun.com/view_bug.do?bug_id=8003419 > Sincerely yours, > Ivan Gerasimov > > From alan.bateman at oracle.com Thu Jul 4 13:56:02 2013 From: alan.bateman at oracle.com (alan.bateman at oracle.com) Date: Thu, 04 Jul 2013 13:56:02 +0000 Subject: hg: jdk8/tl/jdk: 8019622: (sl) ServiceLoader.next incorrect when creation and usages are in different contexts Message-ID: <20130704135636.738E3487CA@hg.openjdk.java.net> Changeset: dd69273a0240 Author: alanb Date: 2013-07-04 14:38 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/dd69273a0240 8019622: (sl) ServiceLoader.next incorrect when creation and usages are in different contexts Reviewed-by: mchung, ahgross, forax, psandoz ! src/share/classes/java/util/ServiceLoader.java From peter.levart at gmail.com Thu Jul 4 14:40:27 2013 From: peter.levart at gmail.com (Peter Levart) Date: Thu, 04 Jul 2013 16:40:27 +0200 Subject: 7122142 : (ann) Race condition between isAnnotationPresent and getAnnotations In-Reply-To: <51D43A72.8090508@oracle.com> References: <51C1BEC6.1080308@gmail.com> <51C1FE64.3020000@oracle.com> <51C88EBF.9020704@gmail.com> <51D43A72.8090508@oracle.com> Message-ID: <51D5895B.5020006@gmail.com> Hi Alan, Joel, Thanks to both for taking time to review the patch. Here's the 3rd revision: http://cr.openjdk.java.net/~plevart/jdk8-tl/AnnotationType/webrev.03/ Answers inline... On 07/03/2013 04:51 PM, Alan Bateman wrote: > Sorry for the delay getting back to you on this, I've been busy with > other things. Me too. > > I'm not an expert on the annotation code but the updated approach to > break the recursion looks good good to me (and a clever approach). > Joel has been on vacation but he told me that he plans to look at this > too (I'm happy to sponsor it in the mean-time as I think the approach > is good and we should get this fix in). > > There's another usage of AnnotationParser.parseAnnotation in > TypeAnnotationParser that will need to be updated (I only noticed it > when I grabbed your patch to try it). I rather restored the package-private API so that TypeAnnotationParser doesn't have to be changed. It also makes for less changes in internal AnnotationParser code. > > A minor comment is that the alignment of the parameter declarations > when they go over multiple lines should probably be fixed up to be > consistent with the other usages. I tailored new method to be consistent with the alignment of the other public method. There are 4 different multi-line-parameter alignments used in AnnotationParser though. I also renamed new method to "parseSelectAnnotations" and made it package-private, since it is only used from the AnnotationType. > > Thanks for adding tests. One comment on AnnotationTypeDeadlockTest is > that the join(500) might not be sufficient on a very busy system (say > when running tests concurrently) or on a low-end embedded system. So I > think it would be good to bump this up x10. Done. > An alternative would be to not set the daemon status and just let the > test timeout if there is a deadlock. The spin-waits can consume cycles > when running tests concurrently but I don't expect it's an issue here. Right, There can be a substantial delay from Thread.start() to thread actually executing it's run() method. So I added another synchronization latch that makes main thread park and wait until both new threads start-up. Both new threads then spin-wait until main thread wakes up and resets the AtomicInteger value. Experimenting on my Intel i7 box shows that one new thread spins about 80x and the other about 3000x before continuing. This spin-waiting is necessary so that both threads continue coherently and have a better chance to provoke deadlock. > > A typo in the @summary of AnnotationTypeRuntimeAssumptionTest ("si" -> > "is"). I guess I'd go for slightly shorter lines to make future > side-by-side reviews easier. Corrected. On 07/03/2013 07:09 PM, Joel Borggr?n-Franck wrote: > Hi Peter, > > As Alan said, a big thanks for looking into this. > > I have been toying with a slightly different approach to breaking the infinite recursion by pre-construct AnnotationType instances for Retention and Inherited. While cleaner in some places others became uglier. I'm fine with this approach. I'm interested in your approach. How do you handle construction of AnnotationType instances for other annotations apart from @Retention and @Inherited? What if there are two mutually recursive annotations like: @Retention(RUNTIME) @AnnB public @interface AnnA { } @Retention(RUNTIME) @AnnA public @interface AnnB { } How do you construct the AnnotationType instance for any one of the above annotations and break recursion? > As Alan said, you need to update the patch with a modification in TypeAnnotationParser. After doing that all java/lang tests in the jdk/test directory passes. I missed that, yes. I changed the patch so that no changes are needed now. > Also, can you please explain to me why the update race is safe. I have done the/some research myself but I would like to know which angles you have covered. Well, one thing is that AnnotationType class is now effectively final, meaning that all it's state is referenced using final fields. If a reference to an instance of such class is obtained via data-race, all it's state is observed consistent by the thread that obtained the reference. The other thing is racy caching. If two or more threads are concurrently requesting AnnotationType for the same Class, many of them might construct and use it's own instance and the one published "latest" will finally be the one being cached. Since all such AnnotationType instances are constructed from the same input data, they are equivalent and it doesn't matter which one is used by which thread. There is a caveat though. What if class is redefined? That's a separate issue and will have to be resolved in a separate patch. I'm planing to prepare a patch after this one gets through. The patch will remove contention from caching of annotations and may also take care of AnnotationType caching at the same time. Regards, Peter > Given that and that you fix Alan's comments I think this is good to go. > > Thanks again! > > cheers > /Joel > From fweimer at redhat.com Thu Jul 4 14:44:16 2013 From: fweimer at redhat.com (Florian Weimer) Date: Thu, 04 Jul 2013 16:44:16 +0200 Subject: Prevent privilege escalation through AccessController.doPrivileged() Message-ID: <51D58A40.8080501@redhat.com> Is there a way to prevent future calls to AccessController.doPrivileged() from the same thread from actually increasing privilege? I'm specifically concerned about code whose calls would otherwise succeed because the containing class has the required permissions. Reducing these privileges with a separate class loader seems to be the official way to achieve that. Is there a way to get there without defining and installing your own (global) security manager. It would be a nice feature if we could easily run code with reduced privileges. -- Florian Weimer / Red Hat Product Security Team From daniel.daugherty at oracle.com Thu Jul 4 15:34:05 2013 From: daniel.daugherty at oracle.com (Daniel D. Daugherty) Date: Thu, 04 Jul 2013 09:34:05 -0600 Subject: RFR [8016838] java/lang/instrument/RedefineBigClass.sh needs modification In-Reply-To: <51D45B8C.7010109@oracle.com> References: <51D45B8C.7010109@oracle.com> Message-ID: <51D595ED.7050902@oracle.com> On 7/3/13 11:12 AM, Ivan Gerasimov wrote: > Hello everybody! > > We have a request to improve jtreg test. > The test had been written to verify fix for memory leak during class > redefinition. > The problem is that it always is reported as PASSED even in the > presence of the leak. > > The proposed change is platform specific. > It allows memory leak detection only on Linux. > This is because the memory leak was in native code, so there's no easy > way to detect it from within Java code. > > Here's the webrev for JDK8 repository: > http://cr.openjdk.java.net/~igerasim/8016838/0/webrev/ Very nicely done! The logic in RedefineBigClass.sh only catches a leak big enough to cause an Exception to be thrown. When I originally wrote this test and its companion: test/java/lang/instrument/RetransformBigClass* I could not come up with a platform independent way to put a small upper limit on memory growth. It never dawned on me that putting in something on one platform (Linux) was better than nothing. Are you planning to add this same logic to RetransformBigClass*? test/java/lang/instrument/RedefineBigClass.sh No comments. test/java/lang/instrument/RedefineBigClassApp.java line 48: final long MEM_LEAK_THRESHOLD = 32 * 1024; // 32Mb Would be better at the top of RedefineBigClassApp rather than "buried" down here. line 51: Long.valueOf(vmMemDelta) There are several places where a long is passed to Long.valueOf(). Is there some reason you're not passing them directly to println()? line 54: } else { The "else" is redundant due to the "System.exit(1)" call above it. You can drop the "else {" and "}" and shift that last println() to the left. line 71: return Long.parseLong(line.split(" ")[22]) / 1024; How about at least a comment referring to the Linux proc(5) man page... and the fact that the 23rd field is: vsize %lu Virtual memory size in bytes. Again, very nicely done! Dan > > The surprising thing is that modified test detected the leak with the > latest JDK8! > Latest 6 and 7 are fine, so it might be regression in JDK8. > > I've filled a bug http://bugs.sun.com/view_bug.do?bug_id=8019845 > "Memory leak during class redefenition" (not yet available.) > > Sincerely yours, > Ivan Gerasimov > > > From Alan.Bateman at oracle.com Thu Jul 4 16:41:49 2013 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Thu, 04 Jul 2013 17:41:49 +0100 Subject: RFR - Changes to address CCC 8014135: Support for statically linked agents In-Reply-To: <51D494E9.2020200@oracle.com> References: <51D494E9.2020200@oracle.com> Message-ID: <51D5A5CD.2070805@oracle.com> On 03/07/2013 22:17, BILL PITTORE wrote: > These changes address bug 8014135 which adds support for statically > linked agents in the VM. This is a followup to the recent JNI spec > changes that addressed statically linked JNI libraries( 8005716). > The JEP for this change is the same JEP as the JNI changes: > http://openjdk.java.net/jeps/178 > > Webrevs are here: > > http://cr.openjdk.java.net/~bpittore/8014135/jdk/webrev.00/ I looked at the javadoc updates to the attach API. One thing that doesn't come across very clearly is the mapping from the agentLibrary parameter to "agent-lib-name". I think that needs a few words so that it's clear that it is not literally looking for "Agent_OnAttach_agent-lib-name" but rather "Agent_OnAttach" + where is the library name in the agentLibrary parameter. As I recall, the JVM Tool Interface is supposed to be referred so as "JVM TI" rather than "JVMTI". Otherwise it looks okay to me. -Alan From tom.hawtin at oracle.com Thu Jul 4 17:04:36 2013 From: tom.hawtin at oracle.com (Tom Hawtin) Date: Thu, 04 Jul 2013 18:04:36 +0100 Subject: Prevent privilege escalation through AccessController.doPrivileged() In-Reply-To: <51D58A40.8080501@redhat.com> References: <51D58A40.8080501@redhat.com> Message-ID: <51D5AB24.1000901@oracle.com> On 04/07/2013 15:44, Florian Weimer wrote: > Is there a way to prevent future calls to > AccessController.doPrivileged() from the same thread from actually > increasing privilege? No. If the code has the relevant permissions it can call doPrivileged together with the 1.0/1.1 legacy and new caller-sensitive methods. If doPrivileged were blocked, things like class loading would break. And wouldn't work for untrusted code as it could find some other thread to run on (because of all the global state hanging around). > Reducing these privileges with a separate class loader seems to be the > official way to achieve that. Is there a way to get there without > defining and installing your own (global) security manager. Close. ProtectionDomain is the way to assign permission to code (optionally, since 1.4, through Policy). Typically you would need also to use a separate class loader if instead of attempting "least privilege" you really didn't trust the code (see, for instance, the "mixed-code fix" which uses a pair of class loader for a single applet context). You shouldn't need to use a custom security manager. Tom From ivan.gerasimov at oracle.com Thu Jul 4 17:19:50 2013 From: ivan.gerasimov at oracle.com (Ivan Gerasimov) Date: Thu, 04 Jul 2013 21:19:50 +0400 Subject: RFR [8016838] java/lang/instrument/RedefineBigClass.sh needs modification In-Reply-To: <51D595ED.7050902@oracle.com> References: <51D45B8C.7010109@oracle.com> <51D595ED.7050902@oracle.com> Message-ID: <51D5AEB6.3060608@oracle.com> Daniel, thank you for review! Here's the updated with all all your suggestions adopted. http://cr.openjdk.java.net/~igerasim/8016838/1/webrev/ I haven't yet considered applying the approach to RetransformBigClass. Do you want me to include this into this same change set or should I make it separately? Sincerely yours, Ivan On 04.07.2013 19:34, Daniel D. Daugherty wrote: > On 7/3/13 11:12 AM, Ivan Gerasimov wrote: >> Hello everybody! >> >> We have a request to improve jtreg test. >> The test had been written to verify fix for memory leak during class >> redefinition. >> The problem is that it always is reported as PASSED even in the >> presence of the leak. >> >> The proposed change is platform specific. >> It allows memory leak detection only on Linux. >> This is because the memory leak was in native code, so there's no >> easy way to detect it from within Java code. >> >> Here's the webrev for JDK8 repository: >> http://cr.openjdk.java.net/~igerasim/8016838/0/webrev/ > > Very nicely done! The logic in RedefineBigClass.sh only catches a > leak big enough to cause an Exception to be thrown. > > When I originally wrote this test and its companion: > > test/java/lang/instrument/RetransformBigClass* > > I could not come up with a platform independent way to put a small > upper limit on memory growth. It never dawned on me that putting in > something on one platform (Linux) was better than nothing. > > Are you planning to add this same logic to RetransformBigClass*? > > > > test/java/lang/instrument/RedefineBigClass.sh > No comments. > > test/java/lang/instrument/RedefineBigClassApp.java > line 48: final long MEM_LEAK_THRESHOLD = 32 * 1024; // 32Mb > Would be better at the top of RedefineBigClassApp rather than > "buried" down here. > > line 51: Long.valueOf(vmMemDelta) > There are several places where a long is passed to > Long.valueOf(). > Is there some reason you're not passing them directly to > println()? > > line 54: } else { > The "else" is redundant due to the "System.exit(1)" call above > it. > You can drop the "else {" and "}" and shift that last > println() to > the left. > > line 71: return Long.parseLong(line.split(" ")[22]) / 1024; > How about at least a comment referring to the Linux proc(5) > man page... and the fact that the 23rd field is: > > vsize %lu Virtual memory size in bytes. > > Again, very nicely done! > > Dan > > >> >> The surprising thing is that modified test detected the leak with the >> latest JDK8! >> Latest 6 and 7 are fine, so it might be regression in JDK8. >> >> I've filled a bug http://bugs.sun.com/view_bug.do?bug_id=8019845 >> "Memory leak during class redefenition" (not yet available.) >> >> Sincerely yours, >> Ivan Gerasimov >> >> >> > > > From joel.franck at oracle.com Thu Jul 4 17:34:02 2013 From: joel.franck at oracle.com (=?iso-8859-1?Q?Joel_Borggr=E9n-Franck?=) Date: Thu, 4 Jul 2013 19:34:02 +0200 Subject: 7122142 : (ann) Race condition between isAnnotationPresent and getAnnotations In-Reply-To: <51D5895B.5020006@gmail.com> References: <51C1BEC6.1080308@gmail.com> <51C1FE64.3020000@oracle.com> <51C88EBF.9020704@gmail.com> <51D43A72.8090508@oracle.com> <51D5895B.5020006@gmail.com> Message-ID: Hi Peter, On 4 jul 2013, at 16:40, Peter Levart wrote: > Answers inline... >> >> There's another usage of AnnotationParser.parseAnnotation in TypeAnnotationParser that will need to be updated (I only noticed it when I grabbed your patch to try it). > > I rather restored the package-private API so that TypeAnnotationParser doesn't have to be changed. It also makes for less changes in internal AnnotationParser code. > I agree. > > I'm interested in your approach. How do you handle construction of AnnotationType instances for other annotations apart from @Retention and @Inherited? What if there are two mutually recursive annotations like: > > > @Retention(RUNTIME) > @AnnB > public @interface AnnA { > } > > @Retention(RUNTIME) > @AnnA > public @interface AnnB { > } > > How do you construct the AnnotationType instance for any one of the above annotations and break recursion? > To be honest, I didn't get that far before it became clear to me that the approach wouldn't be preferable to this one. I needed to break that recursion somehow and that turned out to become something like parseSelectedAnnotations(...) anyway so I just put the idea aside. >> Also, can you please explain to me why the update race is safe. I have done the/some research myself but I would like to know which angles you have covered. > > Well, one thing is that AnnotationType class is now effectively final, meaning that all it's state is referenced using final fields. If a reference to an instance of such class is obtained via data-race, all it's state is observed consistent by the thread that obtained the reference. The other thing is racy caching. If two or more threads are concurrently requesting AnnotationType for the same Class, many of them might construct and use it's own instance and the one published "latest" will finally be the one being cached. Since all such AnnotationType instances are constructed from the same input data, they are equivalent and it doesn't matter which one is used by which thread. > Actually they aren't, something have been bugging me and I finally figured it out today. The problem is with default valued elements. Previously all threads have been seeing the same instance of default values but now that will only be guaranteed for Classes, Strings and Integers inside the value cache. While I don't think it is in the spec that annotation default value instances should be == for all threads I don't think it is a race we should introduce. Given this I think you should use some approach to produce a winner that every thread will use (like in the other annotations patch). My gut feeling is that CASing in a result will be better under contention that the current lock solution (while also correct and deadlock free) for a net win. > There is a caveat though. What if class is redefined? That's a separate issue and will have to be resolved in a separate patch. I'm planing to prepare a patch after this one gets through. The patch will remove contention from caching of annotations and may also take care of AnnotationType caching at the same time. I can't imagine this solution being more broken that the current situation :) or? cheers /Joel From daniel.daugherty at oracle.com Thu Jul 4 17:45:41 2013 From: daniel.daugherty at oracle.com (Daniel D. Daugherty) Date: Thu, 04 Jul 2013 11:45:41 -0600 Subject: RFR [8016838] java/lang/instrument/RedefineBigClass.sh needs modification In-Reply-To: <51D5AEB6.3060608@oracle.com> References: <51D45B8C.7010109@oracle.com> <51D595ED.7050902@oracle.com> <51D5AEB6.3060608@oracle.com> Message-ID: <51D5B4C5.7060402@oracle.com> On 7/4/13 11:19 AM, Ivan Gerasimov wrote: > Daniel, thank you for review! > > Here's the updated with all all your suggestions adopted. > http://cr.openjdk.java.net/~igerasim/8016838/1/webrev/ Looks good. > > I haven't yet considered applying the approach to RetransformBigClass. > Do you want me to include this into this same change set or should I > make it separately? I would include it in the same changeset. Dan > > Sincerely yours, > Ivan > > > On 04.07.2013 19:34, Daniel D. Daugherty wrote: >> On 7/3/13 11:12 AM, Ivan Gerasimov wrote: >>> Hello everybody! >>> >>> We have a request to improve jtreg test. >>> The test had been written to verify fix for memory leak during class >>> redefinition. >>> The problem is that it always is reported as PASSED even in the >>> presence of the leak. >>> >>> The proposed change is platform specific. >>> It allows memory leak detection only on Linux. >>> This is because the memory leak was in native code, so there's no >>> easy way to detect it from within Java code. >>> >>> Here's the webrev for JDK8 repository: >>> http://cr.openjdk.java.net/~igerasim/8016838/0/webrev/ >> >> Very nicely done! The logic in RedefineBigClass.sh only catches a >> leak big enough to cause an Exception to be thrown. >> >> When I originally wrote this test and its companion: >> >> test/java/lang/instrument/RetransformBigClass* >> >> I could not come up with a platform independent way to put a small >> upper limit on memory growth. It never dawned on me that putting in >> something on one platform (Linux) was better than nothing. >> >> Are you planning to add this same logic to RetransformBigClass*? >> >> >> >> test/java/lang/instrument/RedefineBigClass.sh >> No comments. >> >> test/java/lang/instrument/RedefineBigClassApp.java >> line 48: final long MEM_LEAK_THRESHOLD = 32 * 1024; // 32Mb >> Would be better at the top of RedefineBigClassApp rather than >> "buried" down here. >> >> line 51: Long.valueOf(vmMemDelta) >> There are several places where a long is passed to >> Long.valueOf(). >> Is there some reason you're not passing them directly to >> println()? >> >> line 54: } else { >> The "else" is redundant due to the "System.exit(1)" call >> above it. >> You can drop the "else {" and "}" and shift that last >> println() to >> the left. >> >> line 71: return Long.parseLong(line.split(" ")[22]) / 1024; >> How about at least a comment referring to the Linux proc(5) >> man page... and the fact that the 23rd field is: >> >> vsize %lu Virtual memory size in bytes. >> >> Again, very nicely done! >> >> Dan >> >> >>> >>> The surprising thing is that modified test detected the leak with >>> the latest JDK8! >>> Latest 6 and 7 are fine, so it might be regression in JDK8. >>> >>> I've filled a bug http://bugs.sun.com/view_bug.do?bug_id=8019845 >>> "Memory leak during class redefenition" (not yet available.) >>> >>> Sincerely yours, >>> Ivan Gerasimov >>> >>> >>> >> >> >> > From peter.levart at gmail.com Thu Jul 4 17:46:16 2013 From: peter.levart at gmail.com (Peter Levart) Date: Thu, 04 Jul 2013 19:46:16 +0200 Subject: 7122142 : (ann) Race condition between isAnnotationPresent and getAnnotations In-Reply-To: References: <51C1BEC6.1080308@gmail.com> <51C1FE64.3020000@oracle.com> <51C88EBF.9020704@gmail.com> <51D43A72.8090508@oracle.com> <51D5895B.5020006@gmail.com> Message-ID: <51D5B4E8.6070807@gmail.com> On 07/04/2013 07:34 PM, Joel Borggr?n-Franck wrote: >>> >>Also, can you please explain to me why the update race is safe. I have done the/some research myself but I would like to know which angles you have covered. >> > >> >Well, one thing is that AnnotationType class is now effectively final, meaning that all it's state is referenced using final fields. If a reference to an instance of such class is obtained via data-race, all it's state is observed consistent by the thread that obtained the reference. The other thing is racy caching. If two or more threads are concurrently requesting AnnotationType for the same Class, many of them might construct and use it's own instance and the one published "latest" will finally be the one being cached. Since all such AnnotationType instances are constructed from the same input data, they are equivalent and it doesn't matter which one is used by which thread. >> > > Actually they aren't, something have been bugging me and I finally figured it out today. The problem is with default valued elements. Previously all threads have been seeing the same instance of default values but now that will only be guaranteed for Classes, Strings and Integers inside the value cache. While I don't think it is in the spec that annotation default value instances should be == for all threads I don't think it is a race we should introduce. Given this I think you should use some approach to produce a winner that every thread will use (like in the other annotations patch). My gut feeling is that CASing in a result will be better under contention that the current lock solution (while also correct and deadlock free) for a net win. Well Joel, you have a point. I'll introduce volatile read and CAS... >> >There is a caveat though. What if class is redefined? That's a separate issue and will have to be resolved in a separate patch. I'm planing to prepare a patch after this one gets through. The patch will remove contention from caching of annotations and may also take care of AnnotationType caching at the same time. > I can't imagine this solution being more broken that the current situation:) or? No, It is broken more or less to the same extent. If class is redefined, old AnnotationType remains cached. It's not trivial to fix that. Imagine all the annotation instances that cache default values taken out of annotation type at their initialization, etc... Regards, Peter > cheers > /Joel From Alan.Bateman at oracle.com Thu Jul 4 18:43:50 2013 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Thu, 04 Jul 2013 19:43:50 +0100 Subject: Request for Review: 5049299: (process) Use posix_spawn, not fork, on S10 to avoid swap exhaustion In-Reply-To: <51D57B88.3050707@oracle.com> References: <50AE98B1.2040200@oracle.com> <50B81A8D.2040403@oracle.com> <50B82C94.90109@oracle.com> <50D277BE.8060705@oracle.com> <50D65C3F.2040004@oracle.com> <51D2F496.6050400@oracle.com> <51D57B88.3050707@oracle.com> Message-ID: <51D5C266.7000807@oracle.com> On 04/07/2013 14:41, Rob McKenna wrote: > Hi Alan, > > I've just uploaded the latest changes which rebase the fix to the > current repo. Thank you (as you know I've been wanting us to move to posix_spawn on Mac and Solaris for a long time). > (required post 8008118) I've also swapped out useFork for > jdk.lang.Process.launchMechanism. (it affords us the flexibility to > enable or disable other mechanisms on the various platforms at a later > date) The property name is good and given the potential for land mines then it's good to have a means to switch back. In time of course then maybe some of the old code can be removed. Personally I would go for the lower cases values. One idea is that as LaunchMechanism is platform specific then you could just get it to define the constants that it supports and then use valueOf on the property value to to do lookup. > I have a couple of questions about this: > > 1) I'm thinking of including a unit test which will run through the > various permutations across each platform making sure we fail when > expected. That would be good, it could call Martin's Basic test as that exercises this code very well. > > 2) Should we simply ignore the flag on Windows or should we throw the > same error if its provided? I think it should be fine to ignore it, the property is meaningless on Windows at this time. > > cc'ing Erik for a build review. > > http://cr.openjdk.java.net/~robm/5049299/webrev.04/ I haven't done a detailed review yet but from a quick glance then you have cleaned up several things since the last round. Also, from what I can see then the trampoline (jspawnhelper) goes into the lib directory on Mac and lib/ on Solaris which seems right (or at least consistent for those platforms). -Alan. From Alan.Bateman at oracle.com Thu Jul 4 19:06:04 2013 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Thu, 04 Jul 2013 20:06:04 +0100 Subject: RFR (2nd): 8017231: Add StringJoiner.merge In-Reply-To: References: <51D47F7E.4080600@oracle.com> <51D48B32.6020508@oracle.com> Message-ID: <51D5C79C.2040606@oracle.com> On 03/07/2013 22:10, Henry Jen wrote: > Yes, when I looked at it, there are other places as well. But I decided to leave those alone as for delimiter/prefix/suffix, 'supplied' seems to be fine and consistent. > > add() is perhaps a good change. I updated the webrev with this simple change, then I'll need a sponsor to push for me. > Okay, I can push this for you. There isn't a change-set linked from the webrev so I'll take the patch file and attribution line from the webrev. -Alan. From alan.bateman at oracle.com Thu Jul 4 19:07:10 2013 From: alan.bateman at oracle.com (alan.bateman at oracle.com) Date: Thu, 04 Jul 2013 19:07:10 +0000 Subject: hg: jdk8/tl/jdk: 8017231: Add StringJoiner.merge Message-ID: <20130704190737.15232487DD@hg.openjdk.java.net> Changeset: aa9fefb5d9c4 Author: alanb Date: 2013-07-04 20:00 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/aa9fefb5d9c4 8017231: Add StringJoiner.merge Reviewed-by: psandoz, alanb Contributed-by: brian.goetz at oracle.com, henry.jen at oracle.com ! src/share/classes/java/util/StringJoiner.java + test/java/util/StringJoiner/MergeTest.java ! test/java/util/StringJoiner/StringJoinerTest.java From huizhe.wang at oracle.com Thu Jul 4 20:25:39 2013 From: huizhe.wang at oracle.com (huizhe wang) Date: Thu, 04 Jul 2013 13:25:39 -0700 Subject: RFR: JAXP 1.5 for JDK8/7u40: 8016648: FEATURE_SECURE_PROCESSING set to true or false causes SAXParseException to be thrown In-Reply-To: <51D54E48.6060503@oracle.com> References: <51D13933.8090901@oracle.com> <51D1A3F2.2000707@oracle.com> <51D1CB94.90901@oracle.com> <51D1DE7D.3030105@oracle.com> <51D53C3A.6000708@oracle.com> <51D54E48.6060503@oracle.com> Message-ID: <51D5DA43.3050404@oracle.com> On 7/4/2013 3:28 AM, Alan Bateman wrote: > On 04/07/2013 10:11, huizhe wang wrote: >> >> Daniel has helped adding many tests. The 1st one of the two scenarios >> above are tested. It appeared that the properties set through the >> factory or parser are always taken into account the last, therefore >> take preference in consistence with the spec. We still have the 2nd >> scenario to test. But here's the latest webrev: >> >> http://cr.openjdk.java.net/~joehw/jdk8/8016648/webrev/ >> >> It also uses the SourceVersion Joe suggested to determine the version >> of the JDK. > > We can't have a dependency on SourceVersion here as it would cause > problems for modules. I assume it will also break the profiles build > because the javax.lang.model API is not in compact1 or compact2. So I > think this need to be reverted to just look at the java.version > property and I would suggest keeping it simple -- ie: assume the long > standing format as that cannot be changed without causing wide-spread > breakage. Reverted back to the original code: http://cr.openjdk.java.net/~joehw/jdk8/8016648/webrev/ The code split the version number and look at the 1st or 2nd element, it thus works for both the current format and the proposed one, e.g. for 1.7.0, it compares with the 2nd element, and for the proposed MAJOR.MINOR.FU.*, the 1st or MAJOR. > > I skimmed over the rest of the webrev and don't see any other issues. > It's great to hear that Daniel is helping to add tests as that is key > to having confidence with these changes. The last scenario to work on is if FSP is set on the Validator instead of SchemaFactory. With that, I'm looking at refactoring the way properties are represented so that they carry state. It would then be cleaner to pass them from SchemaFactory over to Schema and then Validator. It's a bit of work. Fortunately, we only have three of them to deal with. -Joe > > -Alan. > From david.holmes at oracle.com Thu Jul 4 23:22:37 2013 From: david.holmes at oracle.com (David Holmes) Date: Fri, 05 Jul 2013 09:22:37 +1000 Subject: RFR: 8016341 java/lang/ref/OOMEInReferenceHandler.java failing intermittently In-Reply-To: <51D27F05.5020201@gmail.com> References: <51D25932.7040303@oracle.com> <51D27F05.5020201@gmail.com> Message-ID: <51D603BD.9050708@oracle.com> Hi Peter, On 2/07/2013 5:19 PM, Peter Levart wrote: > Looking at original code once again, I think this was actually a bug. > The WeakReference instance constructed in (old) line 82, can be GCed > right away, since nobody is using the local variable after assignment. Of course. Doh! I was to busy thinking about the lifetime of the referent object to consider the reference itself. > If WeakReference is GCed it can not be enqueued. The promotion of local > variable into a field is one way to fix this. The other would be to use > the local variable somewhere down the code path, like for example in a > final throw statement: > > 110 throw new IllegalStateException("Reference Handler thread > stuck. weakRef.get(): " + weakRef.get()); > > > This would also reveal some more info about the WeakReference when > there's no sure answer after 10 seconds and could be added to the test > anyway. Okay I've modified the test as suggested. Updated webrev at same location: http://cr.openjdk.java.net/~dholmes/8016341/webrev/ In testing it though I simply exposed the remaining flaws in the ReferenceHandler code. We can still kill the ReferenceHandler thread with an OOME when it tries to load the Cleaner class (running with a 5M heap triggers this nicely if you use G1): // Fast path for cleaners if (r instanceof Cleaner) { ((Cleaner)r).clean(); continue; } and if that passes the clean() might throw OOME (it internally tries to do a System.exit if an exception occurs but will likely encounter another OOME trying to create the PrivilegedAction). Even the: ReferenceQueue q = r.queue; if (q != ReferenceQueue.NULL) q.enqueue(r); might throw OOME because enqueue() might have to load the FinalReference class. So really catching the OOME around the wait() only patches a small hole. We can't simply put a try/catch in the for(;;) loop because that doesn't address the problem that if the class loading throws OOME then subsequent attempts to load that class will also fail. We would have to preload all possible classes. Even then we might just send the ReferenceHandler thread into a busy loop of throwing OOME catching it and retrying! So I can fix the test to deal with the Xcomp issue but we may still see intermittent failures, and the ReferenceHandler thread may still die from OOME. David ----- > > Regards, Peter > > On 07/02/2013 06:38 AM, David Holmes wrote: >> This recently added test was found to fail under some conditions - >> namely client compiler with -Xcomp. It seems that the use of all local >> variables enabled the compiler to optimize things in a way that >> stopped the weakref from being enqueued as expected. Simple fix was to >> make the weakref a field. >> >> http://cr.openjdk.java.net/~dholmes/8016341/webrev/ >> >> Thanks, >> David > From ivan.gerasimov at oracle.com Fri Jul 5 00:59:18 2013 From: ivan.gerasimov at oracle.com (Ivan Gerasimov) Date: Fri, 05 Jul 2013 04:59:18 +0400 Subject: RFR [8016838] java/lang/instrument/RedefineBigClass.sh needs modification In-Reply-To: <51D5B4C5.7060402@oracle.com> References: <51D45B8C.7010109@oracle.com> <51D595ED.7050902@oracle.com> <51D5AEB6.3060608@oracle.com> <51D5B4C5.7060402@oracle.com> Message-ID: <51D61A66.5010001@oracle.com> Thank you, Daniel! Please find an updated webrev at http://cr.openjdk.java.net/~igerasim/8016838/2/webrev/. It now includes the RetransformBigClass test modified in the same way as RedefineBigClass. If the changes look fine, may I ask you to sponsor the commit, as I'm not a committer? Here's a link to hg export: http://cr.openjdk.java.net/~igerasim/2commit/8016838-jdk8-ReBigClass-improved.patch Thanks in advance, Ivan On 04.07.2013 21:45, Daniel D. Daugherty wrote: > On 7/4/13 11:19 AM, Ivan Gerasimov wrote: >> Daniel, thank you for review! >> >> Here's the updated with all all your suggestions adopted. >> http://cr.openjdk.java.net/~igerasim/8016838/1/webrev/ > > Looks good. > > >> >> I haven't yet considered applying the approach to RetransformBigClass. >> Do you want me to include this into this same change set or should I >> make it separately? > > I would include it in the same changeset. > > Dan > > >> >> Sincerely yours, >> Ivan >> >> >> On 04.07.2013 19:34, Daniel D. Daugherty wrote: >>> On 7/3/13 11:12 AM, Ivan Gerasimov wrote: >>>> Hello everybody! >>>> >>>> We have a request to improve jtreg test. >>>> The test had been written to verify fix for memory leak during >>>> class redefinition. >>>> The problem is that it always is reported as PASSED even in the >>>> presence of the leak. >>>> >>>> The proposed change is platform specific. >>>> It allows memory leak detection only on Linux. >>>> This is because the memory leak was in native code, so there's no >>>> easy way to detect it from within Java code. >>>> >>>> Here's the webrev for JDK8 repository: >>>> http://cr.openjdk.java.net/~igerasim/8016838/0/webrev/ >>> >>> Very nicely done! The logic in RedefineBigClass.sh only catches a >>> leak big enough to cause an Exception to be thrown. >>> >>> When I originally wrote this test and its companion: >>> >>> test/java/lang/instrument/RetransformBigClass* >>> >>> I could not come up with a platform independent way to put a small >>> upper limit on memory growth. It never dawned on me that putting in >>> something on one platform (Linux) was better than nothing. >>> >>> Are you planning to add this same logic to RetransformBigClass*? >>> >>> >>> >>> test/java/lang/instrument/RedefineBigClass.sh >>> No comments. >>> >>> test/java/lang/instrument/RedefineBigClassApp.java >>> line 48: final long MEM_LEAK_THRESHOLD = 32 * 1024; // 32Mb >>> Would be better at the top of RedefineBigClassApp rather than >>> "buried" down here. >>> >>> line 51: Long.valueOf(vmMemDelta) >>> There are several places where a long is passed to >>> Long.valueOf(). >>> Is there some reason you're not passing them directly to >>> println()? >>> >>> line 54: } else { >>> The "else" is redundant due to the "System.exit(1)" call >>> above it. >>> You can drop the "else {" and "}" and shift that last >>> println() to >>> the left. >>> >>> line 71: return Long.parseLong(line.split(" ")[22]) / 1024; >>> How about at least a comment referring to the Linux proc(5) >>> man page... and the fact that the 23rd field is: >>> >>> vsize %lu Virtual memory size in bytes. >>> >>> Again, very nicely done! >>> >>> Dan >>> >>> >>>> >>>> The surprising thing is that modified test detected the leak with >>>> the latest JDK8! >>>> Latest 6 and 7 are fine, so it might be regression in JDK8. >>>> >>>> I've filled a bug http://bugs.sun.com/view_bug.do?bug_id=8019845 >>>> "Memory leak during class redefenition" (not yet available.) >>>> >>>> Sincerely yours, >>>> Ivan Gerasimov >>>> >>>> >>>> >>> >>> >>> >> > > > From luchsh at linux.vnet.ibm.com Fri Jul 5 02:53:29 2013 From: luchsh at linux.vnet.ibm.com (luchsh at linux.vnet.ibm.com) Date: Fri, 05 Jul 2013 02:53:29 +0000 Subject: hg: jdk8/tl/jdk: 8019381: HashMap.isEmpty is non-final, potential issues for get/remove Message-ID: <20130705025350.81E7F487E6@hg.openjdk.java.net> Changeset: ed111451b77a Author: zhangshj Date: 2013-07-05 10:51 +0800 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/ed111451b77a 8019381: HashMap.isEmpty is non-final, potential issues for get/remove Reviewed-by: chegar, mduigou ! src/share/classes/java/util/HashMap.java + test/java/util/HashMap/OverrideIsEmpty.java From luchsh at linux.vnet.ibm.com Fri Jul 5 02:58:06 2013 From: luchsh at linux.vnet.ibm.com (Jonathan Lu) Date: Fri, 05 Jul 2013 10:58:06 +0800 Subject: RFR: 8019381: HashMap.isEmpty is non-final, potential issues for get/remove In-Reply-To: <51D394D4.7090706@linux.vnet.ibm.com> References: <51CBF181.1020301@linux.vnet.ibm.com> <51CCAAE5.4010707@univ-mlv.fr> <51CD896D.9030807@oracle.com> <51CDB453.5010003@linux.vnet.ibm.com> <51D13323.9030601@linux.vnet.ibm.com> <51D19EAE.2010201@univ-mlv.fr> <450D0C6E-3BA7-40AD-B415-6659A6FDDA91@oracle.com> <51D394D4.7090706@linux.vnet.ibm.com> Message-ID: <51D6363E.6090605@linux.vnet.ibm.com> On 07/03/2013 11:04 AM, Shi Jun Zhang wrote: > On 7/1/2013 11:49 PM, Chris Hegarty wrote: >> On 1 Jul 2013, at 17:22, Remi Forax wrote: >> >>> On 07/01/2013 09:43 AM, Shi Jun Zhang wrote: >>>> On 6/29/2013 12:05 AM, Shi Jun Zhang wrote: >>>>> On 6/28/2013 9:02 PM, Alan Bateman wrote: >>>>>> On 27/06/2013 22:13, Remi Forax wrote: >>>>>>> On 06/27/2013 10:02 AM, Shi Jun Zhang wrote: >>>>>>>> Hi, >>>>>>>> >>>>>>>> There are some isEmpty() check added into get/remove methods >>>>>>>> since 8011200 to return directly if HashMap is empty. However >>>>>>>> isEmpty is a non-final public method which can be overridden by >>>>>>>> subclass. If the subclass defines isEmpty differently from >>>>>>>> HashMap, it would cause problem while getting or removing >>>>>>>> elements. >>>>>>> yes, it's a bug. >>>>>>> Could you report it ? >>>>>>> >>>>>>> R?mi >>>>>> I've created a bug to track this: >>>>>> >>>>>> 8019381: HashMap.isEmpty is non-final, potential issues for >>>>>> get/remove >>>>>> >>>>>> -Alan >>>>> Thanks, Alan. >>>>> >>>>> I'm quite busy today and do not have time to report it until now. >>>>> Thanks for your help. >>>>> >>>>> I will provide a webrev next Monday for review. >>>> Hi, >>>> >>>> Here is the webrev >>>> >>>> http://cr.openjdk.java.net/~zhangshj/8019381/webrev.00/ >>> This looks Ok for me. >> +1 >> >> -Chris >> >>> R?mi >>> > Thanks all for the review. > > Jonathan, > > Could you help to push the changeset? > Hello Chance, Patch pushed @ http://hg.openjdk.java.net/jdk8/tl/jdk/rev/ed111451b77a, pls verify. Cheers! - Jonathan From daniel.daugherty at oracle.com Fri Jul 5 04:35:33 2013 From: daniel.daugherty at oracle.com (Daniel D. Daugherty) Date: Thu, 04 Jul 2013 22:35:33 -0600 Subject: RFR [8016838] java/lang/instrument/RedefineBigClass.sh needs modification In-Reply-To: <51D61A66.5010001@oracle.com> References: <51D45B8C.7010109@oracle.com> <51D595ED.7050902@oracle.com> <51D5AEB6.3060608@oracle.com> <51D5B4C5.7060402@oracle.com> <51D61A66.5010001@oracle.com> Message-ID: <51D64D15.2090105@oracle.com> Ivan, The changes look fine, I can sponsor your commit, looks like your OpenJDK user name is 'igerasim', but I need to know a little bit more about your testing of these fixes. Did you do a test JPRT job to run the JLI tests (or just the two tests themselves)? Based on e-mail about this bug fix, I believe you've found a new leak in JDK8/HSX-25 with test java/lang/instrument/RedefineBigClass.sh. That's a good thing, but I think Alan and company would be a bit grumpy with me if I pushed a test that failed as soon as someone ran it. :-) Do you know if the revised RetransformBigClass.sh also finds a new memory leak in JDK8/HSX-25? The way to deal with that is to put the test on the Problem.list as part of the same changeset. However, the T&L folks might not like that either... Dan On 7/4/13 6:59 PM, Ivan Gerasimov wrote: > Thank you, Daniel! > > Please find an updated webrev at > http://cr.openjdk.java.net/~igerasim/8016838/2/webrev/. > It now includes the RetransformBigClass test modified in the same way > as RedefineBigClass > If the changes look fine, may I ask you to sponsor the commit, as I'm > not a committer? > Here's a link to hg export: > http://cr.openjdk.java.net/~igerasim/2commit/8016838-jdk8-ReBigClass-improved.patch > > > Thanks in advance, > Ivan > > On 04.07.2013 21:45, Daniel D. Daugherty wrote: >> On 7/4/13 11:19 AM, Ivan Gerasimov wrote: >>> Daniel, thank you for review! >>> >>> Here's the updated with all all your suggestions adopted. >>> http://cr.openjdk.java.net/~igerasim/8016838/1/webrev/ >> >> Looks good. >> >> >>> >>> I haven't yet considered applying the approach to RetransformBigClass. >>> Do you want me to include this into this same change set or should I >>> make it separately? >> >> I would include it in the same changeset. >> >> Dan >> >> >>> >>> Sincerely yours, >>> Ivan >>> >>> >>> On 04.07.2013 19:34, Daniel D. Daugherty wrote: >>>> On 7/3/13 11:12 AM, Ivan Gerasimov wrote: >>>>> Hello everybody! >>>>> >>>>> We have a request to improve jtreg test. >>>>> The test had been written to verify fix for memory leak during >>>>> class redefinition. >>>>> The problem is that it always is reported as PASSED even in the >>>>> presence of the leak. >>>>> >>>>> The proposed change is platform specific. >>>>> It allows memory leak detection only on Linux. >>>>> This is because the memory leak was in native code, so there's no >>>>> easy way to detect it from within Java code. >>>>> >>>>> Here's the webrev for JDK8 repository: >>>>> http://cr.openjdk.java.net/~igerasim/8016838/0/webrev/ >>>> >>>> Very nicely done! The logic in RedefineBigClass.sh only catches a >>>> leak big enough to cause an Exception to be thrown. >>>> >>>> When I originally wrote this test and its companion: >>>> >>>> test/java/lang/instrument/RetransformBigClass* >>>> >>>> I could not come up with a platform independent way to put a small >>>> upper limit on memory growth. It never dawned on me that putting in >>>> something on one platform (Linux) was better than nothing. >>>> >>>> Are you planning to add this same logic to RetransformBigClass*? >>>> >>>> >>>> >>>> test/java/lang/instrument/RedefineBigClass.sh >>>> No comments. >>>> >>>> test/java/lang/instrument/RedefineBigClassApp.java >>>> line 48: final long MEM_LEAK_THRESHOLD = 32 * 1024; // 32Mb >>>> Would be better at the top of RedefineBigClassApp rather than >>>> "buried" down here. >>>> >>>> line 51: Long.valueOf(vmMemDelta) >>>> There are several places where a long is passed to >>>> Long.valueOf(). >>>> Is there some reason you're not passing them directly to >>>> println()? >>>> >>>> line 54: } else { >>>> The "else" is redundant due to the "System.exit(1)" call >>>> above it. >>>> You can drop the "else {" and "}" and shift that last >>>> println() to >>>> the left. >>>> >>>> line 71: return Long.parseLong(line.split(" ")[22]) / 1024; >>>> How about at least a comment referring to the Linux proc(5) >>>> man page... and the fact that the 23rd field is: >>>> >>>> vsize %lu Virtual memory size in bytes. >>>> >>>> Again, very nicely done! >>>> >>>> Dan >>>> >>>> >>>>> >>>>> The surprising thing is that modified test detected the leak with >>>>> the latest JDK8! >>>>> Latest 6 and 7 are fine, so it might be regression in JDK8. >>>>> >>>>> I've filled a bug http://bugs.sun.com/view_bug.do?bug_id=8019845 >>>>> "Memory leak during class redefenition" (not yet available.) >>>>> >>>>> Sincerely yours, >>>>> Ivan Gerasimov >>>>> >>>>> >>>>> >>>> >>>> >>>> >>> >> >> >> > From daniel.daugherty at oracle.com Fri Jul 5 05:37:54 2013 From: daniel.daugherty at oracle.com (Daniel D. Daugherty) Date: Thu, 04 Jul 2013 23:37:54 -0600 Subject: RFR [8016838] java/lang/instrument/RedefineBigClass.sh needs modification In-Reply-To: <51D64D15.2090105@oracle.com> References: <51D45B8C.7010109@oracle.com> <51D595ED.7050902@oracle.com> <51D5AEB6.3060608@oracle.com> <51D5B4C5.7060402@oracle.com> <51D61A66.5010001@oracle.com> <51D64D15.2090105@oracle.com> Message-ID: <51D65BB2.90503@oracle.com> In a JPRT test job I just ran: RedefineBigClass.sh passed on 9 platforms and failed on Linux 64-bit. RetransformBigClass.sh passed on all 10 platforms. Does your own testing only showing failure on the Linux 64-bit VM and passed on the Linux 32-bit VM? Dan On 7/4/13 10:35 PM, Daniel D. Daugherty wrote: > Ivan, > > The changes look fine, I can sponsor your commit, looks like your > OpenJDK user name is 'igerasim', but I need to know a little bit > more about your testing of these fixes. Did you do a test JPRT > job to run the JLI tests (or just the two tests themselves)? > > Based on e-mail about this bug fix, I believe you've found a new > leak in JDK8/HSX-25 with test java/lang/instrument/RedefineBigClass.sh. > That's a good thing, but I think Alan and company would be a bit > grumpy with me if I pushed a test that failed as soon as someone > ran it. :-) Do you know if the revised RetransformBigClass.sh also > finds a new memory leak in JDK8/HSX-25? > > The way to deal with that is to put the test on the Problem.list > as part of the same changeset. However, the T&L folks might not like > that either... > > Dan > > > On 7/4/13 6:59 PM, Ivan Gerasimov wrote: >> Thank you, Daniel! >> >> Please find an updated webrev at >> http://cr.openjdk.java.net/~igerasim/8016838/2/webrev/. >> It now includes the RetransformBigClass test modified in the same way >> as RedefineBigClass >> If the changes look fine, may I ask you to sponsor the commit, as I'm >> not a committer? >> Here's a link to hg export: >> http://cr.openjdk.java.net/~igerasim/2commit/8016838-jdk8-ReBigClass-improved.patch >> >> >> Thanks in advance, >> Ivan >> >> On 04.07.2013 21:45, Daniel D. Daugherty wrote: >>> On 7/4/13 11:19 AM, Ivan Gerasimov wrote: >>>> Daniel, thank you for review! >>>> >>>> Here's the updated with all all your suggestions adopted. >>>> http://cr.openjdk.java.net/~igerasim/8016838/1/webrev/ >>> >>> Looks good. >>> >>> >>>> >>>> I haven't yet considered applying the approach to RetransformBigClass. >>>> Do you want me to include this into this same change set or should >>>> I make it separately? >>> >>> I would include it in the same changeset. >>> >>> Dan >>> >>> >>>> >>>> Sincerely yours, >>>> Ivan >>>> >>>> >>>> On 04.07.2013 19:34, Daniel D. Daugherty wrote: >>>>> On 7/3/13 11:12 AM, Ivan Gerasimov wrote: >>>>>> Hello everybody! >>>>>> >>>>>> We have a request to improve jtreg test. >>>>>> The test had been written to verify fix for memory leak during >>>>>> class redefinition. >>>>>> The problem is that it always is reported as PASSED even in the >>>>>> presence of the leak. >>>>>> >>>>>> The proposed change is platform specific. >>>>>> It allows memory leak detection only on Linux. >>>>>> This is because the memory leak was in native code, so there's no >>>>>> easy way to detect it from within Java code. >>>>>> >>>>>> Here's the webrev for JDK8 repository: >>>>>> http://cr.openjdk.java.net/~igerasim/8016838/0/webrev/ >>>>> >>>>> Very nicely done! The logic in RedefineBigClass.sh only catches a >>>>> leak big enough to cause an Exception to be thrown. >>>>> >>>>> When I originally wrote this test and its companion: >>>>> >>>>> test/java/lang/instrument/RetransformBigClass* >>>>> >>>>> I could not come up with a platform independent way to put a small >>>>> upper limit on memory growth. It never dawned on me that putting in >>>>> something on one platform (Linux) was better than nothing. >>>>> >>>>> Are you planning to add this same logic to RetransformBigClass*? >>>>> >>>>> >>>>> >>>>> test/java/lang/instrument/RedefineBigClass.sh >>>>> No comments. >>>>> >>>>> test/java/lang/instrument/RedefineBigClassApp.java >>>>> line 48: final long MEM_LEAK_THRESHOLD = 32 * 1024; // 32Mb >>>>> Would be better at the top of RedefineBigClassApp rather than >>>>> "buried" down here. >>>>> >>>>> line 51: Long.valueOf(vmMemDelta) >>>>> There are several places where a long is passed to >>>>> Long.valueOf(). >>>>> Is there some reason you're not passing them directly to >>>>> println()? >>>>> >>>>> line 54: } else { >>>>> The "else" is redundant due to the "System.exit(1)" call >>>>> above it. >>>>> You can drop the "else {" and "}" and shift that last >>>>> println() to >>>>> the left. >>>>> >>>>> line 71: return Long.parseLong(line.split(" ")[22]) / 1024; >>>>> How about at least a comment referring to the Linux proc(5) >>>>> man page... and the fact that the 23rd field is: >>>>> >>>>> vsize %lu Virtual memory size in bytes. >>>>> >>>>> Again, very nicely done! >>>>> >>>>> Dan >>>>> >>>>> >>>>>> >>>>>> The surprising thing is that modified test detected the leak with >>>>>> the latest JDK8! >>>>>> Latest 6 and 7 are fine, so it might be regression in JDK8. >>>>>> >>>>>> I've filled a bug http://bugs.sun.com/view_bug.do?bug_id=8019845 >>>>>> "Memory leak during class redefenition" (not yet available.) >>>>>> >>>>>> Sincerely yours, >>>>>> Ivan Gerasimov >>>>>> >>>>>> >>>>>> >>>>> >>>>> >>>>> >>>> >>> >>> >>> >> > From david.holmes at oracle.com Fri Jul 5 05:58:32 2013 From: david.holmes at oracle.com (David Holmes) Date: Fri, 05 Jul 2013 15:58:32 +1000 Subject: RFR (XS): 8014890 : Reference queues may return more entries than expected In-Reply-To: <51D16B98.5010506@oracle.com> References: <1371589723.2524.43.camel@cirrus> <51D0D0A2.7030307@oracle.com> <51D134FF.2080802@oracle.com> <1372673139.2769.14.camel@cirrus> <51D15679.2080407@oracle.com> <51D169E8.70601@oracle.com> <51D16B98.5010506@oracle.com> Message-ID: <51D66088.4020102@oracle.com> On 1/07/2013 9:44 PM, Aleksey Shipilev wrote: > On 07/01/2013 03:37 PM, David Holmes wrote: >> On 1/07/2013 8:14 PM, Aleksey Shipilev wrote: >>> The same "thou shalt not do multiple volatile reads" applies to >>> "(r.queue == NULL) || (r.queue == ENQUEUED)" now. >> >> Doesn't that just reduce to "r.queue != this" ? (The assert suggests >> so :) ) > > Thomas' original patch had this in form of "r.queue != this". I argue it > is more future-proof to distinguish the concrete cases. Seems dubious to me - depends on what the future change would be. Here and now it does two comparisons instead of one - which seems a micro deoptimization. >>> Also, continuing on the micro-optimization spree, you might want to >>> use bitwise |, not logical ||, saving a branch. >> >> Bit-wise OR? What bits are you ORing ? > > You *can* bitwise OR two booleans; which would only remove > short-circuiting behavior with the benefit of clearing one branch. See > http://docs.oracle.com/javase/specs/jls/se7/html/jls-15.html#jls-15.22.2 How obscure :) David > -Aleksey. > From david.holmes at oracle.com Fri Jul 5 06:00:25 2013 From: david.holmes at oracle.com (David Holmes) Date: Fri, 05 Jul 2013 16:00:25 +1000 Subject: RFR (XS): 8014890 : Reference queues may return more entries than expected In-Reply-To: <1372679479.2769.44.camel@cirrus> References: <1371589723.2524.43.camel@cirrus> <51D0D0A2.7030307@oracle.com> <51D134FF.2080802@oracle.com> <1372673139.2769.14.camel@cirrus> <51D15679.2080407@oracle.com> <51D169E8.70601@oracle.com> <51D16B98.5010506@oracle.com> <1372679479.2769.44.camel@cirrus> Message-ID: <51D660F9.4080207@oracle.com> This looks fine to me. Thanks, David On 1/07/2013 9:51 PM, Thomas Schatzl wrote: > Hi all, > > On Mon, 2013-07-01 at 15:44 +0400, Aleksey Shipilev wrote: >> On 07/01/2013 03:37 PM, David Holmes wrote: >>> On 1/07/2013 8:14 PM, Aleksey Shipilev wrote: >>>> The same "thou shalt not do multiple volatile reads" applies to >>>> "(r.queue == NULL) || (r.queue == ENQUEUED)" now. >>> >>> Doesn't that just reduce to "r.queue != this" ? (The assert suggests >>> so :) ) >> >> Thomas' original patch had this in form of "r.queue != this". I argue it >> is more future-proof to distinguish the concrete cases. > > :) > > I also thought it was more understandable if the cases were explicitly > enumerated, in addition to the assert. > > I changed this in > http://cr.openjdk.java.net/~tschatzl/8014890/webrev.refactor to that > version now, using a temporary variable that stores r.queue before the > checks to avoid the double volatile reads. > > However for me either version is fine, just tell me what you favor. > > I am not really happy about bitwise ORing the two comparison results as > it seems to reduce readability at no real gain. > > Thanks, > Thomas > > From erik.joelsson at oracle.com Fri Jul 5 07:24:37 2013 From: erik.joelsson at oracle.com (Erik Joelsson) Date: Fri, 05 Jul 2013 09:24:37 +0200 Subject: Request for Review: 5049299: (process) Use posix_spawn, not fork, on S10 to avoid swap exhaustion In-Reply-To: <51D57B88.3050707@oracle.com> References: <50AE98B1.2040200@oracle.com> <50B81A8D.2040403@oracle.com> <50B82C94.90109@oracle.com> <50D277BE.8060705@oracle.com> <50D65C3F.2040004@oracle.com> <51D2F496.6050400@oracle.com> <51D57B88.3050707@oracle.com> Message-ID: <51D674B5.7020100@oracle.com> Build changes are looking pretty good. Just one thing that I would like to add. Since the executable jspawnhelper is linking in an object file from libjava, it would be good to declare that dependency. See unpack200 for a similar situation. $(BUILD_JSPAWNHELPER): $(LINK_JSPAWNHELPER_OBJECTS) /Erik On 2013-07-04 15:41, Rob McKenna wrote: > Hi Alan, > > I've just uploaded the latest changes which rebase the fix to the > current repo. (required post 8008118) I've also swapped out useFork > for jdk.lang.Process.launchMechanism. (it affords us the flexibility > to enable or disable other mechanisms on the various platforms at a > later date) I have a couple of questions about this: > > 1) I'm thinking of including a unit test which will run through the > various permutations across each platform making sure we fail when > expected. > > 2) Should we simply ignore the flag on Windows or should we throw the > same error if its provided? > > cc'ing Erik for a build review. > > http://cr.openjdk.java.net/~robm/5049299/webrev.04/ > > -Rob > > > On 02/07/13 16:41, Alan Bateman wrote: >> On 23/12/2012 01:19, Rob McKenna wrote: >>> Hi Martin, thanks a lot for this. >>> >>> I've renamed LINKFLAG to the more appropriate (and common) ARCHFLAG. >>> It seems to pop up all around our source but if build-dev know of a >>> better (or canonical) way of doing it I'll take it! >>> >>> The BUILD_JEXEC differences don't show up in my webrev or hg diff, >>> but I see them in the jdk.patch generated by webrev. I have no idea >>> why this is. (I did use the JEXEC stuff as a template for the >>> JSPAWNHELPER code, but I don't recall altering the JEXEC stuff in >>> any way. It looks like its limited to indentation. Strange.) >>> >>> W.r.t. useFork, I'll discuss this with Alan once he has a spare >>> minute. I believe he may have had some concerns, but I'll let you >>> know how that goes either way. >>> >>> The only __APPLE__ should be to get the call to _NSGetEnviron(). >>> Everything else should be bsd. >>> >>> I've put a webrev at: >>> >>> http://cr.openjdk.java.net/~robm/5049299/webrev.03/ >>> >>> >>> I hope this addresses the rest of your comments. >>> >>> -Rob >> Rob - this was great work but I don't think we brought it to a >> conclusion. Are you planning to re-base the patch and send out a new >> webrev? >> >> -Alan > From Alan.Bateman at oracle.com Fri Jul 5 08:32:08 2013 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Fri, 05 Jul 2013 09:32:08 +0100 Subject: RFR: JAXP 1.5 for JDK8/7u40: 8016648: FEATURE_SECURE_PROCESSING set to true or false causes SAXParseException to be thrown In-Reply-To: <51D5DA43.3050404@oracle.com> References: <51D13933.8090901@oracle.com> <51D1A3F2.2000707@oracle.com> <51D1CB94.90901@oracle.com> <51D1DE7D.3030105@oracle.com> <51D53C3A.6000708@oracle.com> <51D54E48.6060503@oracle.com> <51D5DA43.3050404@oracle.com> Message-ID: <51D68488.2050108@oracle.com> On 04/07/2013 21:25, huizhe wang wrote: > > Reverted back to the original code: > http://cr.openjdk.java.net/~joehw/jdk8/8016648/webrev/ > The code split the version number and look at the 1st or 2nd element, > it thus works for both the current format and the proposed one, e.g. > for 1.7.0, it compares with the 2nd element, and for the proposed > MAJOR.MINOR.FU.*, the 1st or MAJOR. Thanks for dropping the dependency on javax.lang.model. What you now is probably okay although I'm a bit dubious about attempting to support an alternative format (I'm not aware of any proposal that changes the format of the java.version property as changing it would like cause a lot of breakage). A minor point but isJDKOrAbove looks a bit odd to me, I'd probably go for something like isJavaVersionGTE or isJavaVersionAtLeast but as it's not part of the API then it doesn't matter of course. I think I mentioned it a while back but have warnings emitted with System.err can be problematic (gets mixed up with application messages to stderr). I realize the Xerces code seems to do this in places but we really need to see about eliminating these messages or getting consistent logging into this code. > : > > The last scenario to work on is if FSP is set on the Validator instead > of SchemaFactory. With that, I'm looking at refactoring the way > properties are represented so that they carry state. It would then be > cleaner to pass them from SchemaFactory over to Schema and then > Validator. It's a bit of work. Fortunately, we only have three of them > to deal with. So are you planning to send another webrev or do it as a separate issue? -Alan From peter.levart at gmail.com Fri Jul 5 08:32:09 2013 From: peter.levart at gmail.com (Peter Levart) Date: Fri, 05 Jul 2013 10:32:09 +0200 Subject: 7122142 : (ann) Race condition between isAnnotationPresent and getAnnotations In-Reply-To: References: <51C1BEC6.1080308@gmail.com> <51C1FE64.3020000@oracle.com> <51C88EBF.9020704@gmail.com> <51D43A72.8090508@oracle.com> <51D5895B.5020006@gmail.com> Message-ID: <51D68489.2020000@gmail.com> On 07/04/2013 07:34 PM, Joel Borggr?n-Franck wrote: >>> Also, can you please explain to me why the update race is safe. I have done the/some research myself but I would like to know which angles you have covered. >> Well, one thing is that AnnotationType class is now effectively final, meaning that all it's state is referenced using final fields. If a reference to an instance of such class is obtained via data-race, all it's state is observed consistent by the thread that obtained the reference. The other thing is racy caching. If two or more threads are concurrently requesting AnnotationType for the same Class, many of them might construct and use it's own instance and the one published "latest" will finally be the one being cached. Since all such AnnotationType instances are constructed from the same input data, they are equivalent and it doesn't matter which one is used by which thread. >> > Actually they aren't, something have been bugging me and I finally figured it out today. The problem is with default valued elements. Previously all threads have been seeing the same instance of default values but now that will only be guaranteed for Classes, Strings and Integers inside the value cache. While I don't think it is in the spec that annotation default value instances should be == for all threads I don't think it is a race we should introduce. Given this I think you should use some approach to produce a winner that every thread will use (like in the other annotations patch). My gut feeling is that CASing in a result will be better under contention that the current lock solution (while also correct and deadlock free) for a net win. > Hi Joel, Here's the 4th revision of the patch: http://cr.openjdk.java.net/~plevart/jdk8-tl/AnnotationType/webrev.04/ This one introduces CAS-ing of the AnnotationType instance into the Class.annotationType field so that there's only a single instance ever returned for a single Class. I also introduced new private static Class.Atomic nested class that is used to lazily initialize Unsafe machinery and to provide a safe wrapper for internal j.l.Class use. Previously this was part of ReflectionData nested class because it was only used for it's purpose. In anticipation to have a need for more atomic operations in the future, I moved this code to a separate class. ReflectionData is now just a record. Regards, Peter From paul.sandoz at oracle.com Fri Jul 5 08:42:52 2013 From: paul.sandoz at oracle.com (Paul Sandoz) Date: Fri, 5 Jul 2013 10:42:52 +0200 Subject: RFR 8019484 Sync j.u.c.ConcurrentHashMap from 166 to tl In-Reply-To: <9055AD19-214B-4136-8F76-56FEC8E2E406@oracle.com> References: <9055AD19-214B-4136-8F76-56FEC8E2E406@oracle.com> Message-ID: A few bugs where found in CHM and fixed. I updated the webrev. The diff can be viewed here: http://hg.openjdk.java.net/lambda/lambda/jdk/rev/291a872e1763 Paul. On Jul 1, 2013, at 2:44 PM, Paul Sandoz wrote: > Hi, > > The following is the final j.u.c patch that syncs CMH classes from 166 j.u.c to tl. > > http://cr.openjdk.java.net/~psandoz/tl/JDK-8019484-chm/webrev/ > > (i am sure there will be more patches to follow as tweaks are made to various areas, but hopefully they will not need so bulky.) > > ConcurrentMap.replaceAll in tl was more up to date than that in 166. > > Quite tricky to review CHM since there is a fair bit of code shuffling due to: > > 480 * This file is organized to make things a little easier to follow > 481 * while reading than they might otherwise: First the main static > 482 * declarations and utilities, then fields, then main public > 483 * methods (with a few factorings of multiple public methods into > 484 * internal ones), then sizing methods, trees, traversers, and > 485 * bulk operations. > > Paul. From paul.sandoz at oracle.com Fri Jul 5 08:55:52 2013 From: paul.sandoz at oracle.com (Paul Sandoz) Date: Fri, 5 Jul 2013 10:55:52 +0200 Subject: Possible HashMap update In-Reply-To: <51D4ABDA.7010801@cs.oswego.edu> References: <51D4ABDA.7010801@cs.oswego.edu> Message-ID: I played with these in the lambda repo. I needed to make the following additional change for things to compile: --- a/src/share/classes/java/io/ExpiringCache.java Fri Jul 05 10:04:00 2013 +0200 +++ b/src/share/classes/java/io/ExpiringCache.java Fri Jul 05 10:45:10 2013 +0200 @@ -64,8 +64,8 @@ @SuppressWarnings("serial") ExpiringCache(long millisUntilExpiration) { this.millisUntilExpiration = millisUntilExpiration; - map = new LinkedHashMap() { - protected boolean removeEldestEntry(Map.Entry eldest) { + map = new LinkedHashMap() { + protected boolean removeEldestEntry(Map.Entry eldest) { return size() > MAX_ENTRIES; } }; I don't quite know why, need to look in more detail. Passes the stream tests and selected j.u tests. The test java/util/Map/CheckRandomHashSeed needs updating, but i presume this test should be removed if similar updates are planed for WeakHashMap and Hashtable: diff -r 291a872e1763 test/java/util/Map/CheckRandomHashSeed.java --- a/test/java/util/Map/CheckRandomHashSeed.java Fri Jul 05 10:04:00 2013 +0200 +++ b/test/java/util/Map/CheckRandomHashSeed.java Fri Jul 05 10:53:50 2013 +0200 @@ -53,8 +53,6 @@ throw new Error("Error in test setup: " + (expectRandom ? "" : "not " ) + "expecting random hashSeed, but " + PROP_NAME + " is " + (propSet ? "" : "not ") + "enabled"); } - testMap(new HashMap()); - testMap(new LinkedHashMap()); testMap(new WeakHashMap()); testMap(new Hashtable()); } Paul. On Jul 4, 2013, at 12:55 AM, Doug Lea
wrote: > > A few weeks ago, in the course of doing a (hopefully-last) reworking of > JDK8 ConcurrentHashMap (CHM) internals based on experience with > preview versions, I noticed that the balanced tree scheme now in place > as a fallback in the case of usages with many keys all with the same > hashCode could also be profitably used in other cases: CHM (like > HashMap) previously performed some bit-scrambling of user hashCodes to > make it less likely that user hashCodes that were non-identical but > highly-non-random will collide in the same bins (thus with O(n) vs the > expected O(1) performance). This bit-scrambling is an > anti-optimization in many usages that do not contain the kinds of > systematic hashCode bias that most hurt performance. While it is > reasonably fast, it still places computation where you do not > want it: in front of the likely cache-miss to access an entry. Plus, > bit-scrambling is only statistically likely to help. It is still > possible to encounter hashCodes that systematically collide. It would > be nice to provide O(log N) guarantees for these cases as well. > > So, CHM now omits bit-scrambling (well, almost -- just a single xor to > avoid losing impact of top bits), and instead rolls over into using > trees for bins that contain a statistically unlikely number of keys, > and rolling back into simple bin form if/when they don't due to > deletions or resizings. ("Statistically unlikely" is a surprisingly > low number. More than 8 nodes are expected only about once per ten > million under perfectly random keys; this is also often (depending on > cost of equals() methods, additional dispatch overhead, etc), around > the break-even point for using trees vs lists). The updated tree > mechanics now provide O(log N) worst-case performance in either of two > cases: (colliding non-identical-hashCodes), and (identical hashCodes > but mutually Comparable keys). And does so while also speeding up by a > little those typical usages that do not encounter systematic > collisions. Also, there is no sense at all in using any form of > hashSeed in this scheme. It basically behaves the same whether or not > you use one. > > The overall impact appears to be a net win. Non-heavily-colliding > cases are a bit faster. Some colliding cases are a little slower and > use more memory (tree-based nodes are bigger than plain ones), but > have much better worst (and typical) case bounds unless people use > crazily-bad keys that all have same hashCodes but are never equal or > comparable to others, in which case treeification is wasted effort > (but only by a constant factor of about 2 in both time and space). > > This seemed to be enough of an improvement in terms of both worst-case > and expected performance to try applying it to TreeBin-enabled > HashMap. So I gave it a try. To enable bidirectional tree<->plain node > conversion, I used the subclassing strategy mentioned during > discussion of the initial balanced tree version. This in turn requires > a completely different within-package internal API to allow > LinkedHashMap to continue to subclass HashMap. A couple of internal > constructions exist solely to allow the same source code to be > identical in HashMap and ConcurrenHashMap (but not the same compiled > code, since the types they operate on are and must be unrelated in the > two classes, and because they live in different packages, there's no > nice way to express their commonalities without exposing.) > > This note serves as a pre-proposal request for comment, as well a > request for anyone interested in trying it out, especially in any > weird/unusual use cases, to report experiences before seriously > considering it as a replacement. To simplify logistics, I checked in the > code in a workspace directory in jsr166: > > http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/src/dl/java/util/HashMap.java?view=log > > http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/src/dl/java/util/LinkedHashMap.java?view=log From peter.levart at gmail.com Fri Jul 5 09:12:13 2013 From: peter.levart at gmail.com (Peter Levart) Date: Fri, 05 Jul 2013 11:12:13 +0200 Subject: 7122142 : (ann) Race condition between isAnnotationPresent and getAnnotations In-Reply-To: <51D68489.2020000@gmail.com> References: <51C1BEC6.1080308@gmail.com> <51C1FE64.3020000@oracle.com> <51C88EBF.9020704@gmail.com> <51D43A72.8090508@oracle.com> <51D5895B.5020006@gmail.com> <51D68489.2020000@gmail.com> Message-ID: <51D68DED.2030308@gmail.com> Hi Again, Sorry, the 4th revision I posted is not rebased to the current tip of jdk8-tl so it contained some diffs that reverted some things. Here's the correct patch: http://cr.openjdk.java.net/~plevart/jdk8-tl/AnnotationType/webrev.05/ Regards, Peter On 07/05/2013 10:32 AM, Peter Levart wrote: > Hi Joel, > > Here's the 4th revision of the patch: > > http://cr.openjdk.java.net/~plevart/jdk8-tl/AnnotationType/webrev.04/ > > This one introduces CAS-ing of the AnnotationType instance into the > Class.annotationType field so that there's only a single instance ever > returned for a single Class. I also introduced new private static > Class.Atomic nested class that is used to lazily initialize Unsafe > machinery and to provide a safe wrapper for internal j.l.Class use. > Previously this was part of ReflectionData nested class because it was > only used for it's purpose. In anticipation to have a need for more > atomic operations in the future, I moved this code to a separate > class. ReflectionData is now just a record. > > Regards, Peter From maurizio.cimadamore at oracle.com Fri Jul 5 10:08:01 2013 From: maurizio.cimadamore at oracle.com (maurizio.cimadamore at oracle.com) Date: Fri, 05 Jul 2013 10:08:01 +0000 Subject: hg: jdk8/tl/langtools: 5 new changesets Message-ID: <20130705100822.11A394881A@hg.openjdk.java.net> Changeset: 7b756b307e12 Author: mcimadamore Date: 2013-07-05 11:00 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/7b756b307e12 8017618: NullPointerException in RichDiagnosticFormatter for bad input program Summary: RDF crashes when diagnostic contains type 'void' Reviewed-by: jjg, vromero ! src/share/classes/com/sun/tools/javac/util/RichDiagnosticFormatter.java + test/tools/javac/lambda/BadNestedLambda.java + test/tools/javac/lambda/BadNestedLambda.out Changeset: 70b37cdb19d5 Author: mcimadamore Date: 2013-07-05 11:02 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/70b37cdb19d5 8019480: Javac crashes when method is called on a type-variable receiver from lambda expression Summary: Logic for shortcircuiting speculative attribution doesn't handle type-variable receivers Reviewed-by: jjg, vromero ! src/share/classes/com/sun/tools/javac/comp/DeferredAttr.java + test/tools/javac/lambda/8019480/T8019480.java + test/tools/javac/lambda/8019480/T8019480.out Changeset: b0386f0dc28e Author: mcimadamore Date: 2013-07-05 11:03 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/b0386f0dc28e 8016059: Cannot compile following lambda 8016060: Lambda isn't compiled with return statement Summary: Spurious error triggered during unnecessary recovery round Reviewed-by: jjg, vromero ! src/share/classes/com/sun/tools/javac/code/Type.java ! src/share/classes/com/sun/tools/javac/comp/Attr.java ! src/share/classes/com/sun/tools/javac/comp/DeferredAttr.java + test/tools/javac/lambda/TargetType75.java Changeset: bfbedbfc522a Author: mcimadamore Date: 2013-07-05 11:04 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/bfbedbfc522a 8016702: use of ternary operator in lambda expression gives incorrect results Summary: Constant types erroneously creep in during inference Reviewed-by: jjg, vromero ! src/share/classes/com/sun/tools/javac/comp/Attr.java + test/tools/javac/conditional/T8016702.java Changeset: 42b3c5e92461 Author: mcimadamore Date: 2013-07-05 11:05 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/42b3c5e92461 8019824: very long error messages on inference error Summary: Inference error messages shows several spurious captured variables generated during an inference loop Reviewed-by: jjg, vromero ! src/share/classes/com/sun/tools/javac/code/Type.java ! src/share/classes/com/sun/tools/javac/comp/Infer.java + test/tools/javac/generics/inference/8019824/T8019824.java + test/tools/javac/generics/inference/8019824/T8019824.out From ivan.gerasimov at oracle.com Fri Jul 5 10:18:01 2013 From: ivan.gerasimov at oracle.com (Ivan Gerasimov) Date: Fri, 05 Jul 2013 14:18:01 +0400 Subject: RFR [8016838] java/lang/instrument/RedefineBigClass.sh needs modification In-Reply-To: <51D65BB2.90503@oracle.com> References: <51D45B8C.7010109@oracle.com> <51D595ED.7050902@oracle.com> <51D5AEB6.3060608@oracle.com> <51D5B4C5.7060402@oracle.com> <51D61A66.5010001@oracle.com> <51D64D15.2090105@oracle.com> <51D65BB2.90503@oracle.com> Message-ID: <51D69D59.9020002@oracle.com> I'm looking at the log of the job you've run: http://prt-web.us.oracle.com//archive/2013/07/2013-07-05-045326.ddaugher.8016838_exp/logs/linux_x64-product-c2-jdk_lang.log.FAILED.log And it looks like both tests failed, not only the first one: FAIL: Virtual memory usage increased by 1411072Kb (greater than 32768Kb) FAIL: RedefineBigClassApp exited with status of 1 ... FAIL: Virtual memory usage increased by 1411072Kb (greater than 32768Kb) FAIL: RetransformBigClassApp exited with status of 1 I have these two tests locally on 64-bit Linux and they both fail with similar results in logs. I may not tell for sure why the tests didn't fail on 32-bit Linux. Whether it was because the /proc/self/stat approach didn't work or because the leak is specific to 64-bit platform. I have tested the RedefineBigClass test on JPRT with JDK6 (the code was a bit different, but the approach was the same). The test passed with JDK6u60 and failed (as expected) with JDK6u51 on both 32 and 64-bit Linux machines. I'm going to do more testings today. Sincerely yours, Ivan On 05.07.2013 9:37, Daniel D. Daugherty wrote: > In a JPRT test job I just ran: > > RedefineBigClass.sh passed on 9 platforms and failed on Linux 64-bit. > RetransformBigClass.sh passed on all 10 platforms. > > Does your own testing only showing failure on the Linux 64-bit VM > and passed on the Linux 32-bit VM? > > Dan > > > > On 7/4/13 10:35 PM, Daniel D. Daugherty wrote: >> Ivan, >> >> The changes look fine, I can sponsor your commit, looks like your >> OpenJDK user name is 'igerasim', but I need to know a little bit >> more about your testing of these fixes. Did you do a test JPRT >> job to run the JLI tests (or just the two tests themselves)? >> >> Based on e-mail about this bug fix, I believe you've found a new >> leak in JDK8/HSX-25 with test java/lang/instrument/RedefineBigClass.sh. >> That's a good thing, but I think Alan and company would be a bit >> grumpy with me if I pushed a test that failed as soon as someone >> ran it. :-) Do you know if the revised RetransformBigClass.sh also >> finds a new memory leak in JDK8/HSX-25? >> >> The way to deal with that is to put the test on the Problem.list >> as part of the same changeset. However, the T&L folks might not like >> that either... >> >> Dan >> >> >> On 7/4/13 6:59 PM, Ivan Gerasimov wrote: >>> Thank you, Daniel! >>> >>> Please find an updated webrev at >>> http://cr.openjdk.java.net/~igerasim/8016838/2/webrev/. >>> It now includes the RetransformBigClass test modified in the same >>> way as RedefineBigClass >>> If the changes look fine, may I ask you to sponsor the commit, as >>> I'm not a committer? >>> Here's a link to hg export: >>> http://cr.openjdk.java.net/~igerasim/2commit/8016838-jdk8-ReBigClass-improved.patch >>> >>> >>> Thanks in advance, >>> Ivan >>> >>> On 04.07.2013 21:45, Daniel D. Daugherty wrote: >>>> On 7/4/13 11:19 AM, Ivan Gerasimov wrote: >>>>> Daniel, thank you for review! >>>>> >>>>> Here's the updated with all all your suggestions adopted. >>>>> http://cr.openjdk.java.net/~igerasim/8016838/1/webrev/ >>>> >>>> Looks good. >>>> >>>> >>>>> >>>>> I haven't yet considered applying the approach to >>>>> RetransformBigClass. >>>>> Do you want me to include this into this same change set or should >>>>> I make it separately? >>>> >>>> I would include it in the same changeset. >>>> >>>> Dan >>>> >>>> >>>>> >>>>> Sincerely yours, >>>>> Ivan >>>>> >>>>> >>>>> On 04.07.2013 19:34, Daniel D. Daugherty wrote: >>>>>> On 7/3/13 11:12 AM, Ivan Gerasimov wrote: >>>>>>> Hello everybody! >>>>>>> >>>>>>> We have a request to improve jtreg test. >>>>>>> The test had been written to verify fix for memory leak during >>>>>>> class redefinition. >>>>>>> The problem is that it always is reported as PASSED even in the >>>>>>> presence of the leak. >>>>>>> >>>>>>> The proposed change is platform specific. >>>>>>> It allows memory leak detection only on Linux. >>>>>>> This is because the memory leak was in native code, so there's >>>>>>> no easy way to detect it from within Java code. >>>>>>> >>>>>>> Here's the webrev for JDK8 repository: >>>>>>> http://cr.openjdk.java.net/~igerasim/8016838/0/webrev/ >>>>>> >>>>>> Very nicely done! The logic in RedefineBigClass.sh only catches a >>>>>> leak big enough to cause an Exception to be thrown. >>>>>> >>>>>> When I originally wrote this test and its companion: >>>>>> >>>>>> test/java/lang/instrument/RetransformBigClass* >>>>>> >>>>>> I could not come up with a platform independent way to put a small >>>>>> upper limit on memory growth. It never dawned on me that putting in >>>>>> something on one platform (Linux) was better than nothing. >>>>>> >>>>>> Are you planning to add this same logic to RetransformBigClass*? >>>>>> >>>>>> >>>>>> >>>>>> test/java/lang/instrument/RedefineBigClass.sh >>>>>> No comments. >>>>>> >>>>>> test/java/lang/instrument/RedefineBigClassApp.java >>>>>> line 48: final long MEM_LEAK_THRESHOLD = 32 * 1024; // 32Mb >>>>>> Would be better at the top of RedefineBigClassApp rather >>>>>> than >>>>>> "buried" down here. >>>>>> >>>>>> line 51: Long.valueOf(vmMemDelta) >>>>>> There are several places where a long is passed to >>>>>> Long.valueOf(). >>>>>> Is there some reason you're not passing them directly to >>>>>> println()? >>>>>> >>>>>> line 54: } else { >>>>>> The "else" is redundant due to the "System.exit(1)" call >>>>>> above it. >>>>>> You can drop the "else {" and "}" and shift that last >>>>>> println() to >>>>>> the left. >>>>>> >>>>>> line 71: return Long.parseLong(line.split(" ")[22]) / 1024; >>>>>> How about at least a comment referring to the Linux proc(5) >>>>>> man page... and the fact that the 23rd field is: >>>>>> >>>>>> vsize %lu Virtual memory size in bytes. >>>>>> >>>>>> Again, very nicely done! >>>>>> >>>>>> Dan >>>>>> >>>>>> >>>>>>> >>>>>>> The surprising thing is that modified test detected the leak >>>>>>> with the latest JDK8! >>>>>>> Latest 6 and 7 are fine, so it might be regression in JDK8. >>>>>>> >>>>>>> I've filled a bug http://bugs.sun.com/view_bug.do?bug_id=8019845 >>>>>>> "Memory leak during class redefenition" (not yet available.) >>>>>>> >>>>>>> Sincerely yours, >>>>>>> Ivan Gerasimov >>>>>>> >>>>>>> >>>>>>> >>>>>> >>>>>> >>>>>> >>>>> >>>> >>>> >>>> >>> >> > From ivan.gerasimov at oracle.com Fri Jul 5 10:53:14 2013 From: ivan.gerasimov at oracle.com (Ivan Gerasimov) Date: Fri, 05 Jul 2013 14:53:14 +0400 Subject: RFR [8016838] java/lang/instrument/RedefineBigClass.sh needs modification In-Reply-To: <51D64D15.2090105@oracle.com> References: <51D45B8C.7010109@oracle.com> <51D595ED.7050902@oracle.com> <51D5AEB6.3060608@oracle.com> <51D5B4C5.7060402@oracle.com> <51D61A66.5010001@oracle.com> <51D64D15.2090105@oracle.com> Message-ID: <51D6A59A.1060703@oracle.com> On 05.07.2013 8:35, Daniel D. Daugherty wrote: > Ivan, > > The changes look fine, I can sponsor your commit, looks like your > OpenJDK user name is 'igerasim', but I need to know a little bit > more about your testing of these fixes. Did you do a test JPRT > job to run the JLI tests (or just the two tests themselves)? > I've only run test from java/lang/instrument when checked the change with JDK6u60 (all passed) and with JDK6u51 (the test failed as expected, since the leak had still been there.) > Based on e-mail about this bug fix, I believe you've found a new > leak in JDK8/HSX-25 with test java/lang/instrument/RedefineBigClass.sh. Right. The test shown a memleak with the the latest jdk8. I filed a bug 8019845 about this leak. Stefan Karlsson guessed that this may be related to 8003419 (NPG: Clean up metadata created during class loading if failure) Then I've checked the builds b57 (test failed) and b58 (test passed), so I confirmed that it may be the reason of the leak being observed now. But now I think that the reason may be different. It just turns out that the test shows failures for (at least) three different leaks - the one you, Daniel, solved (7121600), the one Stefan wrote about (8003419) and the one currently observed (8019845). > That's a good thing, but I think Alan and company would be a bit > grumpy with me if I pushed a test that failed as soon as someone > ran it. :-) Do you know if the revised RetransformBigClass.sh also > finds a new memory leak in JDK8/HSX-25? > > The way to deal with that is to put the test on the Problem.list > as part of the same changeset. However, the T&L folks might not like > that either... Well, the leak is there, and why not have a failing test as a reminder to have it fixed? Sincerely yours, Ivan Gerasimov > > Dan > > > On 7/4/13 6:59 PM, Ivan Gerasimov wrote: >> Thank you, Daniel! >> >> Please find an updated webrev at >> http://cr.openjdk.java.net/~igerasim/8016838/2/webrev/. >> It now includes the RetransformBigClass test modified in the same way >> as RedefineBigClass >> If the changes look fine, may I ask you to sponsor the commit, as I'm >> not a committer? >> Here's a link to hg export: >> http://cr.openjdk.java.net/~igerasim/2commit/8016838-jdk8-ReBigClass-improved.patch >> >> >> Thanks in advance, >> Ivan >> >> On 04.07.2013 21:45, Daniel D. Daugherty wrote: >>> On 7/4/13 11:19 AM, Ivan Gerasimov wrote: >>>> Daniel, thank you for review! >>>> >>>> Here's the updated with all all your suggestions adopted. >>>> http://cr.openjdk.java.net/~igerasim/8016838/1/webrev/ >>> >>> Looks good. >>> >>> >>>> >>>> I haven't yet considered applying the approach to RetransformBigClass. >>>> Do you want me to include this into this same change set or should >>>> I make it separately? >>> >>> I would include it in the same changeset. >>> >>> Dan >>> >>> >>>> >>>> Sincerely yours, >>>> Ivan >>>> >>>> >>>> On 04.07.2013 19:34, Daniel D. Daugherty wrote: >>>>> On 7/3/13 11:12 AM, Ivan Gerasimov wrote: >>>>>> Hello everybody! >>>>>> >>>>>> We have a request to improve jtreg test. >>>>>> The test had been written to verify fix for memory leak during >>>>>> class redefinition. >>>>>> The problem is that it always is reported as PASSED even in the >>>>>> presence of the leak. >>>>>> >>>>>> The proposed change is platform specific. >>>>>> It allows memory leak detection only on Linux. >>>>>> This is because the memory leak was in native code, so there's no >>>>>> easy way to detect it from within Java code. >>>>>> >>>>>> Here's the webrev for JDK8 repository: >>>>>> http://cr.openjdk.java.net/~igerasim/8016838/0/webrev/ >>>>> >>>>> Very nicely done! The logic in RedefineBigClass.sh only catches a >>>>> leak big enough to cause an Exception to be thrown. >>>>> >>>>> When I originally wrote this test and its companion: >>>>> >>>>> test/java/lang/instrument/RetransformBigClass* >>>>> >>>>> I could not come up with a platform independent way to put a small >>>>> upper limit on memory growth. It never dawned on me that putting in >>>>> something on one platform (Linux) was better than nothing. >>>>> >>>>> Are you planning to add this same logic to RetransformBigClass*? >>>>> >>>>> >>>>> >>>>> test/java/lang/instrument/RedefineBigClass.sh >>>>> No comments. >>>>> >>>>> test/java/lang/instrument/RedefineBigClassApp.java >>>>> line 48: final long MEM_LEAK_THRESHOLD = 32 * 1024; // 32Mb >>>>> Would be better at the top of RedefineBigClassApp rather than >>>>> "buried" down here. >>>>> >>>>> line 51: Long.valueOf(vmMemDelta) >>>>> There are several places where a long is passed to >>>>> Long.valueOf(). >>>>> Is there some reason you're not passing them directly to >>>>> println()? >>>>> >>>>> line 54: } else { >>>>> The "else" is redundant due to the "System.exit(1)" call >>>>> above it. >>>>> You can drop the "else {" and "}" and shift that last >>>>> println() to >>>>> the left. >>>>> >>>>> line 71: return Long.parseLong(line.split(" ")[22]) / 1024; >>>>> How about at least a comment referring to the Linux proc(5) >>>>> man page... and the fact that the 23rd field is: >>>>> >>>>> vsize %lu Virtual memory size in bytes. >>>>> >>>>> Again, very nicely done! >>>>> >>>>> Dan >>>>> >>>>> >>>>>> >>>>>> The surprising thing is that modified test detected the leak with >>>>>> the latest JDK8! >>>>>> Latest 6 and 7 are fine, so it might be regression in JDK8. >>>>>> >>>>>> I've filled a bug http://bugs.sun.com/view_bug.do?bug_id=8019845 >>>>>> "Memory leak during class redefenition" (not yet available.) >>>>>> >>>>>> Sincerely yours, >>>>>> Ivan Gerasimov >>>>>> >>>>>> >>>>>> >>>>> >>>>> >>>>> >>>> >>> >>> >>> >> > From sean.coffey at oracle.com Fri Jul 5 11:45:49 2013 From: sean.coffey at oracle.com (=?UTF-8?B?U2XDoW4gQ29mZmV5?=) Date: Fri, 05 Jul 2013 12:45:49 +0100 Subject: RFR [8016838] java/lang/instrument/RedefineBigClass.sh needs modification In-Reply-To: <51D6A59A.1060703@oracle.com> References: <51D45B8C.7010109@oracle.com> <51D595ED.7050902@oracle.com> <51D5AEB6.3060608@oracle.com> <51D5B4C5.7060402@oracle.com> <51D61A66.5010001@oracle.com> <51D64D15.2090105@oracle.com> <51D6A59A.1060703@oracle.com> Message-ID: <51D6B1ED.9090709@oracle.com> Nice work indeed Ivan. Good to have a reliable testcase to catch leaks in this area. I'd also suggest that this test goes on the ProblemList until the new leak is sorted out for jdk8. The goal of JPRT runs is to have clean runs. If it's on the problemList, then it's a known issue and is normally tagged with the relevant bug ID so that the responsible engineer knows the current state. regards, Sean. On 05/07/2013 11:53, Ivan Gerasimov wrote: > > On 05.07.2013 8:35, Daniel D. Daugherty wrote: >> Ivan, >> >> The changes look fine, I can sponsor your commit, looks like your >> OpenJDK user name is 'igerasim', but I need to know a little bit >> more about your testing of these fixes. Did you do a test JPRT >> job to run the JLI tests (or just the two tests themselves)? >> > I've only run test from java/lang/instrument when checked the change > with JDK6u60 (all passed) and with JDK6u51 (the test failed as > expected, since the leak had still been there.) > >> Based on e-mail about this bug fix, I believe you've found a new >> leak in JDK8/HSX-25 with test java/lang/instrument/RedefineBigClass.sh. > Right. The test shown a memleak with the the latest jdk8. > I filed a bug 8019845 about this leak. > Stefan Karlsson guessed that this may be related to 8003419 (NPG: > Clean up metadata created during class loading if failure) > Then I've checked the builds b57 (test failed) and b58 (test passed), > so I confirmed that it may be the reason of the leak being observed now. > But now I think that the reason may be different. > It just turns out that the test shows failures for (at least) three > different leaks - the one you, Daniel, solved (7121600), the one > Stefan wrote about (8003419) and the one currently observed (8019845). > >> That's a good thing, but I think Alan and company would be a bit >> grumpy with me if I pushed a test that failed as soon as someone >> ran it. :-) Do you know if the revised RetransformBigClass.sh also >> finds a new memory leak in JDK8/HSX-25? >> >> The way to deal with that is to put the test on the Problem.list >> as part of the same changeset. However, the T&L folks might not like >> that either... > > Well, the leak is there, and why not have a failing test as a reminder > to have it fixed? > > Sincerely yours, > Ivan Gerasimov > >> >> Dan >> >> >> On 7/4/13 6:59 PM, Ivan Gerasimov wrote: >>> Thank you, Daniel! >>> >>> Please find an updated webrev at >>> http://cr.openjdk.java.net/~igerasim/8016838/2/webrev/. >>> It now includes the RetransformBigClass test modified in the same >>> way as RedefineBigClass >>> If the changes look fine, may I ask you to sponsor the commit, as >>> I'm not a committer? >>> Here's a link to hg export: >>> http://cr.openjdk.java.net/~igerasim/2commit/8016838-jdk8-ReBigClass-improved.patch >>> >>> >>> Thanks in advance, >>> Ivan >>> >>> On 04.07.2013 21:45, Daniel D. Daugherty wrote: >>>> On 7/4/13 11:19 AM, Ivan Gerasimov wrote: >>>>> Daniel, thank you for review! >>>>> >>>>> Here's the updated with all all your suggestions adopted. >>>>> http://cr.openjdk.java.net/~igerasim/8016838/1/webrev/ >>>> >>>> Looks good. >>>> >>>> >>>>> >>>>> I haven't yet considered applying the approach to >>>>> RetransformBigClass. >>>>> Do you want me to include this into this same change set or should >>>>> I make it separately? >>>> >>>> I would include it in the same changeset. >>>> >>>> Dan >>>> >>>> >>>>> >>>>> Sincerely yours, >>>>> Ivan >>>>> >>>>> >>>>> On 04.07.2013 19:34, Daniel D. Daugherty wrote: >>>>>> On 7/3/13 11:12 AM, Ivan Gerasimov wrote: >>>>>>> Hello everybody! >>>>>>> >>>>>>> We have a request to improve jtreg test. >>>>>>> The test had been written to verify fix for memory leak during >>>>>>> class redefinition. >>>>>>> The problem is that it always is reported as PASSED even in the >>>>>>> presence of the leak. >>>>>>> >>>>>>> The proposed change is platform specific. >>>>>>> It allows memory leak detection only on Linux. >>>>>>> This is because the memory leak was in native code, so there's >>>>>>> no easy way to detect it from within Java code. >>>>>>> >>>>>>> Here's the webrev for JDK8 repository: >>>>>>> http://cr.openjdk.java.net/~igerasim/8016838/0/webrev/ >>>>>> >>>>>> Very nicely done! The logic in RedefineBigClass.sh only catches a >>>>>> leak big enough to cause an Exception to be thrown. >>>>>> >>>>>> When I originally wrote this test and its companion: >>>>>> >>>>>> test/java/lang/instrument/RetransformBigClass* >>>>>> >>>>>> I could not come up with a platform independent way to put a small >>>>>> upper limit on memory growth. It never dawned on me that putting in >>>>>> something on one platform (Linux) was better than nothing. >>>>>> >>>>>> Are you planning to add this same logic to RetransformBigClass*? >>>>>> >>>>>> >>>>>> >>>>>> test/java/lang/instrument/RedefineBigClass.sh >>>>>> No comments. >>>>>> >>>>>> test/java/lang/instrument/RedefineBigClassApp.java >>>>>> line 48: final long MEM_LEAK_THRESHOLD = 32 * 1024; // 32Mb >>>>>> Would be better at the top of RedefineBigClassApp rather >>>>>> than >>>>>> "buried" down here. >>>>>> >>>>>> line 51: Long.valueOf(vmMemDelta) >>>>>> There are several places where a long is passed to >>>>>> Long.valueOf(). >>>>>> Is there some reason you're not passing them directly to >>>>>> println()? >>>>>> >>>>>> line 54: } else { >>>>>> The "else" is redundant due to the "System.exit(1)" call >>>>>> above it. >>>>>> You can drop the "else {" and "}" and shift that last >>>>>> println() to >>>>>> the left. >>>>>> >>>>>> line 71: return Long.parseLong(line.split(" ")[22]) / 1024; >>>>>> How about at least a comment referring to the Linux proc(5) >>>>>> man page... and the fact that the 23rd field is: >>>>>> >>>>>> vsize %lu Virtual memory size in bytes. >>>>>> >>>>>> Again, very nicely done! >>>>>> >>>>>> Dan >>>>>> >>>>>> >>>>>>> >>>>>>> The surprising thing is that modified test detected the leak >>>>>>> with the latest JDK8! >>>>>>> Latest 6 and 7 are fine, so it might be regression in JDK8. >>>>>>> >>>>>>> I've filled a bug http://bugs.sun.com/view_bug.do?bug_id=8019845 >>>>>>> "Memory leak during class redefenition" (not yet available.) >>>>>>> >>>>>>> Sincerely yours, >>>>>>> Ivan Gerasimov >>>>>>> >>>>>>> >>>>>>> >>>>>> >>>>>> >>>>>> >>>>> >>>> >>>> >>>> >>> >> > From dmytro_sheyko at hotmail.com Fri Jul 5 11:48:27 2013 From: dmytro_sheyko at hotmail.com (Dmytro Sheyko) Date: Fri, 5 Jul 2013 14:48:27 +0300 Subject: patch: 6646588 : OutputStream.write() IndexOutOfBoundsException condition could be simplified Message-ID: Hello, I would like propose a patch for bug #6646588 OutputStream.write() IndexOutOfBoundsException condition could be simplified http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6646588 1. Range check logic is moved from various streams/readers/writers to IndexOutOfBoundsException. I.e. I replaced code like this ??? if ((off < 0) || (off> b.length) || (len < 0) || ??????????? ((off + len)> b.length) || ((off + len) < 0)) { ??????? throw new IndexOutOfBoundsException(); ??? } with following ??? IndexOutOfBoundsException.checkBounds(b, off, len); 2. Additionally in several places I replaced ??? if (b == null) { ??????? throw new NullPointerException() ??? } with ??? Objects.requireNotNull(b); Note that for method InflaterOutputStream.write() I changed NPE message from "Null buffer for read" to more correct (in my opinion) "Null buffer for write". It seems that this message with surrounding code was just copy-pasted from DeflaterInputStream.read(). 3. In PushbackReader I removed ??? } catch (ArrayIndexOfBoundsException e) { ??????? throw new IndexOfBoundsException(); ??? } I believe this catch is unnecessary because (a) range is already checked above and System.arraycopy should not fail and (b) ArrayIndexOfBoundsException is subclass of IndexOfBoundsException, so even if AIOBE happens there is nothing wrong to let it go farther. Thus many trivial changes are made in following packages: java.io.* java.util.zip.* sun.** jtreg test for IndexOutOfBoundsException.checkBounds(...) is also attached. Please review. Regards, Dmytro From joel.franck at oracle.com Fri Jul 5 14:04:48 2013 From: joel.franck at oracle.com (=?iso-8859-1?Q?Joel_Borggr=E9n-Franck?=) Date: Fri, 5 Jul 2013 16:04:48 +0200 Subject: 7122142 : (ann) Race condition between isAnnotationPresent and getAnnotations In-Reply-To: <51D68DED.2030308@gmail.com> References: <51C1BEC6.1080308@gmail.com> <51C1FE64.3020000@oracle.com> <51C88EBF.9020704@gmail.com> <51D43A72.8090508@oracle.com> <51D5895B.5020006@gmail.com> <51D68489.2020000@gmail.com> <51D68DED.2030308@gmail.com> Message-ID: Hi Peter, Thanks for the quick update! While I have looked over the changes to j.l.Class and the cas in AnnotationType I don't think I'm qualified to review that. (FWIW it looked fine to me but my jmm isn't swapped in at the moment so I won't pretend to know the interactions between volatile and Unsafe cas). Thinking out loud I suppose we can assume a stable offset of fields in Class, and I realize that part has been under review before. The rest of AnnotationType, AnnotationParser and the tests look fine though. I also ran the tests before and after the change and results were as expected. Since I'm not a Reviewer kind of reviewer you need to get one those to sign off but after that I think you are good to go. I can sponsor this as well if Alan is busy. cheers /Joel On 5 jul 2013, at 11:12, Peter Levart wrote: > Hi Again, > > Sorry, the 4th revision I posted is not rebased to the current tip of jdk8-tl so it contained some diffs that reverted some things. > > Here's the correct patch: > > http://cr.openjdk.java.net/~plevart/jdk8-tl/AnnotationType/webrev.05/ > > > Regards, Peter > > > On 07/05/2013 10:32 AM, Peter Levart wrote: >> Hi Joel, >> >> Here's the 4th revision of the patch: >> >> http://cr.openjdk.java.net/~plevart/jdk8-tl/AnnotationType/webrev.04/ >> >> This one introduces CAS-ing of the AnnotationType instance into the Class.annotationType field so that there's only a single instance ever returned for a single Class. I also introduced new private static Class.Atomic nested class that is used to lazily initialize Unsafe machinery and to provide a safe wrapper for internal j.l.Class use. Previously this was part of ReflectionData nested class because it was only used for it's purpose. In anticipation to have a need for more atomic operations in the future, I moved this code to a separate class. ReflectionData is now just a record. >> >> Regards, Peter > From erik.helin at oracle.com Fri Jul 5 14:08:05 2013 From: erik.helin at oracle.com (Erik Helin) Date: Fri, 5 Jul 2013 16:08:05 +0200 Subject: RFR: 8010734: NPG: The test MemoryTest.java needs to be updated to support metaspace In-Reply-To: <20130701153520.GF2213@ehelin-thinkpad> References: <20130701153520.GF2213@ehelin-thinkpad> Message-ID: <20130705140805.GC14318@ehelin-thinkpad> Hi all, still looking for a review for this testfix. Looping in hotspot-gc-dev at openjdk.java.net as well. Thanks, Erik On 2013-07-01, Erik Helin wrote: > Hi all, > > this change updates MemoryTest.java to take the newly added Metaspace > and Compressed Class Space MemoryMXBeans into account, as well as the > new Metaspace Memory Manager. > > This change also removes the following two tests from ProblemList.txt > since they are now passing again: > -java/lang/management/MemoryMXBean/MemoryTestAllGC.sh generic-all > -java/lang/management/MemoryMXBean/MemoryTest.java generic-all > > Webrev: http://cr.openjdk.java.net/~ehelin/8010734/webrev.00/ > > Thanks, > Erik From Alan.Bateman at oracle.com Fri Jul 5 14:27:36 2013 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Fri, 05 Jul 2013 15:27:36 +0100 Subject: RFR: 8010734: NPG: The test MemoryTest.java needs to be updated to support metaspace In-Reply-To: <20130705140805.GC14318@ehelin-thinkpad> References: <20130701153520.GF2213@ehelin-thinkpad> <20130705140805.GC14318@ehelin-thinkpad> Message-ID: <51D6D7D8.5080809@oracle.com> On 05/07/2013 15:08, Erik Helin wrote: > Hi all, > > still looking for a review for this testfix. Looping in > hotspot-gc-dev at openjdk.java.net as well. > It looks like okay to me and the comments make it clear the memory pools that it expects. -Alan From paul.sandoz at oracle.com Fri Jul 5 16:10:15 2013 From: paul.sandoz at oracle.com (Paul Sandoz) Date: Fri, 5 Jul 2013 18:10:15 +0200 Subject: RFR 8017447 Unmodifiable map entry becomes modifiable if taken from a stream of map entries Message-ID: <06D6490B-CD68-433D-9348-041BB3C8D903@oracle.com> Hi, Please review a patch that fixes traversal of unmodifiable map entry set where entries could be set: http://cr.openjdk.java.net/~psandoz/tl/JDK-8017447-unmod-map/webrev/jdk.patch This covers forEach, spliterator (splitting, tryAdvance, forEachRemaining), iterator forEachRemaining, stream/parallelStream forEach with instances of Map and SortedMap. Note that there are other changes which will follow later on to Collections that update implementations with stream/parallelStream methods Paul. From sean.mullan at oracle.com Fri Jul 5 21:16:21 2013 From: sean.mullan at oracle.com (sean.mullan at oracle.com) Date: Fri, 05 Jul 2013 21:16:21 +0000 Subject: hg: jdk8/tl/jdk: 2 new changesets Message-ID: <20130705211658.8363648850@hg.openjdk.java.net> Changeset: 028ef97797c1 Author: mullan Date: 2013-07-05 15:54 -0400 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/028ef97797c1 8011547: Update XML Signature implementation to Apache Santuario 1.5.4 Reviewed-by: xuelei ! src/share/classes/com/sun/org/apache/xml/internal/security/algorithms/Algorithm.java ! src/share/classes/com/sun/org/apache/xml/internal/security/algorithms/JCEMapper.java ! src/share/classes/com/sun/org/apache/xml/internal/security/algorithms/MessageDigestAlgorithm.java ! src/share/classes/com/sun/org/apache/xml/internal/security/algorithms/SignatureAlgorithm.java ! src/share/classes/com/sun/org/apache/xml/internal/security/algorithms/SignatureAlgorithmSpi.java ! src/share/classes/com/sun/org/apache/xml/internal/security/algorithms/implementations/IntegrityHmac.java ! src/share/classes/com/sun/org/apache/xml/internal/security/algorithms/implementations/SignatureBaseRSA.java ! src/share/classes/com/sun/org/apache/xml/internal/security/algorithms/implementations/SignatureDSA.java ! src/share/classes/com/sun/org/apache/xml/internal/security/algorithms/implementations/SignatureECDSA.java ! src/share/classes/com/sun/org/apache/xml/internal/security/c14n/CanonicalizationException.java ! src/share/classes/com/sun/org/apache/xml/internal/security/c14n/Canonicalizer.java ! src/share/classes/com/sun/org/apache/xml/internal/security/c14n/CanonicalizerSpi.java ! src/share/classes/com/sun/org/apache/xml/internal/security/c14n/InvalidCanonicalizerException.java ! src/share/classes/com/sun/org/apache/xml/internal/security/c14n/helper/AttrCompare.java ! src/share/classes/com/sun/org/apache/xml/internal/security/c14n/helper/C14nHelper.java ! src/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/Canonicalizer11.java ! src/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/Canonicalizer11_OmitComments.java ! src/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/Canonicalizer11_WithComments.java ! src/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/Canonicalizer20010315.java ! src/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/Canonicalizer20010315Excl.java ! src/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/Canonicalizer20010315ExclOmitComments.java ! src/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/Canonicalizer20010315ExclWithComments.java ! src/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/Canonicalizer20010315OmitComments.java ! src/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/Canonicalizer20010315WithComments.java ! src/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/CanonicalizerBase.java + src/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/CanonicalizerPhysical.java ! src/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/NameSpaceSymbTable.java ! src/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/UtfHelpper.java + src/share/classes/com/sun/org/apache/xml/internal/security/encryption/AbstractSerializer.java ! src/share/classes/com/sun/org/apache/xml/internal/security/encryption/AgreementMethod.java ! src/share/classes/com/sun/org/apache/xml/internal/security/encryption/CipherData.java ! src/share/classes/com/sun/org/apache/xml/internal/security/encryption/CipherReference.java ! src/share/classes/com/sun/org/apache/xml/internal/security/encryption/CipherValue.java + src/share/classes/com/sun/org/apache/xml/internal/security/encryption/DocumentSerializer.java ! src/share/classes/com/sun/org/apache/xml/internal/security/encryption/EncryptedData.java ! src/share/classes/com/sun/org/apache/xml/internal/security/encryption/EncryptedKey.java ! src/share/classes/com/sun/org/apache/xml/internal/security/encryption/EncryptedType.java ! src/share/classes/com/sun/org/apache/xml/internal/security/encryption/EncryptionMethod.java ! src/share/classes/com/sun/org/apache/xml/internal/security/encryption/EncryptionProperties.java ! src/share/classes/com/sun/org/apache/xml/internal/security/encryption/EncryptionProperty.java ! src/share/classes/com/sun/org/apache/xml/internal/security/encryption/Reference.java ! src/share/classes/com/sun/org/apache/xml/internal/security/encryption/ReferenceList.java + src/share/classes/com/sun/org/apache/xml/internal/security/encryption/Serializer.java ! src/share/classes/com/sun/org/apache/xml/internal/security/encryption/Transforms.java ! src/share/classes/com/sun/org/apache/xml/internal/security/encryption/XMLCipher.java ! src/share/classes/com/sun/org/apache/xml/internal/security/encryption/XMLCipherInput.java ! src/share/classes/com/sun/org/apache/xml/internal/security/encryption/XMLCipherParameters.java ! src/share/classes/com/sun/org/apache/xml/internal/security/encryption/XMLEncryptionException.java ! src/share/classes/com/sun/org/apache/xml/internal/security/exceptions/AlgorithmAlreadyRegisteredException.java ! src/share/classes/com/sun/org/apache/xml/internal/security/exceptions/Base64DecodingException.java ! src/share/classes/com/sun/org/apache/xml/internal/security/exceptions/XMLSecurityException.java ! src/share/classes/com/sun/org/apache/xml/internal/security/exceptions/XMLSecurityRuntimeException.java ! src/share/classes/com/sun/org/apache/xml/internal/security/keys/ContentHandlerAlreadyRegisteredException.java ! src/share/classes/com/sun/org/apache/xml/internal/security/keys/KeyInfo.java ! src/share/classes/com/sun/org/apache/xml/internal/security/keys/KeyUtils.java + src/share/classes/com/sun/org/apache/xml/internal/security/keys/content/DEREncodedKeyValue.java ! src/share/classes/com/sun/org/apache/xml/internal/security/keys/content/KeyInfoContent.java + src/share/classes/com/sun/org/apache/xml/internal/security/keys/content/KeyInfoReference.java ! src/share/classes/com/sun/org/apache/xml/internal/security/keys/content/KeyName.java ! src/share/classes/com/sun/org/apache/xml/internal/security/keys/content/KeyValue.java ! src/share/classes/com/sun/org/apache/xml/internal/security/keys/content/MgmtData.java ! src/share/classes/com/sun/org/apache/xml/internal/security/keys/content/PGPData.java ! src/share/classes/com/sun/org/apache/xml/internal/security/keys/content/RetrievalMethod.java ! src/share/classes/com/sun/org/apache/xml/internal/security/keys/content/SPKIData.java ! src/share/classes/com/sun/org/apache/xml/internal/security/keys/content/X509Data.java ! src/share/classes/com/sun/org/apache/xml/internal/security/keys/content/keyvalues/DSAKeyValue.java ! src/share/classes/com/sun/org/apache/xml/internal/security/keys/content/keyvalues/KeyValueContent.java ! src/share/classes/com/sun/org/apache/xml/internal/security/keys/content/keyvalues/RSAKeyValue.java ! src/share/classes/com/sun/org/apache/xml/internal/security/keys/content/x509/XMLX509CRL.java ! src/share/classes/com/sun/org/apache/xml/internal/security/keys/content/x509/XMLX509Certificate.java ! src/share/classes/com/sun/org/apache/xml/internal/security/keys/content/x509/XMLX509DataContent.java + src/share/classes/com/sun/org/apache/xml/internal/security/keys/content/x509/XMLX509Digest.java ! src/share/classes/com/sun/org/apache/xml/internal/security/keys/content/x509/XMLX509IssuerSerial.java ! src/share/classes/com/sun/org/apache/xml/internal/security/keys/content/x509/XMLX509SKI.java ! src/share/classes/com/sun/org/apache/xml/internal/security/keys/content/x509/XMLX509SubjectName.java ! src/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/InvalidKeyResolverException.java ! src/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/KeyResolver.java ! src/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/KeyResolverException.java ! src/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/KeyResolverSpi.java + src/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/implementations/DEREncodedKeyValueResolver.java ! src/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/implementations/DSAKeyValueResolver.java ! src/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/implementations/EncryptedKeyResolver.java + src/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/implementations/KeyInfoReferenceResolver.java + src/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/implementations/PrivateKeyResolver.java ! src/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/implementations/RSAKeyValueResolver.java ! src/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/implementations/RetrievalMethodResolver.java + src/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/implementations/SecretKeyResolver.java + src/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/implementations/SingleKeyResolver.java ! src/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/implementations/X509CertificateResolver.java + src/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/implementations/X509DigestResolver.java ! src/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/implementations/X509IssuerSerialResolver.java ! src/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/implementations/X509SKIResolver.java ! src/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/implementations/X509SubjectNameResolver.java ! src/share/classes/com/sun/org/apache/xml/internal/security/keys/storage/StorageResolver.java ! src/share/classes/com/sun/org/apache/xml/internal/security/keys/storage/StorageResolverException.java ! src/share/classes/com/sun/org/apache/xml/internal/security/keys/storage/StorageResolverSpi.java ! src/share/classes/com/sun/org/apache/xml/internal/security/keys/storage/implementations/CertsInFilesystemDirectoryResolver.java ! src/share/classes/com/sun/org/apache/xml/internal/security/keys/storage/implementations/KeyStoreResolver.java ! src/share/classes/com/sun/org/apache/xml/internal/security/keys/storage/implementations/SingleCertificateResolver.java ! src/share/classes/com/sun/org/apache/xml/internal/security/resource/config.xml - src/share/classes/com/sun/org/apache/xml/internal/security/resource/log4j.properties ! src/share/classes/com/sun/org/apache/xml/internal/security/resource/xmlsecurity_de.properties ! src/share/classes/com/sun/org/apache/xml/internal/security/resource/xmlsecurity_en.properties ! src/share/classes/com/sun/org/apache/xml/internal/security/signature/InvalidDigestValueException.java ! src/share/classes/com/sun/org/apache/xml/internal/security/signature/InvalidSignatureValueException.java ! src/share/classes/com/sun/org/apache/xml/internal/security/signature/Manifest.java ! src/share/classes/com/sun/org/apache/xml/internal/security/signature/MissingResourceFailureException.java ! src/share/classes/com/sun/org/apache/xml/internal/security/signature/NodeFilter.java ! src/share/classes/com/sun/org/apache/xml/internal/security/signature/ObjectContainer.java ! src/share/classes/com/sun/org/apache/xml/internal/security/signature/Reference.java ! src/share/classes/com/sun/org/apache/xml/internal/security/signature/ReferenceNotInitializedException.java ! src/share/classes/com/sun/org/apache/xml/internal/security/signature/SignatureProperties.java ! src/share/classes/com/sun/org/apache/xml/internal/security/signature/SignatureProperty.java ! src/share/classes/com/sun/org/apache/xml/internal/security/signature/SignedInfo.java ! src/share/classes/com/sun/org/apache/xml/internal/security/signature/XMLSignature.java ! src/share/classes/com/sun/org/apache/xml/internal/security/signature/XMLSignatureException.java ! src/share/classes/com/sun/org/apache/xml/internal/security/signature/XMLSignatureInput.java ! src/share/classes/com/sun/org/apache/xml/internal/security/signature/XMLSignatureInputDebugger.java + src/share/classes/com/sun/org/apache/xml/internal/security/signature/reference/ReferenceData.java + src/share/classes/com/sun/org/apache/xml/internal/security/signature/reference/ReferenceNodeSetData.java + src/share/classes/com/sun/org/apache/xml/internal/security/signature/reference/ReferenceOctetStreamData.java + src/share/classes/com/sun/org/apache/xml/internal/security/signature/reference/ReferenceSubTreeData.java ! src/share/classes/com/sun/org/apache/xml/internal/security/transforms/InvalidTransformException.java ! src/share/classes/com/sun/org/apache/xml/internal/security/transforms/Transform.java ! src/share/classes/com/sun/org/apache/xml/internal/security/transforms/TransformParam.java ! src/share/classes/com/sun/org/apache/xml/internal/security/transforms/TransformSpi.java ! src/share/classes/com/sun/org/apache/xml/internal/security/transforms/TransformationException.java ! src/share/classes/com/sun/org/apache/xml/internal/security/transforms/Transforms.java ! src/share/classes/com/sun/org/apache/xml/internal/security/transforms/implementations/FuncHere.java - src/share/classes/com/sun/org/apache/xml/internal/security/transforms/implementations/FuncHereContext.java ! src/share/classes/com/sun/org/apache/xml/internal/security/transforms/implementations/TransformBase64Decode.java ! src/share/classes/com/sun/org/apache/xml/internal/security/transforms/implementations/TransformC14N.java ! src/share/classes/com/sun/org/apache/xml/internal/security/transforms/implementations/TransformC14N11.java ! src/share/classes/com/sun/org/apache/xml/internal/security/transforms/implementations/TransformC14N11_WithComments.java ! src/share/classes/com/sun/org/apache/xml/internal/security/transforms/implementations/TransformC14NExclusive.java ! src/share/classes/com/sun/org/apache/xml/internal/security/transforms/implementations/TransformC14NExclusiveWithComments.java ! src/share/classes/com/sun/org/apache/xml/internal/security/transforms/implementations/TransformC14NWithComments.java ! src/share/classes/com/sun/org/apache/xml/internal/security/transforms/implementations/TransformEnvelopedSignature.java ! src/share/classes/com/sun/org/apache/xml/internal/security/transforms/implementations/TransformXPath.java ! src/share/classes/com/sun/org/apache/xml/internal/security/transforms/implementations/TransformXPath2Filter.java ! src/share/classes/com/sun/org/apache/xml/internal/security/transforms/implementations/TransformXPointer.java ! src/share/classes/com/sun/org/apache/xml/internal/security/transforms/implementations/TransformXSLT.java ! src/share/classes/com/sun/org/apache/xml/internal/security/transforms/params/InclusiveNamespaces.java ! src/share/classes/com/sun/org/apache/xml/internal/security/transforms/params/XPath2FilterContainer.java ! src/share/classes/com/sun/org/apache/xml/internal/security/transforms/params/XPath2FilterContainer04.java ! src/share/classes/com/sun/org/apache/xml/internal/security/transforms/params/XPathContainer.java ! src/share/classes/com/sun/org/apache/xml/internal/security/transforms/params/XPathFilterCHGPContainer.java ! src/share/classes/com/sun/org/apache/xml/internal/security/utils/Base64.java - src/share/classes/com/sun/org/apache/xml/internal/security/utils/CachedXPathAPIHolder.java - src/share/classes/com/sun/org/apache/xml/internal/security/utils/CachedXPathFuncHereAPI.java + src/share/classes/com/sun/org/apache/xml/internal/security/utils/ClassLoaderUtils.java ! src/share/classes/com/sun/org/apache/xml/internal/security/utils/Constants.java + src/share/classes/com/sun/org/apache/xml/internal/security/utils/DOMNamespaceContext.java ! src/share/classes/com/sun/org/apache/xml/internal/security/utils/DigesterOutputStream.java ! src/share/classes/com/sun/org/apache/xml/internal/security/utils/ElementChecker.java ! src/share/classes/com/sun/org/apache/xml/internal/security/utils/ElementCheckerImpl.java ! src/share/classes/com/sun/org/apache/xml/internal/security/utils/ElementProxy.java ! src/share/classes/com/sun/org/apache/xml/internal/security/utils/EncryptionConstants.java ! src/share/classes/com/sun/org/apache/xml/internal/security/utils/EncryptionElementProxy.java ! src/share/classes/com/sun/org/apache/xml/internal/security/utils/HelperNodeList.java ! src/share/classes/com/sun/org/apache/xml/internal/security/utils/IdResolver.java ! src/share/classes/com/sun/org/apache/xml/internal/security/utils/IgnoreAllErrorHandler.java + src/share/classes/com/sun/org/apache/xml/internal/security/utils/JDKXPathAPI.java + src/share/classes/com/sun/org/apache/xml/internal/security/utils/JDKXPathFactory.java ! src/share/classes/com/sun/org/apache/xml/internal/security/utils/JavaUtils.java ! src/share/classes/com/sun/org/apache/xml/internal/security/utils/RFC2253Parser.java + src/share/classes/com/sun/org/apache/xml/internal/security/utils/Signature11ElementProxy.java ! src/share/classes/com/sun/org/apache/xml/internal/security/utils/SignatureElementProxy.java ! src/share/classes/com/sun/org/apache/xml/internal/security/utils/SignerOutputStream.java ! src/share/classes/com/sun/org/apache/xml/internal/security/utils/UnsyncBufferedOutputStream.java ! src/share/classes/com/sun/org/apache/xml/internal/security/utils/UnsyncByteArrayOutputStream.java ! src/share/classes/com/sun/org/apache/xml/internal/security/utils/XMLUtils.java + src/share/classes/com/sun/org/apache/xml/internal/security/utils/XPathAPI.java + src/share/classes/com/sun/org/apache/xml/internal/security/utils/XPathFactory.java - src/share/classes/com/sun/org/apache/xml/internal/security/utils/XPathFuncHereAPI.java + src/share/classes/com/sun/org/apache/xml/internal/security/utils/XalanXPathAPI.java + src/share/classes/com/sun/org/apache/xml/internal/security/utils/XalanXPathFactory.java ! src/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/ResourceResolver.java + src/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/ResourceResolverContext.java ! src/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/ResourceResolverException.java ! src/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/ResourceResolverSpi.java ! src/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/implementations/ResolverAnonymous.java ! src/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/implementations/ResolverDirectHTTP.java ! src/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/implementations/ResolverFragment.java ! src/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/implementations/ResolverLocalFilesystem.java ! src/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/implementations/ResolverXPointer.java ! src/share/classes/org/jcp/xml/dsig/internal/DigesterOutputStream.java ! src/share/classes/org/jcp/xml/dsig/internal/MacOutputStream.java ! src/share/classes/org/jcp/xml/dsig/internal/SignerOutputStream.java + src/share/classes/org/jcp/xml/dsig/internal/dom/AbstractDOMSignatureMethod.java ! src/share/classes/org/jcp/xml/dsig/internal/dom/ApacheCanonicalizer.java ! src/share/classes/org/jcp/xml/dsig/internal/dom/ApacheData.java ! src/share/classes/org/jcp/xml/dsig/internal/dom/ApacheNodeSetData.java ! src/share/classes/org/jcp/xml/dsig/internal/dom/ApacheOctetStreamData.java ! src/share/classes/org/jcp/xml/dsig/internal/dom/ApacheTransform.java ! src/share/classes/org/jcp/xml/dsig/internal/dom/DOMBase64Transform.java ! src/share/classes/org/jcp/xml/dsig/internal/dom/DOMCanonicalXMLC14N11Method.java ! src/share/classes/org/jcp/xml/dsig/internal/dom/DOMCanonicalXMLC14NMethod.java ! src/share/classes/org/jcp/xml/dsig/internal/dom/DOMCanonicalizationMethod.java ! src/share/classes/org/jcp/xml/dsig/internal/dom/DOMCryptoBinary.java ! src/share/classes/org/jcp/xml/dsig/internal/dom/DOMDigestMethod.java ! src/share/classes/org/jcp/xml/dsig/internal/dom/DOMEnvelopedTransform.java ! src/share/classes/org/jcp/xml/dsig/internal/dom/DOMExcC14NMethod.java ! src/share/classes/org/jcp/xml/dsig/internal/dom/DOMHMACSignatureMethod.java ! src/share/classes/org/jcp/xml/dsig/internal/dom/DOMKeyInfo.java ! src/share/classes/org/jcp/xml/dsig/internal/dom/DOMKeyInfoFactory.java ! src/share/classes/org/jcp/xml/dsig/internal/dom/DOMKeyName.java ! src/share/classes/org/jcp/xml/dsig/internal/dom/DOMKeyValue.java ! src/share/classes/org/jcp/xml/dsig/internal/dom/DOMManifest.java ! src/share/classes/org/jcp/xml/dsig/internal/dom/DOMPGPData.java ! src/share/classes/org/jcp/xml/dsig/internal/dom/DOMReference.java ! src/share/classes/org/jcp/xml/dsig/internal/dom/DOMRetrievalMethod.java ! src/share/classes/org/jcp/xml/dsig/internal/dom/DOMSignatureMethod.java ! src/share/classes/org/jcp/xml/dsig/internal/dom/DOMSignatureProperties.java ! src/share/classes/org/jcp/xml/dsig/internal/dom/DOMSignatureProperty.java ! src/share/classes/org/jcp/xml/dsig/internal/dom/DOMSignedInfo.java ! src/share/classes/org/jcp/xml/dsig/internal/dom/DOMStructure.java ! src/share/classes/org/jcp/xml/dsig/internal/dom/DOMSubTreeData.java ! src/share/classes/org/jcp/xml/dsig/internal/dom/DOMTransform.java ! src/share/classes/org/jcp/xml/dsig/internal/dom/DOMURIDereferencer.java ! src/share/classes/org/jcp/xml/dsig/internal/dom/DOMUtils.java ! src/share/classes/org/jcp/xml/dsig/internal/dom/DOMX509Data.java ! src/share/classes/org/jcp/xml/dsig/internal/dom/DOMX509IssuerSerial.java ! src/share/classes/org/jcp/xml/dsig/internal/dom/DOMXMLObject.java ! src/share/classes/org/jcp/xml/dsig/internal/dom/DOMXMLSignature.java ! src/share/classes/org/jcp/xml/dsig/internal/dom/DOMXMLSignatureFactory.java ! src/share/classes/org/jcp/xml/dsig/internal/dom/DOMXPathFilter2Transform.java ! src/share/classes/org/jcp/xml/dsig/internal/dom/DOMXPathTransform.java ! src/share/classes/org/jcp/xml/dsig/internal/dom/DOMXSLTTransform.java ! src/share/classes/org/jcp/xml/dsig/internal/dom/Utils.java ! src/share/classes/org/jcp/xml/dsig/internal/dom/XMLDSigRI.java Changeset: e3208dbf6926 Author: mullan Date: 2013-07-05 16:30 -0400 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/e3208dbf6926 Merge - src/share/classes/java/security/acl/package.html - src/share/classes/java/security/cert/package.html - src/share/classes/java/security/interfaces/package.html - src/share/classes/java/security/package.html - src/share/classes/java/security/spec/package.html - src/share/classes/sun/security/krb5/internal/rcache/CacheTable.java - src/share/classes/sun/security/krb5/internal/rcache/ReplayCache.java - test/java/util/Comparators/BasicTest.java - test/sun/security/krb5/auto/ReplayCache.java From henry.jen at oracle.com Fri Jul 5 21:37:41 2013 From: henry.jen at oracle.com (Henry Jen) Date: Fri, 05 Jul 2013 14:37:41 -0700 Subject: RFR: 8015317: Optional.filter, map, and flatMap Message-ID: <51D73CA5.50005@oracle.com> Hi, Please review the webrev at http://cr.openjdk.java.net/~henryjen/ccc/8015317.0/webrev/ Which adds following method to Optional, public static Optional ofNullable(T value) {} public Optional filter(Predicate predicate) {} public Optional map(Function mapper) {} public Optional flatMap(Function> mapper) {} Also included is some cleanup on javadoc. Cheers, Henry From lana.steuck at oracle.com Fri Jul 5 21:40:23 2013 From: lana.steuck at oracle.com (lana.steuck at oracle.com) Date: Fri, 05 Jul 2013 21:40:23 +0000 Subject: hg: jdk8/tl/corba: Added tag jdk8-b97 for changeset 469995a8e974 Message-ID: <20130705214025.361BE48859@hg.openjdk.java.net> Changeset: 3370fb6146e4 Author: cl Date: 2013-07-04 01:00 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/corba/rev/3370fb6146e4 Added tag jdk8-b97 for changeset 469995a8e974 ! .hgtags From lana.steuck at oracle.com Fri Jul 5 21:40:29 2013 From: lana.steuck at oracle.com (lana.steuck at oracle.com) Date: Fri, 05 Jul 2013 21:40:29 +0000 Subject: hg: jdk8/tl/nashorn: 2 new changesets Message-ID: <20130705214032.7F3144885B@hg.openjdk.java.net> Changeset: da63a99481da Author: cl Date: 2013-07-04 01:01 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/da63a99481da Added tag jdk8-b97 for changeset 1bf1d6ce3042 ! .hgtags Changeset: 542b7803f038 Author: lana Date: 2013-07-05 11:05 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/542b7803f038 Merge From lana.steuck at oracle.com Fri Jul 5 21:40:32 2013 From: lana.steuck at oracle.com (lana.steuck at oracle.com) Date: Fri, 05 Jul 2013 21:40:32 +0000 Subject: hg: jdk8/tl/jaxws: Added tag jdk8-b97 for changeset dcde7f049111 Message-ID: <20130705214036.0BA464885C@hg.openjdk.java.net> Changeset: b1fb4612a2ca Author: cl Date: 2013-07-04 01:00 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jaxws/rev/b1fb4612a2ca Added tag jdk8-b97 for changeset dcde7f049111 ! .hgtags From lana.steuck at oracle.com Fri Jul 5 21:40:28 2013 From: lana.steuck at oracle.com (lana.steuck at oracle.com) Date: Fri, 05 Jul 2013 21:40:28 +0000 Subject: hg: jdk8/tl: 9 new changesets Message-ID: <20130705214029.033E44885A@hg.openjdk.java.net> Changeset: f5eb23490e6a Author: erikj Date: 2013-06-27 09:27 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/rev/f5eb23490e6a 8017047: Can't use --with-java-devtools and --with-devkit at the same time Reviewed-by: tbell ! common/autoconf/basics.m4 ! common/autoconf/generated-configure.sh ! common/autoconf/toolchain.m4 Changeset: e5cf1735638c Author: erikj Date: 2013-06-28 11:55 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/rev/e5cf1735638c 8016605: New files dont apear in src.zip Reviewed-by: tbell ! common/makefiles/JavaCompilation.gmk Changeset: 0871b5799149 Author: erikj Date: 2013-06-28 11:58 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/rev/0871b5799149 8019229: Build Configuration Fail in Windows Platform Reviewed-by: chegar, tbell, dxu ! common/autoconf/generated-configure.sh ! common/autoconf/toolchain.m4 Changeset: 0e533ceee717 Author: erikj Date: 2013-06-28 12:00 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/rev/0e533ceee717 8016303: make CONF= isn't working Reviewed-by: tbell ! NewMakefile.gmk Changeset: 78aaf5d3314d Author: erikj Date: 2013-06-28 12:02 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/rev/78aaf5d3314d 8010385: build with LOG=trace broken on mac Reviewed-by: dholmes, tbell, prr ! common/autoconf/basics.m4 ! common/autoconf/generated-configure.sh ! common/autoconf/spec.gmk.in ! common/makefiles/MakeBase.gmk Changeset: dd3b314f4471 Author: erikj Date: 2013-07-01 15:40 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/rev/dd3b314f4471 8009744: build-infra: REGRESSION: Publisher was NOT set for some JDK files Reviewed-by: tbell ! common/autoconf/generated-configure.sh ! common/autoconf/toolchain.m4 Changeset: b2b87e9e8683 Author: erikj Date: 2013-07-02 15:07 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/rev/b2b87e9e8683 8019537: jdk8-build prebuild fails in source bundle generation, The path of TOOLS_DIR ... is not found Reviewed-by: tbell ! common/autoconf/basics.m4 ! common/autoconf/generated-configure.sh Changeset: a1c1e8bf71f3 Author: katleman Date: 2013-07-02 15:55 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/rev/a1c1e8bf71f3 Merge Changeset: 99ad803f8c4e Author: cl Date: 2013-07-04 01:00 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/rev/99ad803f8c4e Added tag jdk8-b97 for changeset a1c1e8bf71f3 ! .hgtags From lana.steuck at oracle.com Fri Jul 5 21:40:33 2013 From: lana.steuck at oracle.com (lana.steuck at oracle.com) Date: Fri, 05 Jul 2013 21:40:33 +0000 Subject: hg: jdk8/tl/jaxp: 3 new changesets Message-ID: <20130705214043.3469B4885D@hg.openjdk.java.net> Changeset: c96691d84a7c Author: katleman Date: 2013-06-28 16:25 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jaxp/rev/c96691d84a7c 8019347: JDK8 b96 source with GPL header errors Reviewed-by: iris, alanb, lancea ! src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_de.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_es.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_fr.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_it.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_ja.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_ko.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_pt_BR.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_sv.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_zh_CN.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_zh_TW.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_de.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_es.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_fr.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_it.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_ja.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_ko.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_pt_BR.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_sv.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_zh_CN.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_zh_TW.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_de.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_es.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_fr.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_it.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_ja.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_ko.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_pt_BR.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_sv.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_zh_CN.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_zh_TW.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_de.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_es.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_fr.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_it.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_ja.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_ko.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_pt_BR.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_sv.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_zh_CN.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_zh_TW.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_de.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_es.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_fr.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_it.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_ja.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_ko.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_pt_BR.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_sv.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_zh_CN.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_zh_TW.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_de.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_es.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_fr.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_it.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_ja.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_ko.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_pt_BR.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_sv.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_zh_CN.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_zh_TW.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_de.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_es.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_fr.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_it.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_ja.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_ko.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_pt_BR.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_sv.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_zh_CN.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_zh_TW.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_de.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_es.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_fr.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_it.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_ja.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_ko.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_pt_BR.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_sv.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_zh_CN.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_zh_TW.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_de.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_es.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_fr.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_it.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_ja.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_ko.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_pt_BR.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_sv.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_zh_CN.properties ! src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_zh_TW.properties ! src/com/sun/org/apache/xerces/internal/impl/xpath/regex/message_de.properties ! src/com/sun/org/apache/xerces/internal/impl/xpath/regex/message_es.properties ! src/com/sun/org/apache/xerces/internal/impl/xpath/regex/message_fr.properties ! src/com/sun/org/apache/xerces/internal/impl/xpath/regex/message_it.properties ! src/com/sun/org/apache/xerces/internal/impl/xpath/regex/message_ja.properties ! src/com/sun/org/apache/xerces/internal/impl/xpath/regex/message_ko.properties ! src/com/sun/org/apache/xerces/internal/impl/xpath/regex/message_pt_BR.properties ! src/com/sun/org/apache/xerces/internal/impl/xpath/regex/message_sv.properties ! src/com/sun/org/apache/xerces/internal/impl/xpath/regex/message_zh_CN.properties ! src/com/sun/org/apache/xerces/internal/impl/xpath/regex/message_zh_TW.properties Changeset: 6c830db28d21 Author: katleman Date: 2013-07-02 15:55 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jaxp/rev/6c830db28d21 Merge Changeset: 15e5bb51bc0c Author: cl Date: 2013-07-04 01:00 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jaxp/rev/15e5bb51bc0c Added tag jdk8-b97 for changeset 6c830db28d21 ! .hgtags From lana.steuck at oracle.com Fri Jul 5 21:40:32 2013 From: lana.steuck at oracle.com (lana.steuck at oracle.com) Date: Fri, 05 Jul 2013 21:40:32 +0000 Subject: hg: jdk8/tl/langtools: 3 new changesets Message-ID: <20130705214045.302BB4885E@hg.openjdk.java.net> Changeset: 2364e94ae67b Author: cl Date: 2013-07-04 01:01 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/2364e94ae67b Added tag jdk8-b97 for changeset 6a11a81a8824 ! .hgtags Changeset: ce5a90df517b Author: lana Date: 2013-07-05 11:06 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/ce5a90df517b Merge Changeset: 49654c9c705b Author: lana Date: 2013-07-05 13:29 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/49654c9c705b Merge From lana.steuck at oracle.com Fri Jul 5 21:40:39 2013 From: lana.steuck at oracle.com (lana.steuck at oracle.com) Date: Fri, 05 Jul 2013 21:40:39 +0000 Subject: hg: jdk8/tl/hotspot: 26 new changesets Message-ID: <20130705214136.249194885F@hg.openjdk.java.net> Changeset: fc8a1a5de78e Author: amurillo Date: 2013-06-21 00:59 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/fc8a1a5de78e 8017253: new hotspot build - hs25-b39 Reviewed-by: jcoomes ! make/hotspot_version Changeset: 91acb82a8b7a Author: dholmes Date: 2013-06-19 13:14 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/91acb82a8b7a 8014326: [OSX] All libjvm symbols are exported Summary: Add support for a MacOS X compatible form of the libjvm mapfile. Reviewed-by: dcubed, rdurbin, coleenp ! make/bsd/makefiles/build_vm_def.sh ! make/bsd/makefiles/gcc.make ! make/bsd/makefiles/mapfile-vers-debug ! make/bsd/makefiles/mapfile-vers-product Changeset: b9f4c4ec0f50 Author: iklam Date: 2013-06-19 20:51 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/b9f4c4ec0f50 8008964: NPG: Memory regression: Thread::_metadata_handles uses 1 KB per thread. Summary: Reduce default size of Thread::_metadata_handles from 300 to 30 Reviewed-by: coleenp, sspitsyn ! src/share/vm/runtime/thread.cpp Changeset: b3cd8b58b798 Author: mgronlun Date: 2013-06-20 11:53 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/b3cd8b58b798 8016735: Remove superfluous EnableInvokeDynamic warning from UnlockDiagnosticVMOptions check Reviewed-by: sla, dholmes ! src/share/vm/runtime/globals.cpp Changeset: 9ba41a4a71ff Author: coleenp Date: 2013-06-21 10:50 -0400 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/9ba41a4a71ff 8004124: Handle and/or warn about SI_KERNEL Summary: Detect this crash in the signal handler and give a fatal error message instead of making us chase down bugs that don't reproduce Reviewed-by: kvn, mgerdin, dholmes ! src/os_cpu/linux_x86/vm/os_linux_x86.cpp ! src/share/vm/runtime/sharedRuntime.cpp Changeset: bed34a7a3b9b Author: coleenp Date: 2013-06-21 10:57 -0400 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/bed34a7a3b9b 8017177: more explicit code location information in hs_err crash log Summary: Add code pc location for compiled code Reviewed-by: kvn, coleenp Contributed-by: doug.simon at oracle.com ! src/share/vm/runtime/frame.cpp Changeset: bb6c7f2f10fd Author: dcubed Date: 2013-06-21 08:18 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/bb6c7f2f10fd Merge Changeset: b7bc7c94b4b5 Author: dcubed Date: 2013-06-21 10:55 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/b7bc7c94b4b5 Merge - src/os_cpu/linux_sparc/vm/assembler_linux_sparc.cpp - src/os_cpu/solaris_sparc/vm/assembler_solaris_sparc.cpp Changeset: d9eed26d638a Author: iklam Date: 2013-06-23 22:08 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/d9eed26d638a 8009575: Reduce Symbol::_refcount from 4 bytes to 2 bytes Summary: Added Atomic::inc(short*) to support this change. Reviewed-by: coleenp, dcubed, dholmes, minqi ! src/share/vm/oops/symbol.cpp ! src/share/vm/oops/symbol.hpp ! src/share/vm/runtime/atomic.cpp ! src/share/vm/runtime/atomic.hpp ! src/share/vm/runtime/vmStructs.cpp Changeset: e0c9a1d29eb4 Author: coleenp Date: 2013-06-24 18:55 -0400 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/e0c9a1d29eb4 8016325: JVM hangs verifying system dictionary Summary: Minimize redundant verifications of Klasses. Reviewed-by: hseigel, jmasa ! src/cpu/sparc/vm/frame_sparc.cpp ! src/cpu/x86/vm/frame_x86.cpp ! src/share/vm/ci/ciObjectFactory.cpp ! src/share/vm/classfile/dictionary.cpp ! src/share/vm/code/debugInfo.hpp ! src/share/vm/code/dependencies.cpp ! src/share/vm/gc_implementation/g1/heapRegion.cpp ! src/share/vm/memory/allocation.cpp ! src/share/vm/memory/allocation.hpp ! src/share/vm/memory/heapInspection.cpp ! src/share/vm/oops/arrayKlass.cpp ! src/share/vm/oops/arrayKlass.hpp ! src/share/vm/oops/compiledICHolder.cpp ! src/share/vm/oops/constMethod.cpp ! src/share/vm/oops/constantPool.cpp ! src/share/vm/oops/instanceKlass.cpp ! src/share/vm/oops/instanceKlass.hpp ! src/share/vm/oops/klass.cpp ! src/share/vm/oops/klass.hpp ! src/share/vm/oops/method.cpp ! src/share/vm/oops/objArrayKlass.cpp ! src/share/vm/oops/objArrayKlass.hpp ! src/share/vm/runtime/frame.cpp ! src/share/vm/shark/sharkBuilder.cpp Changeset: 01e10b366055 Author: sla Date: 2013-06-25 14:11 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/01e10b366055 8017561: Build errors caused by missing .PHONY Reviewed-by: stefank, brutisso ! make/excludeSrc.make Changeset: feae15578b2f Author: tamao Date: 2013-06-07 09:46 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/feae15578b2f 7122222: GC log is limited to 2G for 32-bit Summary: Enable large file support for generated 32-bit ostream.o on Linux and Solaris (as only the two need this) by setting -D_FILE_OFFSET_BITS=64 in compilation Reviewed-by: tbell, mgerdin, dcubed Contributed-by: tamao ! make/linux/makefiles/vm.make ! make/solaris/makefiles/vm.make ! src/os/solaris/vm/os_solaris.inline.hpp Changeset: df7e1c0e3dc1 Author: jmasa Date: 2013-06-25 09:58 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/df7e1c0e3dc1 8014546: MetaspaceAux print_metaspace_change() should print "used" after GC not capacity Reviewed-by: johnc, tschatzl ! src/share/vm/memory/metaspace.cpp Changeset: f99cd6e20ab1 Author: jmasa Date: 2013-06-25 15:17 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/f99cd6e20ab1 8014851: UseAdaptiveGCBoundary is broken Reviewed-by: tschatzl, brutisso ! src/share/vm/gc_implementation/parallelScavenge/asPSOldGen.cpp ! src/share/vm/gc_implementation/parallelScavenge/asPSOldGen.hpp ! src/share/vm/gc_implementation/parallelScavenge/psOldGen.hpp + test/gc/parallelScavenge/AdaptiveGCBoundary.java Changeset: 71963b3f802a Author: ehelin Date: 2013-06-26 16:58 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/71963b3f802a 8013590: NPG: Add a memory pool MXBean for Metaspace Reviewed-by: jmasa, mgerdin ! src/share/vm/memory/metaspace.cpp ! src/share/vm/memory/universe.cpp ! src/share/vm/services/management.cpp ! src/share/vm/services/memoryManager.cpp ! src/share/vm/services/memoryManager.hpp ! src/share/vm/services/memoryPool.cpp ! src/share/vm/services/memoryPool.hpp ! src/share/vm/services/memoryService.cpp ! src/share/vm/services/memoryService.hpp + test/gc/metaspace/TestMetaspaceMemoryPool.java Changeset: f8972b867ded Author: ehelin Date: 2013-06-27 10:56 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/f8972b867ded Merge Changeset: 7875ea94bea5 Author: goetz Date: 2013-06-24 11:53 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/7875ea94bea5 8017308: Remove unused breakpoint relocation type Summary: remove unused breakpoint relocation type Reviewed-by: kvn ! src/cpu/sparc/vm/macroAssembler_sparc.cpp ! src/cpu/sparc/vm/relocInfo_sparc.cpp ! src/cpu/x86/vm/relocInfo_x86.cpp ! src/cpu/zero/vm/relocInfo_zero.cpp ! src/share/vm/code/nmethod.cpp ! src/share/vm/code/relocInfo.cpp ! src/share/vm/code/relocInfo.hpp Changeset: cc63bcb47cce Author: twisti Date: 2013-06-24 17:47 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/cc63bcb47cce 8017538: Clang support broke slowdebug build for i586 Reviewed-by: kvn ! make/linux/makefiles/gcc.make Changeset: a023da4ffc15 Author: twisti Date: 2013-06-24 18:23 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/a023da4ffc15 Merge Changeset: 3aa636f2a743 Author: adlertz Date: 2013-06-25 12:07 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/3aa636f2a743 8017243: 8001345 is incomplete Summary: Replaces unused decodeN at MemBarAcquire with its corresponding loadN if loadN is used at more than one place. Reviewed-by: kvn, twisti ! src/share/vm/opto/memnode.cpp Changeset: 9347cae673f0 Author: adlertz Date: 2013-06-26 00:40 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/9347cae673f0 8017510: Add a regression test for 8005956 Summary: Regression test for 8005956 Reviewed-by: kvn, twisti + test/compiler/8005956/PolynomialRoot.java Changeset: 6a0ead6dc6db Author: goetz Date: 2013-06-24 16:11 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/6a0ead6dc6db 8017531: 8010460 changes broke bytecodeInterpreter.cpp Summary: Replace _indy by _jsr292 and also fix VERIFY_OOP macros. Reviewed-by: kvn ! src/share/vm/interpreter/bytecodeInterpreter.cpp Changeset: be0600ec1102 Author: kvn Date: 2013-06-27 11:12 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/be0600ec1102 Merge Changeset: 2b9380b0bf0b Author: amurillo Date: 2013-06-28 02:25 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/2b9380b0bf0b Merge ! src/share/vm/memory/allocation.cpp ! src/share/vm/memory/allocation.hpp ! src/share/vm/memory/universe.cpp Changeset: d197d377ab2e Author: amurillo Date: 2013-06-28 02:25 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/d197d377ab2e Added tag hs25-b39 for changeset 2b9380b0bf0b ! .hgtags Changeset: 2bfa00fac03f Author: cl Date: 2013-07-04 01:00 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/2bfa00fac03f Added tag jdk8-b97 for changeset d197d377ab2e ! .hgtags From lana.steuck at oracle.com Fri Jul 5 21:44:30 2013 From: lana.steuck at oracle.com (lana.steuck at oracle.com) Date: Fri, 05 Jul 2013 21:44:30 +0000 Subject: hg: jdk8/tl/jdk: 20 new changesets Message-ID: <20130705214839.9E12248860@hg.openjdk.java.net> Changeset: 8339c83b16c6 Author: ehelin Date: 2013-07-02 13:06 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/8339c83b16c6 8019500: Exclude MemoryTest.java and MemoryTestAllGC.sh to enable integration Reviewed-by: erikj, alanb ! test/ProblemList.txt Changeset: 87cab043cb5e Author: katleman Date: 2013-06-28 16:26 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/87cab043cb5e 8019347: JDK8 b96 source with GPL header errors Reviewed-by: iris, alanb, lancea ! makefiles/sun/awt/ToBin.java ! src/share/classes/javax/xml/crypto/dsig/dom/DOMValidateContext.java ! test/java/awt/Mouse/EnterExitEvents/FullscreenEnterEventTest.java ! test/java/lang/ThreadGroup/Suspend.java Changeset: 978a95239044 Author: katleman Date: 2013-07-02 15:55 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/978a95239044 Merge Changeset: 4b21dcfdcc3b Author: cl Date: 2013-07-04 01:00 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/4b21dcfdcc3b Added tag jdk8-b97 for changeset 978a95239044 ! .hgtags Changeset: 5cfcd545ce4a Author: vadim Date: 2013-06-26 13:49 +0400 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/5cfcd545ce4a 8016254: several sun/java2d/OpenGL tests failed with SIGFPE Reviewed-by: prr, bae ! src/share/native/sun/java2d/opengl/OGLContext.c Changeset: 3ffa38871143 Author: lana Date: 2013-06-28 19:37 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/3ffa38871143 Merge - make/sun/xawt/ToBin.java - makefiles/sun/awt/X11/ToBin.java - src/share/classes/sun/misc/FDBigInt.java - src/share/classes/sun/misc/Hashing.java - src/solaris/classes/sun/awt/X11/XIconInfo.java - src/solaris/classes/sun/awt/X11/security-icon-bw16.png - src/solaris/classes/sun/awt/X11/security-icon-bw24.png - src/solaris/classes/sun/awt/X11/security-icon-bw32.png - src/solaris/classes/sun/awt/X11/security-icon-bw48.png - src/solaris/classes/sun/awt/X11/security-icon-interim16.png - src/solaris/classes/sun/awt/X11/security-icon-interim24.png - src/solaris/classes/sun/awt/X11/security-icon-interim32.png - src/solaris/classes/sun/awt/X11/security-icon-interim48.png - src/solaris/classes/sun/awt/X11/security-icon-yellow16.png - src/solaris/classes/sun/awt/X11/security-icon-yellow24.png - src/solaris/classes/sun/awt/X11/security-icon-yellow32.png - src/solaris/classes/sun/awt/X11/security-icon-yellow48.png - test/java/lang/invoke/7196190/MHProxyTest.java - test/sun/misc/Hashing.java Changeset: 6dda4a069a83 Author: prr Date: 2013-07-01 12:39 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/6dda4a069a83 8015144: Performance regression in ICU OpenType Layout library Reviewed-by: srl, jgodinez ! make/sun/font/Makefile ! makefiles/CompileNativeLibraries.gmk ! src/share/native/sun/font/layout/GlyphIterator.cpp ! src/share/native/sun/font/layout/GlyphIterator.h ! src/share/native/sun/font/layout/LETableReference.h ! src/share/native/sun/font/layout/OpenTypeUtilities.cpp Changeset: 6d2b5ec2ec79 Author: prr Date: 2013-07-02 14:25 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/6d2b5ec2ec79 8019692: JDK build CC_OPT_HIGHEST setting isn't valid for Sun C++ compiler Reviewed-by: jgodinez ! make/sun/font/Makefile ! makefiles/CompileNativeLibraries.gmk Changeset: 1c607ebfc180 Author: leonidr Date: 2013-06-20 18:50 +0400 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/1c607ebfc180 8014264: The applet pathguy_TimeDead throws java.lang.NullPointerException in java console once click drop-down check box. Reviewed-by: art, anthony, serb ! src/solaris/classes/sun/awt/X11/XBaseMenuWindow.java ! src/solaris/classes/sun/awt/X11/XChoicePeer.java ! src/solaris/classes/sun/awt/X11/XListPeer.java Changeset: b7b95b7ab2cb Author: malenkov Date: 2013-06-21 17:13 +0400 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/b7b95b7ab2cb 8016545: java.beans.XMLEncoder.writeObject output is wrong Reviewed-by: alexsch ! src/share/classes/java/beans/XMLEncoder.java + test/java/beans/XMLEncoder/Test8016545.java Changeset: eed321190272 Author: alitvinov Date: 2013-06-21 21:30 +0400 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/eed321190272 8007642: Media Names on Java Print Do Not Match the Printer???s and Confuse Users Reviewed-by: prr, jgodinez ! src/windows/classes/sun/print/Win32PrintService.java Changeset: e5bac76282f7 Author: pchelko Date: 2013-06-27 13:56 +0400 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/e5bac76282f7 8019236: [macosx] Add javadoc to the handleWindowFocusEvent in CEmbeddedFrame Reviewed-by: serb, ant ! src/macosx/classes/sun/lwawt/macosx/CEmbeddedFrame.java Changeset: 72f167edf630 Author: dmarkov Date: 2013-06-28 18:32 +0400 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/72f167edf630 8016534: javax/swing/text/View/8014863/bug8014863.java failed Reviewed-by: alexp, alexsch ! test/javax/swing/text/View/8014863/bug8014863.java Changeset: 228ec4b9111a Author: lana Date: 2013-06-28 18:06 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/228ec4b9111a Merge - make/sun/xawt/ToBin.java - makefiles/sun/awt/X11/ToBin.java ! src/macosx/classes/sun/lwawt/macosx/CEmbeddedFrame.java - src/share/classes/sun/misc/FDBigInt.java - src/share/classes/sun/misc/Hashing.java ! src/solaris/classes/sun/awt/X11/XBaseMenuWindow.java ! src/solaris/classes/sun/awt/X11/XChoicePeer.java - src/solaris/classes/sun/awt/X11/XIconInfo.java ! src/solaris/classes/sun/awt/X11/XListPeer.java - src/solaris/classes/sun/awt/X11/security-icon-bw16.png - src/solaris/classes/sun/awt/X11/security-icon-bw24.png - src/solaris/classes/sun/awt/X11/security-icon-bw32.png - src/solaris/classes/sun/awt/X11/security-icon-bw48.png - src/solaris/classes/sun/awt/X11/security-icon-interim16.png - src/solaris/classes/sun/awt/X11/security-icon-interim24.png - src/solaris/classes/sun/awt/X11/security-icon-interim32.png - src/solaris/classes/sun/awt/X11/security-icon-interim48.png - src/solaris/classes/sun/awt/X11/security-icon-yellow16.png - src/solaris/classes/sun/awt/X11/security-icon-yellow24.png - src/solaris/classes/sun/awt/X11/security-icon-yellow32.png - src/solaris/classes/sun/awt/X11/security-icon-yellow48.png ! src/windows/classes/sun/print/Win32PrintService.java - test/java/lang/invoke/7196190/MHProxyTest.java - test/sun/misc/Hashing.java Changeset: 6fc558b41d8e Author: lana Date: 2013-07-02 15:20 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/6fc558b41d8e Merge Changeset: 11c074904fce Author: lana Date: 2013-07-02 15:23 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/11c074904fce Merge - src/share/classes/java/security/acl/package.html - src/share/classes/java/security/cert/package.html - src/share/classes/java/security/interfaces/package.html - src/share/classes/java/security/package.html - src/share/classes/java/security/spec/package.html - src/share/classes/sun/security/krb5/internal/rcache/CacheTable.java - src/share/classes/sun/security/krb5/internal/rcache/ReplayCache.java - test/java/util/Comparators/BasicTest.java - test/sun/security/krb5/auto/ReplayCache.java Changeset: 974b94f944ce Author: lana Date: 2013-07-03 19:09 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/974b94f944ce Merge - src/share/classes/java/security/acl/package.html - src/share/classes/java/security/cert/package.html - src/share/classes/java/security/interfaces/package.html - src/share/classes/java/security/package.html - src/share/classes/java/security/spec/package.html - src/share/classes/sun/security/krb5/internal/rcache/CacheTable.java - src/share/classes/sun/security/krb5/internal/rcache/ReplayCache.java - test/java/util/Comparators/BasicTest.java - test/sun/security/krb5/auto/ReplayCache.java Changeset: f2342dedf04a Author: lana Date: 2013-07-05 11:07 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/f2342dedf04a Merge Changeset: 49c5547d9e8e Author: lana Date: 2013-07-05 13:28 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/49c5547d9e8e Merge Changeset: 4fcabe8e22ce Author: lana Date: 2013-07-05 14:37 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/4fcabe8e22ce Merge - src/share/classes/com/sun/org/apache/xml/internal/security/resource/log4j.properties - src/share/classes/com/sun/org/apache/xml/internal/security/transforms/implementations/FuncHereContext.java - src/share/classes/com/sun/org/apache/xml/internal/security/utils/CachedXPathAPIHolder.java - src/share/classes/com/sun/org/apache/xml/internal/security/utils/CachedXPathFuncHereAPI.java - src/share/classes/com/sun/org/apache/xml/internal/security/utils/XPathFuncHereAPI.java From henry.jen at oracle.com Sat Jul 6 00:11:55 2013 From: henry.jen at oracle.com (Henry Jen) Date: Fri, 05 Jul 2013 17:11:55 -0700 Subject: RFR: 8015318: Extend Collector with 'finish' operation Message-ID: <51D760CB.8080003@oracle.com> Hi, Please review the webrev at http://cr.openjdk.java.net/~henryjen/ccc/8015318.0/webrev/ This webrev refactor java.util.Collector interface to allow an intermediate type used for accumulation and then produce final result type with a 'finished' function. Collectors are updated to reflect the changes, and quite a few API changes, toStringJoiner -> joining Return type becoming Optional when appropriate sumBy -> a set of summing[Int,Long,Double] average[Int,Long,Double] I'll put specdiff up later for those interested in API changes. Cheers, Henry From henry.jen at oracle.com Sat Jul 6 00:18:53 2013 From: henry.jen at oracle.com (Henry Jen) Date: Fri, 05 Jul 2013 17:18:53 -0700 Subject: RFR: 8015318: Extend Collector with 'finish' operation In-Reply-To: <51D760CB.8080003@oracle.com> References: <51D760CB.8080003@oracle.com> Message-ID: <51D7626D.3090102@oracle.com> Forgot to mention this patch depends on fix of bug 8012238[1], to enable compile without fix, attached patch will help. [1] http://bugs.sun.com/view_bug.do?bug_id=8012238 Cheers, Henry On 07/05/2013 05:11 PM, Henry Jen wrote: > Hi, > > Please review the webrev at > http://cr.openjdk.java.net/~henryjen/ccc/8015318.0/webrev/ > > This webrev refactor java.util.Collector interface to allow an > intermediate type used for accumulation and then produce final result > type with a 'finished' function. > > Collectors are updated to reflect the changes, and quite a few API changes, > > toStringJoiner -> joining > Return type becoming Optional when appropriate > sumBy -> a set of summing[Int,Long,Double] > average[Int,Long,Double] > > I'll put specdiff up later for those interested in API changes. > > Cheers, > Henry > From bradford.wetmore at oracle.com Sat Jul 6 01:24:01 2013 From: bradford.wetmore at oracle.com (bradford.wetmore at oracle.com) Date: Sat, 06 Jul 2013 01:24:01 +0000 Subject: hg: jdk8/tl/jdk: 8019341: Update CookieHttpsClientTest to use the newer framework. Message-ID: <20130706012427.9957D4886A@hg.openjdk.java.net> Changeset: 11c15607e43f Author: wetmore Date: 2013-07-05 18:22 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/11c15607e43f 8019341: Update CookieHttpsClientTest to use the newer framework. Reviewed-by: xuelei, smarks, michaelm ! test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/CookieHttpsClientTest.java ! test/sun/security/ssl/templates/SSLEngineTemplate.java ! test/sun/security/ssl/templates/SSLSocketSSLEngineTemplate.java ! test/sun/security/ssl/templates/SSLSocketTemplate.java From huizhe.wang at oracle.com Sat Jul 6 01:48:57 2013 From: huizhe.wang at oracle.com (huizhe wang) Date: Fri, 05 Jul 2013 18:48:57 -0700 Subject: RFR: JAXP 1.5 for JDK8/7u40: 8016648: FEATURE_SECURE_PROCESSING set to true or false causes SAXParseException to be thrown In-Reply-To: <51D68488.2050108@oracle.com> References: <51D13933.8090901@oracle.com> <51D1A3F2.2000707@oracle.com> <51D1CB94.90901@oracle.com> <51D1DE7D.3030105@oracle.com> <51D53C3A.6000708@oracle.com> <51D54E48.6060503@oracle.com> <51D5DA43.3050404@oracle.com> <51D68488.2050108@oracle.com> Message-ID: <51D77789.8080605@oracle.com> On 7/5/2013 1:32 AM, Alan Bateman wrote: > On 04/07/2013 21:25, huizhe wang wrote: >> >> Reverted back to the original code: >> http://cr.openjdk.java.net/~joehw/jdk8/8016648/webrev/ >> The code split the version number and look at the 1st or 2nd element, >> it thus works for both the current format and the proposed one, e.g. >> for 1.7.0, it compares with the 2nd element, and for the proposed >> MAJOR.MINOR.FU.*, the 1st or MAJOR. > Thanks for dropping the dependency on javax.lang.model. What you now > is probably okay although I'm a bit dubious about attempting to > support an alternative format (I'm not aware of any proposal that > changes the format of the java.version property as changing it would > like cause a lot of breakage). There was a survey from Iris last year, and the JPG site has a presentation from Aurelio. But you're right, I'll remove it. If there's any change in the future, that is if it happens at all, we can always add that back. > > A minor point but isJDKOrAbove looks a bit odd to me, I'd probably go > for something like isJavaVersionGTE or isJavaVersionAtLeast but as > it's not part of the API then it doesn't matter of course. isJavaVersionAtLeast is easy to understand. What does GTE stand for? > > I think I mentioned it a while back but have warnings emitted with > System.err can be problematic (gets mixed up with application messages > to stderr). I realize the Xerces code seems to do this in places but > we really need to see about eliminating these messages or getting > consistent logging into this code. I agree, this one is not particularly graceful. There were 88 matches of System.err in Xalan and 75 in Xerces, although some I believe are used for debugging. It could take quite some effort. I mentioned that with a standalone release, we were trying to stay away from new JDK features. It's probably better to spend time/effort on some upgrades. > >> : >> >> The last scenario to work on is if FSP is set on the Validator >> instead of SchemaFactory. With that, I'm looking at refactoring the >> way properties are represented so that they carry state. It would >> then be cleaner to pass them from SchemaFactory over to Schema and >> then Validator. It's a bit of work. Fortunately, we only have three >> of them to deal with. > So are you planning to send another webrev or do it as a separate issue? Looking at affected code by this change, it doesn't seem to be too bad. I'll send another webrev. Joe > > -Alan From erik.helin at oracle.com Sat Jul 6 07:14:15 2013 From: erik.helin at oracle.com (Erik Helin) Date: Sat, 6 Jul 2013 09:14:15 +0200 Subject: RFR: 8010734: NPG: The test MemoryTest.java needs to be updated to support metaspace In-Reply-To: <51D6D7D8.5080809@oracle.com> References: <20130701153520.GF2213@ehelin-thinkpad> <20130705140805.GC14318@ehelin-thinkpad> <51D6D7D8.5080809@oracle.com> Message-ID: <20130706071415.GC2056@ehelin-thinkpad> Thanks! Erik On 2013-07-05, Alan Bateman wrote: > On 05/07/2013 15:08, Erik Helin wrote: > >Hi all, > > > >still looking for a review for this testfix. Looping in > >hotspot-gc-dev at openjdk.java.net as well. > > > It looks like okay to me and the comments make it clear the memory > pools that it expects. > > -Alan From david.holmes at oracle.com Mon Jul 8 01:33:32 2013 From: david.holmes at oracle.com (David Holmes) Date: Mon, 08 Jul 2013 11:33:32 +1000 Subject: RFR: 8016341 java/lang/ref/OOMEInReferenceHandler.java failing intermittently In-Reply-To: <51D603BD.9050708@oracle.com> References: <51D25932.7040303@oracle.com> <51D27F05.5020201@gmail.com> <51D603BD.9050708@oracle.com> Message-ID: <51DA16EC.5070509@oracle.com> Still looking for a reviewer for this please. Thanks, David On 5/07/2013 9:22 AM, David Holmes wrote: > Hi Peter, > > On 2/07/2013 5:19 PM, Peter Levart wrote: >> Looking at original code once again, I think this was actually a bug. >> The WeakReference instance constructed in (old) line 82, can be GCed >> right away, since nobody is using the local variable after assignment. > > Of course. Doh! I was to busy thinking about the lifetime of the > referent object to consider the reference itself. > >> If WeakReference is GCed it can not be enqueued. The promotion of local >> variable into a field is one way to fix this. The other would be to use >> the local variable somewhere down the code path, like for example in a >> final throw statement: >> >> 110 throw new IllegalStateException("Reference Handler thread >> stuck. weakRef.get(): " + weakRef.get()); >> >> >> This would also reveal some more info about the WeakReference when >> there's no sure answer after 10 seconds and could be added to the test >> anyway. > > Okay I've modified the test as suggested. Updated webrev at same location: > > http://cr.openjdk.java.net/~dholmes/8016341/webrev/ > > In testing it though I simply exposed the remaining flaws in the > ReferenceHandler code. We can still kill the ReferenceHandler thread > with an OOME when it tries to load the Cleaner class (running with a 5M > heap triggers this nicely if you use G1): > > // Fast path for cleaners > if (r instanceof Cleaner) { > ((Cleaner)r).clean(); > continue; > } > > and if that passes the clean() might throw OOME (it internally tries to > do a System.exit if an exception occurs but will likely encounter > another OOME trying to create the PrivilegedAction). > > Even the: > > ReferenceQueue q = r.queue; > if (q != ReferenceQueue.NULL) q.enqueue(r); > > might throw OOME because enqueue() might have to load the FinalReference > class. > > So really catching the OOME around the wait() only patches a small hole. > We can't simply put a try/catch in the for(;;) loop because that doesn't > address the problem that if the class loading throws OOME then > subsequent attempts to load that class will also fail. We would have to > preload all possible classes. Even then we might just send the > ReferenceHandler thread into a busy loop of throwing OOME catching it > and retrying! > > So I can fix the test to deal with the Xcomp issue but we may still see > intermittent failures, and the ReferenceHandler thread may still die > from OOME. > > David > ----- > > >> >> Regards, Peter >> >> On 07/02/2013 06:38 AM, David Holmes wrote: >>> This recently added test was found to fail under some conditions - >>> namely client compiler with -Xcomp. It seems that the use of all local >>> variables enabled the compiler to optimize things in a way that >>> stopped the weakref from being enqueued as expected. Simple fix was to >>> make the weakref a field. >>> >>> http://cr.openjdk.java.net/~dholmes/8016341/webrev/ >>> >>> Thanks, >>> David >> From zhangshj at linux.vnet.ibm.com Mon Jul 8 03:12:13 2013 From: zhangshj at linux.vnet.ibm.com (Shi Jun Zhang) Date: Mon, 08 Jul 2013 11:12:13 +0800 Subject: RFR: 8019381: HashMap.isEmpty is non-final, potential issues for get/remove In-Reply-To: <51D6363E.6090605@linux.vnet.ibm.com> References: <51CBF181.1020301@linux.vnet.ibm.com> <51CCAAE5.4010707@univ-mlv.fr> <51CD896D.9030807@oracle.com> <51CDB453.5010003@linux.vnet.ibm.com> <51D13323.9030601@linux.vnet.ibm.com> <51D19EAE.2010201@univ-mlv.fr> <450D0C6E-3BA7-40AD-B415-6659A6FDDA91@oracle.com> <51D394D4.7090706@linux.vnet.ibm.com> <51D6363E.6090605@linux.vnet.ibm.com> Message-ID: <51DA2E0D.5030506@linux.vnet.ibm.com> On 7/5/2013 10:58 AM, Jonathan Lu wrote: > On 07/03/2013 11:04 AM, Shi Jun Zhang wrote: >> On 7/1/2013 11:49 PM, Chris Hegarty wrote: >>> On 1 Jul 2013, at 17:22, Remi Forax wrote: >>> >>>> On 07/01/2013 09:43 AM, Shi Jun Zhang wrote: >>>>> On 6/29/2013 12:05 AM, Shi Jun Zhang wrote: >>>>>> On 6/28/2013 9:02 PM, Alan Bateman wrote: >>>>>>> On 27/06/2013 22:13, Remi Forax wrote: >>>>>>>> On 06/27/2013 10:02 AM, Shi Jun Zhang wrote: >>>>>>>>> Hi, >>>>>>>>> >>>>>>>>> There are some isEmpty() check added into get/remove methods >>>>>>>>> since 8011200 to return directly if HashMap is empty. However >>>>>>>>> isEmpty is a non-final public method which can be overridden >>>>>>>>> by subclass. If the subclass defines isEmpty differently from >>>>>>>>> HashMap, it would cause problem while getting or removing >>>>>>>>> elements. >>>>>>>> yes, it's a bug. >>>>>>>> Could you report it ? >>>>>>>> >>>>>>>> R?mi >>>>>>> I've created a bug to track this: >>>>>>> >>>>>>> 8019381: HashMap.isEmpty is non-final, potential issues for >>>>>>> get/remove >>>>>>> >>>>>>> -Alan >>>>>> Thanks, Alan. >>>>>> >>>>>> I'm quite busy today and do not have time to report it until now. >>>>>> Thanks for your help. >>>>>> >>>>>> I will provide a webrev next Monday for review. >>>>> Hi, >>>>> >>>>> Here is the webrev >>>>> >>>>> http://cr.openjdk.java.net/~zhangshj/8019381/webrev.00/ >>>> This looks Ok for me. >>> +1 >>> >>> -Chris >>> >>>> R?mi >>>> >> Thanks all for the review. >> >> Jonathan, >> >> Could you help to push the changeset? >> > Hello Chance, > > Patch pushed @ > http://hg.openjdk.java.net/jdk8/tl/jdk/rev/ed111451b77a, pls verify. > > Cheers! > - Jonathan Thanks, Jonathan. -- Regards, Shi Jun Zhang From peter.levart at gmail.com Mon Jul 8 07:01:07 2013 From: peter.levart at gmail.com (Peter Levart) Date: Mon, 08 Jul 2013 09:01:07 +0200 Subject: RFR: 8016341 java/lang/ref/OOMEInReferenceHandler.java failing intermittently In-Reply-To: <51D603BD.9050708@oracle.com> References: <51D25932.7040303@oracle.com> <51D27F05.5020201@gmail.com> <51D603BD.9050708@oracle.com> Message-ID: <51DA63B3.8070405@gmail.com> On 07/05/2013 01:22 AM, David Holmes wrote: > Hi Peter, > > On 2/07/2013 5:19 PM, Peter Levart wrote: >> Looking at original code once again, I think this was actually a bug. >> The WeakReference instance constructed in (old) line 82, can be GCed >> right away, since nobody is using the local variable after assignment. > > Of course. Doh! I was to busy thinking about the lifetime of the > referent object to consider the reference itself. > >> If WeakReference is GCed it can not be enqueued. The promotion of local >> variable into a field is one way to fix this. The other would be to use >> the local variable somewhere down the code path, like for example in a >> final throw statement: >> >> 110 throw new IllegalStateException("Reference Handler thread >> stuck. weakRef.get(): " + weakRef.get()); >> >> >> This would also reveal some more info about the WeakReference when >> there's no sure answer after 10 seconds and could be added to the test >> anyway. > > Okay I've modified the test as suggested. Updated webrev at same > location: > > http://cr.openjdk.java.net/~dholmes/8016341/webrev/ > > In testing it though I simply exposed the remaining flaws in the > ReferenceHandler code. We can still kill the ReferenceHandler thread > with an OOME when it tries to load the Cleaner class (running with a > 5M heap triggers this nicely if you use G1): > > // Fast path for cleaners > if (r instanceof Cleaner) { > ((Cleaner)r).clean(); > continue; > } > > and if that passes the clean() might throw OOME (it internally tries > to do a System.exit if an exception occurs but will likely encounter > another OOME trying to create the PrivilegedAction). > > Even the: > > ReferenceQueue q = r.queue; > if (q != ReferenceQueue.NULL) q.enqueue(r); > > might throw OOME because enqueue() might have to load the > FinalReference class. > > So really catching the OOME around the wait() only patches a small > hole. We can't simply put a try/catch in the for(;;) loop because that > doesn't address the problem that if the class loading throws OOME then > subsequent attempts to load that class will also fail. We would have > to preload all possible classes. Even then we might just send the > ReferenceHandler thread into a busy loop of throwing OOME catching it > and retrying! > > So I can fix the test to deal with the Xcomp issue but we may still > see intermittent failures, and the ReferenceHandler thread may still > die from OOME. Hi David, I think the test is fine now. Regarding the resilience of ReferenceHandler thread, I think we should try to preload FinalReference, Cleaner and InterruptedException in the initialization phase of ReferenceHandler thread. There should be no danger of OOME in related cases then. As far as Cleaner's exception handler is concerned, I think it is not universally wise to just exit the VM when any exception is thrown by the Cleaner's thunk.run() method. What if that exception is OOME? That does not mean there's something wrong with Cleaner.thunk's code. Not only will this kill ReferenceHandler thread, but entire VM. If the purpose of exiting VM was attracting attention to the possible bug in Cleaner.thunk's code, then this absolutely works, but wouldn't simple message to System.err be enough? Like for example: public void clean() { if (!remove(this)) return; try { thunk.run(); } catch (final Throwable x) { try { new Error("Cleaner caught exception", x) .printStackTrace(); } catch (OutOfMemoryError oome) { // can't do much } } } Regards, Peter > > David > ----- > > >> >> Regards, Peter >> >> On 07/02/2013 06:38 AM, David Holmes wrote: >>> This recently added test was found to fail under some conditions - >>> namely client compiler with -Xcomp. It seems that the use of all local >>> variables enabled the compiler to optimize things in a way that >>> stopped the weakref from being enqueued as expected. Simple fix was to >>> make the weakref a field. >>> >>> http://cr.openjdk.java.net/~dholmes/8016341/webrev/ >>> >>> Thanks, >>> David >> From david.holmes at oracle.com Mon Jul 8 07:19:56 2013 From: david.holmes at oracle.com (David Holmes) Date: Mon, 08 Jul 2013 17:19:56 +1000 Subject: RFR: 8016341 java/lang/ref/OOMEInReferenceHandler.java failing intermittently In-Reply-To: <51DA63B3.8070405@gmail.com> References: <51D25932.7040303@oracle.com> <51D27F05.5020201@gmail.com> <51D603BD.9050708@oracle.com> <51DA63B3.8070405@gmail.com> Message-ID: <51DA681C.9010402@oracle.com> Hi Peter, On 8/07/2013 5:01 PM, Peter Levart wrote: > On 07/05/2013 01:22 AM, David Holmes wrote: >> Hi Peter, >> >> On 2/07/2013 5:19 PM, Peter Levart wrote: >>> Looking at original code once again, I think this was actually a bug. >>> The WeakReference instance constructed in (old) line 82, can be GCed >>> right away, since nobody is using the local variable after assignment. >> >> Of course. Doh! I was to busy thinking about the lifetime of the >> referent object to consider the reference itself. >> >>> If WeakReference is GCed it can not be enqueued. The promotion of local >>> variable into a field is one way to fix this. The other would be to use >>> the local variable somewhere down the code path, like for example in a >>> final throw statement: >>> >>> 110 throw new IllegalStateException("Reference Handler thread >>> stuck. weakRef.get(): " + weakRef.get()); >>> >>> >>> This would also reveal some more info about the WeakReference when >>> there's no sure answer after 10 seconds and could be added to the test >>> anyway. >> >> Okay I've modified the test as suggested. Updated webrev at same >> location: >> >> http://cr.openjdk.java.net/~dholmes/8016341/webrev/ >> >> In testing it though I simply exposed the remaining flaws in the >> ReferenceHandler code. We can still kill the ReferenceHandler thread >> with an OOME when it tries to load the Cleaner class (running with a >> 5M heap triggers this nicely if you use G1): >> >> // Fast path for cleaners >> if (r instanceof Cleaner) { >> ((Cleaner)r).clean(); >> continue; >> } >> >> and if that passes the clean() might throw OOME (it internally tries >> to do a System.exit if an exception occurs but will likely encounter >> another OOME trying to create the PrivilegedAction). >> >> Even the: >> >> ReferenceQueue q = r.queue; >> if (q != ReferenceQueue.NULL) q.enqueue(r); >> >> might throw OOME because enqueue() might have to load the >> FinalReference class. >> >> So really catching the OOME around the wait() only patches a small >> hole. We can't simply put a try/catch in the for(;;) loop because that >> doesn't address the problem that if the class loading throws OOME then >> subsequent attempts to load that class will also fail. We would have >> to preload all possible classes. Even then we might just send the >> ReferenceHandler thread into a busy loop of throwing OOME catching it >> and retrying! >> >> So I can fix the test to deal with the Xcomp issue but we may still >> see intermittent failures, and the ReferenceHandler thread may still >> die from OOME. > > Hi David, > > I think the test is fine now. > > Regarding the resilience of ReferenceHandler thread, I think we should > try to preload FinalReference, Cleaner and InterruptedException in the > initialization phase of ReferenceHandler thread. There should be no > danger of OOME in related cases then. We would need more than that as we need to ensure there is zero classloading needed at any point where OOME might be thrown. That would include PrivilegedAction and any transitive closure therefrom. > As far as Cleaner's exception > handler is concerned, I think it is not universally wise to just exit > the VM when any exception is thrown by the Cleaner's thunk.run() method. > What if that exception is OOME? That does not mean there's something > wrong with Cleaner.thunk's code. Not only will this kill > ReferenceHandler thread, but entire VM. Yes "fatal errors" are not uncommon in the JDK, or at least not completely rare. The general question is whether continuing might do more harm than good given that some "critical" action has failed. Hard to know in general so aborting is fairly common response (ala hotspot running out of C heap memory). Thanks, David ----- > If the purpose of exiting VM was attracting attention to the possible > bug in Cleaner.thunk's code, then this absolutely works, but wouldn't > simple message to System.err be enough? Like for example: > > > public void clean() { > if (!remove(this)) > return; > try { > thunk.run(); > } catch (final Throwable x) { > try { > new Error("Cleaner caught exception", x) > .printStackTrace(); > } catch (OutOfMemoryError oome) { > // can't do much > } > } > } > > > Regards, Peter > >> >> David >> ----- >> >> >>> >>> Regards, Peter >>> >>> On 07/02/2013 06:38 AM, David Holmes wrote: >>>> This recently added test was found to fail under some conditions - >>>> namely client compiler with -Xcomp. It seems that the use of all local >>>> variables enabled the compiler to optimize things in a way that >>>> stopped the weakref from being enqueued as expected. Simple fix was to >>>> make the weakref a field. >>>> >>>> http://cr.openjdk.java.net/~dholmes/8016341/webrev/ >>>> >>>> Thanks, >>>> David >>> > From peter.levart at gmail.com Mon Jul 8 07:49:22 2013 From: peter.levart at gmail.com (Peter Levart) Date: Mon, 08 Jul 2013 09:49:22 +0200 Subject: RFR: 8016341 java/lang/ref/OOMEInReferenceHandler.java failing intermittently In-Reply-To: <51DA681C.9010402@oracle.com> References: <51D25932.7040303@oracle.com> <51D27F05.5020201@gmail.com> <51D603BD.9050708@oracle.com> <51DA63B3.8070405@gmail.com> <51DA681C.9010402@oracle.com> Message-ID: <51DA6F02.5060600@gmail.com> On 07/08/2013 09:19 AM, David Holmes wrote: > Hi Peter, > > On 8/07/2013 5:01 PM, Peter Levart wrote: >> On 07/05/2013 01:22 AM, David Holmes wrote: >>> Hi Peter, >>> >>> On 2/07/2013 5:19 PM, Peter Levart wrote: >>>> Looking at original code once again, I think this was actually a bug. >>>> The WeakReference instance constructed in (old) line 82, can be GCed >>>> right away, since nobody is using the local variable after assignment. >>> >>> Of course. Doh! I was to busy thinking about the lifetime of the >>> referent object to consider the reference itself. >>> >>>> If WeakReference is GCed it can not be enqueued. The promotion of >>>> local >>>> variable into a field is one way to fix this. The other would be to >>>> use >>>> the local variable somewhere down the code path, like for example in a >>>> final throw statement: >>>> >>>> 110 throw new IllegalStateException("Reference Handler >>>> thread >>>> stuck. weakRef.get(): " + weakRef.get()); >>>> >>>> >>>> This would also reveal some more info about the WeakReference when >>>> there's no sure answer after 10 seconds and could be added to the test >>>> anyway. >>> >>> Okay I've modified the test as suggested. Updated webrev at same >>> location: >>> >>> http://cr.openjdk.java.net/~dholmes/8016341/webrev/ >>> >>> In testing it though I simply exposed the remaining flaws in the >>> ReferenceHandler code. We can still kill the ReferenceHandler thread >>> with an OOME when it tries to load the Cleaner class (running with a >>> 5M heap triggers this nicely if you use G1): >>> >>> // Fast path for cleaners >>> if (r instanceof Cleaner) { >>> ((Cleaner)r).clean(); >>> continue; >>> } >>> >>> and if that passes the clean() might throw OOME (it internally tries >>> to do a System.exit if an exception occurs but will likely encounter >>> another OOME trying to create the PrivilegedAction). >>> >>> Even the: >>> >>> ReferenceQueue q = r.queue; >>> if (q != ReferenceQueue.NULL) q.enqueue(r); >>> >>> might throw OOME because enqueue() might have to load the >>> FinalReference class. >>> >>> So really catching the OOME around the wait() only patches a small >>> hole. We can't simply put a try/catch in the for(;;) loop because that >>> doesn't address the problem that if the class loading throws OOME then >>> subsequent attempts to load that class will also fail. We would have >>> to preload all possible classes. Even then we might just send the >>> ReferenceHandler thread into a busy loop of throwing OOME catching it >>> and retrying! >>> >>> So I can fix the test to deal with the Xcomp issue but we may still >>> see intermittent failures, and the ReferenceHandler thread may still >>> die from OOME. >> >> Hi David, >> >> I think the test is fine now. >> >> Regarding the resilience of ReferenceHandler thread, I think we should >> try to preload FinalReference, Cleaner and InterruptedException in the >> initialization phase of ReferenceHandler thread. There should be no >> danger of OOME in related cases then. > > We would need more than that as we need to ensure there is zero > classloading needed at any point where OOME might be thrown. That > would include PrivilegedAction and any transitive closure therefrom. Hi David, I currently don't see any other possibility for another class to be loaded in the ReferenceHandler's run() method, apart from those that you indicated and what gets loaded in the the Cleaner.thunk's run() method. > >> As far as Cleaner's exception >> handler is concerned, I think it is not universally wise to just exit >> the VM when any exception is thrown by the Cleaner's thunk.run() method. >> What if that exception is OOME? That does not mean there's something >> wrong with Cleaner.thunk's code. Not only will this kill >> ReferenceHandler thread, but entire VM. > > Yes "fatal errors" are not uncommon in the JDK, or at least not > completely rare. The general question is whether continuing might do > more harm than good given that some "critical" action has failed. Hard > to know in general so aborting is fairly common response (ala hotspot > running out of C heap memory). Ok then. if we should stick with terminating the VM, what about the following "allocation-conservative" Cleaner.clean() method: private static final class TerminateAction implements PrivilegedAction { final Error error = new Error("Cleaner terminated abnormally"); @Override public Void run() { try { if (System.err != null) error.printStackTrace(); } finally { System.exit(1); } return null; } } // pre-allocate single instance of TerminateAction private static final TerminateAction terminateAction = new TerminateAction(); /** * Runs this cleaner, if it has not been run before. */ public void clean() { if (!remove(this)) return; try { thunk.run(); } catch (final Throwable x) { synchronized (terminateAction) { if (terminateAction.error.getCause() == null) terminateAction.error.initCause(x); } AccessController.doPrivileged(terminateAction); } } Regards, Peter > > Thanks, > David > ----- > >> If the purpose of exiting VM was attracting attention to the possible >> bug in Cleaner.thunk's code, then this absolutely works, but wouldn't >> simple message to System.err be enough? Like for example: >> >> >> public void clean() { >> if (!remove(this)) >> return; >> try { >> thunk.run(); >> } catch (final Throwable x) { >> try { >> new Error("Cleaner caught exception", x) >> .printStackTrace(); >> } catch (OutOfMemoryError oome) { >> // can't do much >> } >> } >> } >> >> >> Regards, Peter >> >>> >>> David >>> ----- >>> >>> >>>> >>>> Regards, Peter >>>> >>>> On 07/02/2013 06:38 AM, David Holmes wrote: >>>>> This recently added test was found to fail under some conditions - >>>>> namely client compiler with -Xcomp. It seems that the use of all >>>>> local >>>>> variables enabled the compiler to optimize things in a way that >>>>> stopped the weakref from being enqueued as expected. Simple fix >>>>> was to >>>>> make the weakref a field. >>>>> >>>>> http://cr.openjdk.java.net/~dholmes/8016341/webrev/ >>>>> >>>>> Thanks, >>>>> David >>>> >> From paul.sandoz at oracle.com Mon Jul 8 08:29:32 2013 From: paul.sandoz at oracle.com (Paul Sandoz) Date: Mon, 8 Jul 2013 10:29:32 +0200 Subject: RFR: 8015317: Optional.filter, map, and flatMap In-Reply-To: <51D73CA5.50005@oracle.com> References: <51D73CA5.50005@oracle.com> Message-ID: <5BEF47EB-0D85-44C4-8FA4-3E5B297F1B6D@oracle.com> On Jul 5, 2013, at 11:37 PM, Henry Jen wrote: > Hi, > > Please review the webrev at > > http://cr.openjdk.java.net/~henryjen/ccc/8015317.0/webrev/ > Looks OK to me. Paul. > Which adds following method to Optional, > > public static Optional ofNullable(T value) {} > public Optional filter(Predicate predicate) {} > public Optional map(Function mapper) {} > public Optional flatMap(Function> > mapper) {} > > Also included is some cleanup on javadoc. > > Cheers, > Henry > From david.holmes at oracle.com Mon Jul 8 08:37:16 2013 From: david.holmes at oracle.com (David Holmes) Date: Mon, 08 Jul 2013 18:37:16 +1000 Subject: RFR: 8016341 java/lang/ref/OOMEInReferenceHandler.java failing intermittently In-Reply-To: <51DA6F02.5060600@gmail.com> References: <51D25932.7040303@oracle.com> <51D27F05.5020201@gmail.com> <51D603BD.9050708@oracle.com> <51DA63B3.8070405@gmail.com> <51DA681C.9010402@oracle.com> <51DA6F02.5060600@gmail.com> Message-ID: <51DA7A3C.8080604@oracle.com> On 8/07/2013 5:49 PM, Peter Levart wrote: > On 07/08/2013 09:19 AM, David Holmes wrote: >>>> In testing it though I simply exposed the remaining flaws in the >>>> ReferenceHandler code. We can still kill the ReferenceHandler thread >>>> with an OOME when it tries to load the Cleaner class (running with a >>>> 5M heap triggers this nicely if you use G1): >>>> >>>> // Fast path for cleaners >>>> if (r instanceof Cleaner) { >>>> ((Cleaner)r).clean(); >>>> continue; >>>> } >>>> >>>> and if that passes the clean() might throw OOME (it internally tries >>>> to do a System.exit if an exception occurs but will likely encounter >>>> another OOME trying to create the PrivilegedAction). >>>> >>>> Even the: >>>> >>>> ReferenceQueue q = r.queue; >>>> if (q != ReferenceQueue.NULL) q.enqueue(r); >>>> >>>> might throw OOME because enqueue() might have to load the >>>> FinalReference class. >>>> >>>> So really catching the OOME around the wait() only patches a small >>>> hole. We can't simply put a try/catch in the for(;;) loop because that >>>> doesn't address the problem that if the class loading throws OOME then >>>> subsequent attempts to load that class will also fail. We would have >>>> to preload all possible classes. Even then we might just send the >>>> ReferenceHandler thread into a busy loop of throwing OOME catching it >>>> and retrying! >>>> >>>> So I can fix the test to deal with the Xcomp issue but we may still >>>> see intermittent failures, and the ReferenceHandler thread may still >>>> die from OOME. >>> >>> Hi David, >>> >>> I think the test is fine now. >>> >>> Regarding the resilience of ReferenceHandler thread, I think we should >>> try to preload FinalReference, Cleaner and InterruptedException in the >>> initialization phase of ReferenceHandler thread. There should be no >>> danger of OOME in related cases then. >> >> We would need more than that as we need to ensure there is zero >> classloading needed at any point where OOME might be thrown. That >> would include PrivilegedAction and any transitive closure therefrom. > > Hi David, > > I currently don't see any other possibility for another class to be > loaded in the ReferenceHandler's run() method, apart from those that you > indicated and what gets loaded in the the Cleaner.thunk's run() method. Under "normal" conditions all the classes should already be loaded once VM initialization is complete. It is only with very small heaps that we can get the problem during VM initialization itself ... in which case maybe we don't care? Or perhaps that too should be a fatal error? (If a Cleaner has been registered then Cleaner must already be loaded.) Anything loaded via the run() method will be handled the enclosing code in Cleaner. >> >>> As far as Cleaner's exception >>> handler is concerned, I think it is not universally wise to just exit >>> the VM when any exception is thrown by the Cleaner's thunk.run() method. >>> What if that exception is OOME? That does not mean there's something >>> wrong with Cleaner.thunk's code. Not only will this kill >>> ReferenceHandler thread, but entire VM. >> >> Yes "fatal errors" are not uncommon in the JDK, or at least not >> completely rare. The general question is whether continuing might do >> more harm than good given that some "critical" action has failed. Hard >> to know in general so aborting is fairly common response (ala hotspot >> running out of C heap memory). > > Ok then. if we should stick with terminating the VM, what about the > following "allocation-conservative" Cleaner.clean() method: Adding a try/finally in the PrivilegedAction.run() would seem to suffice. David ----- > > private static final class TerminateAction implements > PrivilegedAction { > final Error error = new Error("Cleaner terminated abnormally"); > @Override > public Void run() { > try { > if (System.err != null) error.printStackTrace(); > } finally { > System.exit(1); > } > return null; > } > } > > // pre-allocate single instance of TerminateAction > private static final TerminateAction terminateAction = new > TerminateAction(); > > /** > * Runs this cleaner, if it has not been run before. > */ > public void clean() { > if (!remove(this)) > return; > try { > thunk.run(); > } catch (final Throwable x) { > synchronized (terminateAction) { > if (terminateAction.error.getCause() == null) > terminateAction.error.initCause(x); > } > AccessController.doPrivileged(terminateAction); > } > } > > > Regards, Peter > >> >> Thanks, >> David >> ----- >> >>> If the purpose of exiting VM was attracting attention to the possible >>> bug in Cleaner.thunk's code, then this absolutely works, but wouldn't >>> simple message to System.err be enough? Like for example: >>> >>> >>> public void clean() { >>> if (!remove(this)) >>> return; >>> try { >>> thunk.run(); >>> } catch (final Throwable x) { >>> try { >>> new Error("Cleaner caught exception", x) >>> .printStackTrace(); >>> } catch (OutOfMemoryError oome) { >>> // can't do much >>> } >>> } >>> } >>> >>> >>> Regards, Peter >>> >>>> >>>> David >>>> ----- >>>> >>>> >>>>> >>>>> Regards, Peter >>>>> >>>>> On 07/02/2013 06:38 AM, David Holmes wrote: >>>>>> This recently added test was found to fail under some conditions - >>>>>> namely client compiler with -Xcomp. It seems that the use of all >>>>>> local >>>>>> variables enabled the compiler to optimize things in a way that >>>>>> stopped the weakref from being enqueued as expected. Simple fix >>>>>> was to >>>>>> make the weakref a field. >>>>>> >>>>>> http://cr.openjdk.java.net/~dholmes/8016341/webrev/ >>>>>> >>>>>> Thanks, >>>>>> David >>>>> >>> > From joel.franck at oracle.com Mon Jul 8 09:02:19 2013 From: joel.franck at oracle.com (Joel Borggren-Franck) Date: Mon, 8 Jul 2013 11:02:19 +0200 Subject: Non Inherited repeated annotations should not be searched from child Class In-Reply-To: <51AECBF8.90300@linux.vnet.ibm.com> References: <51ADED9C.1050105@linux.vent.ibm.com> <51AECBF8.90300@linux.vnet.ibm.com> Message-ID: <20130708090219.GA3349@jfranck-desktop.jrpg.bea.com> Hi, Thanks for reporting this. As Alex wrote on the spec list [1] he has clarified the spec. There is a bug filed for this but I don't have time to work on it at the moment. I'll get around to fixing it in the not too distant future though. [1]: http://mail.openjdk.java.net/pipermail/enhanced-metadata-spec-discuss/2013-June/000214.html cheers /Joel On 2013-06-05, Deven You wrote: > Hi All, > > I didn't see this mail in the mailing list for a long time, so I > just comment here to ensure everyone can receive this message. > > Thanks a lot! > On 06/04/2013 09:37 PM, Deven You wrote: > > > >Hi All, > > > >I have written a test case[1] to show this problem. (If it is > >confirmed a real bug, I will convert this test case to jtreg) > > > >My expected output is no any output but OpenJDK returns: > > > >@NonInheritedAnnotationRepeated(name=A) > >@NonInheritedAnnotationRepeated(name=B) > > > >The reasons are: > > > >1. From the spec, Inherited means: > > > >Indicates that an annotation type is automatically inherited. If > >an Inherited meta-annotation is present on an annotation type > >declaration, and the user queries the annotation type on a class > >declaration, and the class declaration has no annotation for this > >type, then the class's superclass will automatically be queried > >for the annotation type. This process will be repeated until an > >annotation for this type is found, or the top of the class > >hierarchy (Object) is reached. If no superclass has an annotation > >for this type, then the query will indicate that the class in > >question has no such annotation. > > > >2. For repeated annotations, according to the explanation of 1., > >If it is non-inherited, querying Child class of this annotation > >should return null. > > > >3. Now the problem is if the repeated annotation is non-inherited, > >but its container annotation is inherited, OpenJDK will return the > >repeated annotations of Parent class if we query the Child class. > > > >It seems according to the Inherited semantics, even when container > >annotation is inherited, we should not retrieve parent class > >non-inherited repeated annotation from a child class. > > > >[1] http://cr.openjdk.java.net/~youdwei/ojdk-810/NonInheritedTest/ > > > From chris.hegarty at oracle.com Mon Jul 8 09:09:12 2013 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Mon, 8 Jul 2013 11:09:12 +0200 Subject: RFR: 8016341 java/lang/ref/OOMEInReferenceHandler.java failing intermittently In-Reply-To: <51DA16EC.5070509@oracle.com> References: <51D25932.7040303@oracle.com> <51D27F05.5020201@gmail.com> <51D603BD.9050708@oracle.com> <51DA16EC.5070509@oracle.com> Message-ID: <4D09C4EC-273F-4F4D-9F81-061F8C4CBF83@oracle.com> On 8 Jul 2013, at 03:33, David Holmes wrote: > Still looking for a reviewer for this please. The test change looks ok to me. -Chris > Thanks, > David > > On 5/07/2013 9:22 AM, David Holmes wrote: >> Hi Peter, >> >> On 2/07/2013 5:19 PM, Peter Levart wrote: >>> Looking at original code once again, I think this was actually a bug. >>> The WeakReference instance constructed in (old) line 82, can be GCed >>> right away, since nobody is using the local variable after assignment. >> >> Of course. Doh! I was to busy thinking about the lifetime of the >> referent object to consider the reference itself. >> >>> If WeakReference is GCed it can not be enqueued. The promotion of local >>> variable into a field is one way to fix this. The other would be to use >>> the local variable somewhere down the code path, like for example in a >>> final throw statement: >>> >>> 110 throw new IllegalStateException("Reference Handler thread >>> stuck. weakRef.get(): " + weakRef.get()); >>> >>> >>> This would also reveal some more info about the WeakReference when >>> there's no sure answer after 10 seconds and could be added to the test >>> anyway. >> >> Okay I've modified the test as suggested. Updated webrev at same location: >> >> http://cr.openjdk.java.net/~dholmes/8016341/webrev/ >> >> In testing it though I simply exposed the remaining flaws in the >> ReferenceHandler code. We can still kill the ReferenceHandler thread >> with an OOME when it tries to load the Cleaner class (running with a 5M >> heap triggers this nicely if you use G1): >> >> // Fast path for cleaners >> if (r instanceof Cleaner) { >> ((Cleaner)r).clean(); >> continue; >> } >> >> and if that passes the clean() might throw OOME (it internally tries to >> do a System.exit if an exception occurs but will likely encounter >> another OOME trying to create the PrivilegedAction). >> >> Even the: >> >> ReferenceQueue q = r.queue; >> if (q != ReferenceQueue.NULL) q.enqueue(r); >> >> might throw OOME because enqueue() might have to load the FinalReference >> class. >> >> So really catching the OOME around the wait() only patches a small hole. >> We can't simply put a try/catch in the for(;;) loop because that doesn't >> address the problem that if the class loading throws OOME then >> subsequent attempts to load that class will also fail. We would have to >> preload all possible classes. Even then we might just send the >> ReferenceHandler thread into a busy loop of throwing OOME catching it >> and retrying! >> >> So I can fix the test to deal with the Xcomp issue but we may still see >> intermittent failures, and the ReferenceHandler thread may still die >> from OOME. >> >> David >> ----- >> >> >>> >>> Regards, Peter >>> >>> On 07/02/2013 06:38 AM, David Holmes wrote: >>>> This recently added test was found to fail under some conditions - >>>> namely client compiler with -Xcomp. It seems that the use of all local >>>> variables enabled the compiler to optimize things in a way that >>>> stopped the weakref from being enqueued as expected. Simple fix was to >>>> make the weakref a field. >>>> >>>> http://cr.openjdk.java.net/~dholmes/8016341/webrev/ >>>> >>>> Thanks, >>>> David >>> From jesper.wilhelmsson at oracle.com Mon Jul 8 10:56:47 2013 From: jesper.wilhelmsson at oracle.com (jesper.wilhelmsson at oracle.com) Date: Mon, 08 Jul 2013 10:56:47 +0000 Subject: hg: jdk8/tl/jdk: 8010734: NPG: The test MemoryTest.java needs to be updated to support metaspace Message-ID: <20130708105700.286CF48890@hg.openjdk.java.net> Changeset: 715d00c95fb2 Author: ehelin Date: 2013-07-08 11:30 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/715d00c95fb2 8010734: NPG: The test MemoryTest.java needs to be updated to support metaspace Reviewed-by: alanb ! test/ProblemList.txt ! test/java/lang/management/MemoryMXBean/MemoryTest.java From sundararajan.athijegannathan at oracle.com Mon Jul 8 13:31:03 2013 From: sundararajan.athijegannathan at oracle.com (sundararajan.athijegannathan at oracle.com) Date: Mon, 08 Jul 2013 13:31:03 +0000 Subject: hg: jdk8/tl/nashorn: 20 new changesets Message-ID: <20130708133120.3DFB54889B@hg.openjdk.java.net> Changeset: 313bdcd2fd22 Author: sundar Date: 2013-07-03 00:08 +0530 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/313bdcd2fd22 8019629: void operator should always evaluate to undefined Reviewed-by: jlaskey ! src/jdk/nashorn/internal/codegen/Attr.java ! src/jdk/nashorn/internal/codegen/CodeGenerator.java ! src/jdk/nashorn/internal/ir/RuntimeNode.java ! src/jdk/nashorn/internal/runtime/ScriptRuntime.java + test/script/basic/JDK-8019629.js Changeset: 9d3a9fdab668 Author: sundar Date: 2013-07-03 13:13 +0530 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/9d3a9fdab668 8019783: typeof does not work properly for java methods and foreign objects Reviewed-by: hannesw ! src/jdk/nashorn/internal/runtime/JSType.java ! src/jdk/nashorn/internal/runtime/ScriptRuntime.java + test/script/basic/JDK-8019783.js + test/script/basic/JDK-8019783.js.EXPECTED ! test/script/basic/NASHORN-759.js.EXPECTED Changeset: 4afdc5bec43b Author: sundar Date: 2013-07-03 14:08 +0530 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/4afdc5bec43b 8019791: ~ is a unary operator Reviewed-by: hannesw ! src/jdk/nashorn/internal/parser/TokenType.java + test/script/basic/JDK-8019791.js + test/script/basic/JDK-8019791.js.EXPECTED Changeset: 18d467e94150 Author: attila Date: 2013-07-03 12:39 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/18d467e94150 8010946: AccessControl.doPrivileged is broken when called from js script Reviewed-by: jlaskey, sundar ! make/build.xml ! src/jdk/internal/dynalink/beans/AbstractJavaLinker.java ! src/jdk/internal/dynalink/beans/ApplicableOverloadedMethods.java + src/jdk/internal/dynalink/beans/CallerSensitiveDetector.java + src/jdk/internal/dynalink/beans/CallerSensitiveDynamicMethod.java ! src/jdk/internal/dynalink/beans/ClassString.java ! src/jdk/internal/dynalink/beans/DynamicMethod.java ! src/jdk/internal/dynalink/beans/DynamicMethodLinker.java ! src/jdk/internal/dynalink/beans/FacetIntrospector.java ! src/jdk/internal/dynalink/beans/MaximallySpecific.java ! src/jdk/internal/dynalink/beans/OverloadedDynamicMethod.java ! src/jdk/internal/dynalink/beans/OverloadedMethod.java ! src/jdk/internal/dynalink/beans/SimpleDynamicMethod.java + src/jdk/internal/dynalink/beans/SingleDynamicMethod.java ! src/jdk/internal/dynalink/beans/StaticClassIntrospector.java ! src/jdk/internal/dynalink/beans/StaticClassLinker.java ! src/jdk/internal/dynalink/support/AbstractCallSiteDescriptor.java ! src/jdk/internal/dynalink/support/Lookup.java ! src/jdk/nashorn/internal/runtime/linker/Bootstrap.java ! src/jdk/nashorn/internal/runtime/linker/JavaAdapterFactory.java ! src/jdk/nashorn/internal/runtime/linker/LinkerCallSite.java ! src/jdk/nashorn/internal/runtime/linker/NashornCallSiteDescriptor.java + test/script/basic/JDK-8010946-2.js + test/script/basic/JDK-8010946-2.js.EXPECTED + test/script/basic/JDK-8010946-privileged.js + test/script/basic/JDK-8010946.js + test/script/basic/JDK-8010946.js.EXPECTED Changeset: b1980b5f00a1 Author: lagergren Date: 2013-07-03 13:03 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/b1980b5f00a1 8019585: Sometimes a var declaration using itself in its init wasn't declared as canBeUndefined, causing erroneous bytecode Reviewed-by: sundar, attila ! src/jdk/nashorn/api/scripting/NashornException.java ! src/jdk/nashorn/internal/codegen/Attr.java ! src/jdk/nashorn/internal/codegen/CodeGenerator.java ! src/jdk/nashorn/internal/objects/ArrayBufferView.java ! src/jdk/nashorn/internal/objects/Global.java ! src/jdk/nashorn/internal/objects/NativeError.java ! src/jdk/nashorn/internal/objects/NativeFloat32Array.java ! src/jdk/nashorn/internal/objects/NativeFloat64Array.java ! src/jdk/nashorn/internal/objects/NativeFunction.java ! src/jdk/nashorn/internal/objects/NativeInt16Array.java ! src/jdk/nashorn/internal/objects/NativeInt32Array.java ! src/jdk/nashorn/internal/objects/NativeInt8Array.java ! src/jdk/nashorn/internal/objects/NativeJava.java ! src/jdk/nashorn/internal/objects/NativeObject.java ! src/jdk/nashorn/internal/objects/NativeRegExp.java ! src/jdk/nashorn/internal/objects/NativeUint16Array.java ! src/jdk/nashorn/internal/objects/NativeUint32Array.java ! src/jdk/nashorn/internal/objects/NativeUint8Array.java ! src/jdk/nashorn/internal/objects/NativeUint8ClampedArray.java ! src/jdk/nashorn/internal/objects/ScriptFunctionImpl.java ! src/jdk/nashorn/internal/runtime/arrays/ObjectArrayData.java + test/script/basic/JDK-8019585.js Changeset: eb1437d16ab4 Author: sundar Date: 2013-07-03 17:26 +0530 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/eb1437d16ab4 8019805: for each (init; test; modify) is invalid Reviewed-by: lagergren, jlaskey ! src/jdk/nashorn/internal/parser/Parser.java ! src/jdk/nashorn/internal/runtime/resources/Messages.properties + test/script/basic/JDK-8019805.js + test/script/basic/JDK-8019805.js.EXPECTED ! test/script/basic/forin.js ! test/script/basic/forin.js.EXPECTED Changeset: 961cffae0828 Author: lagergren Date: 2013-07-03 15:46 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/961cffae0828 8019811: Static calls - self referential functions needed a return type conversion if they were specialized, as they can't use the same mechanism as indy calls Reviewed-by: sundar, jlaskey ! src/jdk/nashorn/internal/codegen/CodeGenerator.java ! test/script/basic/JDK-8016667.js + test/script/basic/JDK-8019808.js + test/script/basic/JDK-8019810.js + test/script/basic/JDK-8019810.js.EXPECTED + test/script/basic/JDK-8019811.js + test/script/basic/JDK-8019817.js + test/script/currently-failing/JDK-8019809.js Changeset: fcb484c43348 Author: sundar Date: 2013-07-03 19:20 +0530 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/fcb484c43348 8019814: Add regression test for passing cases Reviewed-by: jlaskey, lagergren ! src/jdk/nashorn/internal/runtime/ListAdapter.java + test/script/basic/JDK-8019814.js + test/script/basic/JDK-8019814.js.EXPECTED Changeset: 29b2b2ed954c Author: attila Date: 2013-07-03 18:10 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/29b2b2ed954c 8017768: allow dot as inner class name separator for Java.type Reviewed-by: jlaskey, sundar ! docs/JavaScriptingProgrammersGuide.html ! src/jdk/nashorn/internal/objects/NativeJava.java + test/script/basic/JDK-8017768.js + test/script/basic/JDK-8017768.js.EXPECTED ! test/src/jdk/nashorn/test/models/OuterClass.java Changeset: 7b072ebdf5aa Author: jlaskey Date: 2013-07-03 13:41 -0300 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/7b072ebdf5aa 8011629: Object.defineProperty performance issue Reviewed-by: sundar, attila Contributed-by: james.laskey at oracle.com ! src/jdk/nashorn/internal/runtime/AccessorProperty.java Changeset: ad6b18ee4666 Author: attila Date: 2013-07-04 14:10 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/ad6b18ee4666 8019809: return after break incorrectly sets the block as terminal Reviewed-by: jlaskey, lagergren ! src/jdk/nashorn/internal/codegen/Lower.java ! src/jdk/nashorn/internal/ir/BlockLexicalContext.java + test/script/basic/JDK-8019809.js - test/script/currently-failing/JDK-8019809.js Changeset: be2087629eb9 Author: lagergren Date: 2013-07-04 17:27 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/be2087629eb9 8019821: allInteger switches were confused by boolean cases, as they are a narrower type than int Reviewed-by: sundar, hannesw ! src/jdk/nashorn/internal/codegen/Attr.java + test/script/basic/JDK-8019821.js Changeset: 8c4a6d9b8a23 Author: lagergren Date: 2013-07-04 17:28 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/8c4a6d9b8a23 Merge - test/script/currently-failing/JDK-8019809.js Changeset: ec84ba68ad39 Author: sundar Date: 2013-07-05 14:38 +0530 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/ec84ba68ad39 8019947: inherited property invalidation does not work with two globals in same context Reviewed-by: jlaskey, lagergren, hannesw, attila ! make/build-nasgen.xml ! make/build.xml ! src/jdk/nashorn/api/scripting/ScriptObjectMirror.java ! src/jdk/nashorn/internal/codegen/CodeGenerator.java ! src/jdk/nashorn/internal/objects/AccessorPropertyDescriptor.java ! src/jdk/nashorn/internal/objects/ArrayBufferView.java ! src/jdk/nashorn/internal/objects/BoundScriptFunctionImpl.java ! src/jdk/nashorn/internal/objects/DataPropertyDescriptor.java ! src/jdk/nashorn/internal/objects/GenericPropertyDescriptor.java ! src/jdk/nashorn/internal/objects/Global.java ! src/jdk/nashorn/internal/objects/NativeArguments.java ! src/jdk/nashorn/internal/objects/NativeArray.java ! src/jdk/nashorn/internal/objects/NativeArrayBuffer.java ! src/jdk/nashorn/internal/objects/NativeBoolean.java ! src/jdk/nashorn/internal/objects/NativeDate.java ! src/jdk/nashorn/internal/objects/NativeDebug.java ! src/jdk/nashorn/internal/objects/NativeError.java ! src/jdk/nashorn/internal/objects/NativeEvalError.java ! src/jdk/nashorn/internal/objects/NativeFloat32Array.java ! src/jdk/nashorn/internal/objects/NativeFloat64Array.java ! src/jdk/nashorn/internal/objects/NativeFunction.java ! src/jdk/nashorn/internal/objects/NativeInt16Array.java ! src/jdk/nashorn/internal/objects/NativeInt32Array.java ! src/jdk/nashorn/internal/objects/NativeInt8Array.java ! src/jdk/nashorn/internal/objects/NativeJSAdapter.java ! src/jdk/nashorn/internal/objects/NativeJSON.java ! src/jdk/nashorn/internal/objects/NativeJava.java ! src/jdk/nashorn/internal/objects/NativeJavaImporter.java ! src/jdk/nashorn/internal/objects/NativeMath.java ! src/jdk/nashorn/internal/objects/NativeNumber.java ! src/jdk/nashorn/internal/objects/NativeObject.java ! src/jdk/nashorn/internal/objects/NativeRangeError.java ! src/jdk/nashorn/internal/objects/NativeReferenceError.java ! src/jdk/nashorn/internal/objects/NativeRegExp.java ! src/jdk/nashorn/internal/objects/NativeRegExpExecResult.java ! src/jdk/nashorn/internal/objects/NativeStrictArguments.java ! src/jdk/nashorn/internal/objects/NativeString.java ! src/jdk/nashorn/internal/objects/NativeSyntaxError.java ! src/jdk/nashorn/internal/objects/NativeTypeError.java ! src/jdk/nashorn/internal/objects/NativeURIError.java ! src/jdk/nashorn/internal/objects/NativeUint16Array.java ! src/jdk/nashorn/internal/objects/NativeUint32Array.java ! src/jdk/nashorn/internal/objects/NativeUint8Array.java ! src/jdk/nashorn/internal/objects/NativeUint8ClampedArray.java ! src/jdk/nashorn/internal/objects/PrototypeObject.java ! src/jdk/nashorn/internal/objects/ScriptFunctionImpl.java ! src/jdk/nashorn/internal/runtime/Context.java ! src/jdk/nashorn/internal/runtime/GlobalFunctions.java ! src/jdk/nashorn/internal/runtime/GlobalObject.java ! src/jdk/nashorn/internal/runtime/ScriptObject.java ! src/jdk/nashorn/internal/runtime/StructureLoader.java ! src/jdk/nashorn/internal/scripts/JO.java ! src/jdk/nashorn/tools/Shell.java + test/script/basic/JDK-8019947.js + test/script/basic/JDK-8019947.js.EXPECTED Changeset: edca88d3a03e Author: hannesw Date: 2013-07-05 14:36 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/edca88d3a03e 8017084: Use spill properties for large object literals Reviewed-by: lagergren, sundar ! buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ClassGenerator.java ! buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/StringConstants.java ! src/jdk/nashorn/internal/codegen/CodeGenerator.java ! src/jdk/nashorn/internal/codegen/FieldObjectCreator.java ! src/jdk/nashorn/internal/codegen/FinalizeTypes.java ! src/jdk/nashorn/internal/codegen/MapCreator.java ! src/jdk/nashorn/internal/codegen/ObjectClassGenerator.java ! src/jdk/nashorn/internal/codegen/ObjectCreator.java + src/jdk/nashorn/internal/codegen/SpillObjectCreator.java ! src/jdk/nashorn/internal/ir/FunctionNode.java ! src/jdk/nashorn/internal/ir/LiteralNode.java ! src/jdk/nashorn/internal/ir/debug/JSONWriter.java ! src/jdk/nashorn/internal/objects/NativeArguments.java ! src/jdk/nashorn/internal/objects/NativeStrictArguments.java ! src/jdk/nashorn/internal/objects/PrototypeObject.java ! src/jdk/nashorn/internal/objects/ScriptFunctionImpl.java ! src/jdk/nashorn/internal/parser/Parser.java ! src/jdk/nashorn/internal/runtime/AccessorProperty.java ! src/jdk/nashorn/internal/runtime/PropertyMap.java ! src/jdk/nashorn/internal/runtime/ScriptObject.java ! src/jdk/nashorn/internal/scripts/JO.java + test/script/basic/JDK-8017084.js + test/script/basic/JDK-8017084.js.EXPECTED Changeset: ce9cbe70f915 Author: attila Date: 2013-07-05 15:10 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/ce9cbe70f915 8019819: scope symbol didn't get a slot in certain cases Reviewed-by: hannesw, jlaskey, lagergren, sundar ! src/jdk/nashorn/internal/codegen/Attr.java ! src/jdk/nashorn/internal/codegen/CodeGenerator.java ! src/jdk/nashorn/internal/codegen/CompilationPhase.java ! src/jdk/nashorn/internal/codegen/FinalizeTypes.java ! src/jdk/nashorn/internal/ir/FunctionNode.java ! src/jdk/nashorn/internal/ir/LexicalContext.java ! src/jdk/nashorn/internal/ir/Symbol.java ! src/jdk/nashorn/internal/parser/Parser.java + test/script/basic/JDK-8019819.js Changeset: 20b2c2dc20e8 Author: lagergren Date: 2013-07-05 19:35 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/20b2c2dc20e8 8019983: Void returns combined with return with expression picked the wrong return type Reviewed-by: sundar, jlaskey ! src/jdk/nashorn/internal/codegen/Attr.java + test/script/basic/JDK-8019983.js + test/script/basic/JDK-8019983.js.EXPECTED Changeset: 36d6b6a3fbe0 Author: sundar Date: 2013-07-08 16:33 +0530 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/36d6b6a3fbe0 8020015: shared PropertyMaps should not be used without duplication Reviewed-by: hannesw, attila ! buildtools/nasgen/build.xml ! buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ClassGenerator.java ! buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ConstructorGenerator.java ! buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/MethodGenerator.java ! buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/PrototypeGenerator.java ! buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ScriptClassInstrumentor.java ! buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/StringConstants.java ! make/code_coverage.xml ! make/project.properties ! src/jdk/nashorn/internal/lookup/Lookup.java ! src/jdk/nashorn/internal/objects/ArrayBufferView.java ! src/jdk/nashorn/internal/objects/Global.java ! src/jdk/nashorn/internal/objects/NativeArguments.java ! src/jdk/nashorn/internal/objects/NativeBoolean.java ! src/jdk/nashorn/internal/objects/NativeDebug.java ! src/jdk/nashorn/internal/objects/NativeError.java ! src/jdk/nashorn/internal/objects/NativeJSAdapter.java ! src/jdk/nashorn/internal/objects/NativeJSON.java ! src/jdk/nashorn/internal/objects/NativeMath.java ! src/jdk/nashorn/internal/objects/NativeStrictArguments.java ! src/jdk/nashorn/internal/objects/PrototypeObject.java ! src/jdk/nashorn/internal/objects/ScriptFunctionImpl.java ! src/jdk/nashorn/internal/runtime/AccessorProperty.java ! src/jdk/nashorn/internal/runtime/Context.java ! src/jdk/nashorn/internal/runtime/PropertyListenerManager.java ! src/jdk/nashorn/internal/runtime/PropertyMap.java ! src/jdk/nashorn/internal/runtime/ScriptEnvironment.java ! src/jdk/nashorn/internal/runtime/ScriptObject.java ! src/jdk/nashorn/internal/runtime/resources/Options.properties ! src/jdk/nashorn/internal/scripts/JO.java ! src/jdk/nashorn/tools/Shell.java Changeset: a75e75cc6a61 Author: sundar Date: 2013-07-08 18:36 +0530 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/a75e75cc6a61 8020035: nashorn jdk buildfile BuildNashorn.gmk still renamed jdk.nashorn.internal.objects package Reviewed-by: attila, jlaskey ! makefiles/BuildNashorn.gmk Changeset: c96745616167 Author: sundar Date: 2013-07-08 18:43 +0530 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/c96745616167 Merge From paul.sandoz at oracle.com Mon Jul 8 15:22:39 2013 From: paul.sandoz at oracle.com (Paul Sandoz) Date: Mon, 8 Jul 2013 17:22:39 +0200 Subject: RFR 8019395 Consolidate StreamSupport.{stream, parallelStream} into a single method Message-ID: Hi, This patch reduced the methods on j.u.stream.StreamSupport from 16 to 8: http://cr.openjdk.java.net/~psandoz/tl/JDK-8019395-StreamSupport/webrev/ Instead of methods stream/parallelStream, and inStream/intParallelStream etc, there is just stream, and intStream etc, that take a boolean value controlling whether the stream is parallel or sequential. There are lots of small changes to source due to the refactoring (most which was done automatically). Paul. From dl at cs.oswego.edu Mon Jul 8 15:24:15 2013 From: dl at cs.oswego.edu (Doug Lea) Date: Mon, 08 Jul 2013 11:24:15 -0400 Subject: Possible HashMap update In-Reply-To: <51D4ABDA.7010801@cs.oswego.edu> References: <51D4ABDA.7010801@cs.oswego.edu> Message-ID: <51DAD99F.9030705@cs.oswego.edu> On 07/05/13 04:55, Paul Sandoz wrote: >> I played with these in the lambda repo. >> >> I needed to make the following additional change for things to compile: >> >> --- a/src/share/classes/java/io/ExpiringCache.java Fri Jul 05 10:04:00 2013 +0200 >> +++ b/src/share/classes/java/io/ExpiringCache.java Fri Jul 05 10:45:10 2013 +0200 >> ... Thanks to those chasing this down, now recorded as a CR at: http://bugs.sun.com/view_bug.do?bug_id=8017219 Some might think this is a fun javac corner case to read about, but for present purposes, the moral is that the name of the internal LinkedHashMap.Entry class, even though it is never exported, cannot be changed without impacting re-compilability of some external usages. Fine. We can cope. For people still following along, see updates at... http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/src/dl/java/util/HashMap.java?view=log http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/src/dl/java/util/LinkedHashMap.java?view=log From paul.sandoz at oracle.com Mon Jul 8 15:56:02 2013 From: paul.sandoz at oracle.com (Paul Sandoz) Date: Mon, 8 Jul 2013 17:56:02 +0200 Subject: RFR 8020040: Improve and generalize the F/J tasks to handle right or left-balanced trees Message-ID: <290509C5-9C6C-47AC-AF73-F80D3816942A@oracle.com> Hi, This patch, contributed by Doug Lea, improves stream resource management of F/J tasks when processing right-balanced (or more accurately right-heavy) trees (e.g. those created from sequential sources): http://cr.openjdk.java.net/~psandoz/tl/JDK-8020040-tasks/webrev/ It took us a while but the end result is remarkably simple: alternate the forking of left and right tasks. Large or infinite stream sources hooked up a short-circuiting operation such as limit no longer consume ridiculous amounts of memory. This patch is related to a previous one Henry sent for review (remove catching of OOMEs for splterators from sequential sources) Paul. From dlloyd at redhat.com Tue Jul 2 13:55:15 2013 From: dlloyd at redhat.com (David M. Lloyd) Date: Tue, 02 Jul 2013 08:55:15 -0500 Subject: @CallerSensitive as public API ? In-Reply-To: <51CA1CE3.6050203@oracle.com> References: <51C9760F.7000007@gmail.com> <51C9EE5B.8050300@oracle.com> <51CA1CE3.6050203@oracle.com> Message-ID: <51D2DBC3.6080403@redhat.com> On 6/25/13 5:42 PM, Mandy Chung wrote: > On 6/25/13 3:04 PM, David Lloyd wrote: >> We have a use case within our security manager implementation that >> *can* be solved with the existing getClassContext method, which >> returns the whole stack, except we don't *need* the whole stack, just >> one specific frame. Maybe SecurityManager is a good place for this API? > > Which frame do you need? How do you use it? Typically it's the frame belonging to whomever called the method on the class. So it's not a search situation, it's a constant offset. >> As an aside, getClassContext returns a Class[]; maybe it should be >> changed to Class[] instead. > > Ah. I can fix that in my fix for 8007035 [1]. > > Mandy > [1] > http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-June/018327.html >> -- >> - DML >> >> >> On Jun 25, 2013, at 8:35 PM, Mandy Chung wrote: >> >>> On 6/25/13 3:50 AM, Peter Levart wrote: >>>> Hi, >>>> >>>> I know that @CallerSensitive annotation was introduced to bring some >>>> order to JDK internal plumbings. It's scope was to support JDK >>>> internal usage, so it's use is limited to classes loaded by >>>> bootstrap or extension class-loaders. In JDK-internal code it is >>>> used mainly for implementing security-sensitive decisions. But since >>>> the sun.reflect.Reflection.getCallerClass(int) was public and >>>> unrestricted, it found it's way out into user code, where at least I >>>> know that it is used in two areas: >>>> >>>> 1 - to locate callers in the whole call-stack so that their location >>>> in class-path can be reported (Log4J is an example) >>>> 2 - to locate immediate caller so that some resources associated >>>> with it can be located and used (for example localization data in >>>> GUI applications) >>>> >>>> I don't know how wide-spread 1st usecase is, but the 2nd is common, >>>> since it's use enables APIs that need not explicitly pass-in the >>>> calling class in order to locate resources associated with it >>>> (and/or the class-loader of it). So it would be nice to have such >>>> supported API in JDK8 at least. >>> It's good to know these use cases. We leave the method in 7 update >>> release so as to allow time for applications to transition and also >>> determine any use case that the SE API should provide if there is no >>> replacement for it. >>> >>>> I'm asking here, to hear any arguments against making such API >>>> supported and public. Are there any security or other issues? If >>>> there aren't, what steps should be taken to introduce such API in >>>> the JDK8 timeframe? I'm thinking of a no-arg method, say >>>> j.l.Class.getCaller() and moving @CallerSensitive to a supported >>>> package + enabling it to mark methods in any class (not just system >>>> and ext classes)... >>> Besides providing a method returning the caller's class, I'd like to >>> consider what other options we have and different use cases could be >>> satisfied by different API. For #2, the problem is that the API to >>> find a resource, it requires to use the ClassLoader with the right >>> visibility (the caller's class loader). This is similiar to 8013839 >>> : Enhance Logger API for handling of resource bundles [1]. For >>> example, a static method Class.getResource to use the caller's class >>> loader to find the given resource might be an alternative? >>> >>> About the timeframe, the API freeze date [2] is Oct 10. If the API >>> is simple and small effort (test development, security assessement, >>> etc), there is chance to get that in for jdk8. >>> >>> Mandy >>> [1] http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8013839 >>> [2] >>> http://openjdk.java.net/projects/jdk8/milestones#API_Interface_Freeze >>> > -- - DML From feng.l.liu at oracle.com Mon Jul 8 06:35:22 2013 From: feng.l.liu at oracle.com (feng l.liu) Date: Mon, 08 Jul 2013 14:35:22 +0800 Subject: PermGen leak Message-ID: <51DA5DAA.8020204@oracle.com> Hello Experts, I am building up a test tool with ant, but I encountered so many DelegatingClassLoaders that put pressures on PermGen. I know that DelegatingClassLoaders are caused by java reflection. Google search show some posts indicating generation of DelegatingClassLoader will be depressed if sun.reflect.inflationThreshold to zero , I tried it and found that this idea did not work at all. I dived into the code and found the snippets as below: It looks that the DelegatingClassLoader will go away if I set sun.reflect.noInflation = true and sun.reflect.inflationThreshold to Integer.MAX_VALUE. I tried it again but this idea did not work as well. can you please give me some advices on this leak? thank you in advance ReflectionFactory.java String val = System.getProperty("sun.reflect.noInflation"); if (val != null && val.equals("true")) { noInflation = true; } val = System.getProperty("sun.reflect.inflationThreshold"); if (val != null) { try { inflationThreshold = Integer.parseInt(val); } catch (NumberFormatException e) { throw (RuntimeException) new RuntimeException("Unable to parse property sun.reflect.inflationThreshold"). initCause(e); } } initted = true; return null; } NativeMethodAccessorImpl.java public Object invoke(Object obj, Object[] args) throws IllegalArgumentException, InvocationTargetException { if (++numInvocations > ReflectionFactory.inflationThreshold()) { MethodAccessorImpl acc = (MethodAccessorImpl) new MethodAccessorGenerator(). generateMethod(method.getDeclaringClass(), method.getName(), method.getParameterTypes(), method.getReturnType(), method.getExceptionTypes(), method.getModifiers()); parent.setDelegate(acc); } return invoke0(method, obj, args); } Best regards From ivan.gerasimov at oracle.com Mon Jul 8 16:55:47 2013 From: ivan.gerasimov at oracle.com (Ivan Gerasimov) Date: Mon, 08 Jul 2013 20:55:47 +0400 Subject: RFR [8016838] java/lang/instrument/RedefineBigClass.sh needs modification In-Reply-To: <51D6B1ED.9090709@oracle.com> References: <51D45B8C.7010109@oracle.com> <51D595ED.7050902@oracle.com> <51D5AEB6.3060608@oracle.com> <51D5B4C5.7060402@oracle.com> <51D61A66.5010001@oracle.com> <51D64D15.2090105@oracle.com> <51D6A59A.1060703@oracle.com> <51D6B1ED.9090709@oracle.com> Message-ID: <51DAEF13.8010000@oracle.com> Thanks, Se?n! I located the build in which the memleak was first introduced -- it is jdk8-b69 (hs25-b13). I've updated the bug http://bugs.sun.com/view_bug.do?bug_id=8019845 with this. So what is the correct procedure to go forward now? Should I update the webrev to include changes to the problem list? I believe I shouldn't -- this list seems to be a sensitive stuff. Sincerely yours, Ivan On 05.07.2013 15:45, Se?n Coffey wrote: > Nice work indeed Ivan. Good to have a reliable testcase to catch leaks > in this area. > > I'd also suggest that this test goes on the ProblemList until the new > leak is sorted out for jdk8. The goal of JPRT runs is to have clean > runs. If it's on the problemList, then it's a known issue and is > normally tagged with the relevant bug ID so that the responsible > engineer knows the current state. > > regards, > Sean. > > On 05/07/2013 11:53, Ivan Gerasimov wrote: >> >> On 05.07.2013 8:35, Daniel D. Daugherty wrote: >>> Ivan, >>> >>> The changes look fine, I can sponsor your commit, looks like your >>> OpenJDK user name is 'igerasim', but I need to know a little bit >>> more about your testing of these fixes. Did you do a test JPRT >>> job to run the JLI tests (or just the two tests themselves)? >>> >> I've only run test from java/lang/instrument when checked the change >> with JDK6u60 (all passed) and with JDK6u51 (the test failed as >> expected, since the leak had still been there.) >> >>> Based on e-mail about this bug fix, I believe you've found a new >>> leak in JDK8/HSX-25 with test java/lang/instrument/RedefineBigClass.sh. >> Right. The test shown a memleak with the the latest jdk8. >> I filed a bug 8019845 about this leak. >> Stefan Karlsson guessed that this may be related to 8003419 (NPG: >> Clean up metadata created during class loading if failure) >> Then I've checked the builds b57 (test failed) and b58 (test passed), >> so I confirmed that it may be the reason of the leak being observed now. >> But now I think that the reason may be different. >> It just turns out that the test shows failures for (at least) three >> different leaks - the one you, Daniel, solved (7121600), the one >> Stefan wrote about (8003419) and the one currently observed (8019845). >> >>> That's a good thing, but I think Alan and company would be a bit >>> grumpy with me if I pushed a test that failed as soon as someone >>> ran it. :-) Do you know if the revised RetransformBigClass.sh also >>> finds a new memory leak in JDK8/HSX-25? >>> >>> The way to deal with that is to put the test on the Problem.list >>> as part of the same changeset. However, the T&L folks might not like >>> that either... >> >> Well, the leak is there, and why not have a failing test as a >> reminder to have it fixed? >> >> Sincerely yours, >> Ivan Gerasimov >> >>> >>> Dan >>> >>> >>> On 7/4/13 6:59 PM, Ivan Gerasimov wrote: >>>> Thank you, Daniel! >>>> >>>> Please find an updated webrev at >>>> http://cr.openjdk.java.net/~igerasim/8016838/2/webrev/. >>>> It now includes the RetransformBigClass test modified in the same >>>> way as RedefineBigClass >>>> If the changes look fine, may I ask you to sponsor the commit, as >>>> I'm not a committer? >>>> Here's a link to hg export: >>>> http://cr.openjdk.java.net/~igerasim/2commit/8016838-jdk8-ReBigClass-improved.patch >>>> >>>> >>>> Thanks in advance, >>>> Ivan >>>> >>>> On 04.07.2013 21:45, Daniel D. Daugherty wrote: >>>>> On 7/4/13 11:19 AM, Ivan Gerasimov wrote: >>>>>> Daniel, thank you for review! >>>>>> >>>>>> Here's the updated with all all your suggestions adopted. >>>>>> http://cr.openjdk.java.net/~igerasim/8016838/1/webrev/ >>>>> >>>>> Looks good. >>>>> >>>>> >>>>>> >>>>>> I haven't yet considered applying the approach to >>>>>> RetransformBigClass. >>>>>> Do you want me to include this into this same change set or >>>>>> should I make it separately? >>>>> >>>>> I would include it in the same changeset. >>>>> >>>>> Dan >>>>> >>>>> >>>>>> >>>>>> Sincerely yours, >>>>>> Ivan >>>>>> >>>>>> >>>>>> On 04.07.2013 19:34, Daniel D. Daugherty wrote: >>>>>>> On 7/3/13 11:12 AM, Ivan Gerasimov wrote: >>>>>>>> Hello everybody! >>>>>>>> >>>>>>>> We have a request to improve jtreg test. >>>>>>>> The test had been written to verify fix for memory leak during >>>>>>>> class redefinition. >>>>>>>> The problem is that it always is reported as PASSED even in the >>>>>>>> presence of the leak. >>>>>>>> >>>>>>>> The proposed change is platform specific. >>>>>>>> It allows memory leak detection only on Linux. >>>>>>>> This is because the memory leak was in native code, so there's >>>>>>>> no easy way to detect it from within Java code. >>>>>>>> >>>>>>>> Here's the webrev for JDK8 repository: >>>>>>>> http://cr.openjdk.java.net/~igerasim/8016838/0/webrev/ >>>>>>> >>>>>>> Very nicely done! The logic in RedefineBigClass.sh only catches a >>>>>>> leak big enough to cause an Exception to be thrown. >>>>>>> >>>>>>> When I originally wrote this test and its companion: >>>>>>> >>>>>>> test/java/lang/instrument/RetransformBigClass* >>>>>>> >>>>>>> I could not come up with a platform independent way to put a small >>>>>>> upper limit on memory growth. It never dawned on me that putting in >>>>>>> something on one platform (Linux) was better than nothing. >>>>>>> >>>>>>> Are you planning to add this same logic to RetransformBigClass*? >>>>>>> >>>>>>> >>>>>>> >>>>>>> test/java/lang/instrument/RedefineBigClass.sh >>>>>>> No comments. >>>>>>> >>>>>>> test/java/lang/instrument/RedefineBigClassApp.java >>>>>>> line 48: final long MEM_LEAK_THRESHOLD = 32 * 1024; // 32Mb >>>>>>> Would be better at the top of RedefineBigClassApp rather >>>>>>> than >>>>>>> "buried" down here. >>>>>>> >>>>>>> line 51: Long.valueOf(vmMemDelta) >>>>>>> There are several places where a long is passed to >>>>>>> Long.valueOf(). >>>>>>> Is there some reason you're not passing them directly to >>>>>>> println()? >>>>>>> >>>>>>> line 54: } else { >>>>>>> The "else" is redundant due to the "System.exit(1)" call >>>>>>> above it. >>>>>>> You can drop the "else {" and "}" and shift that last >>>>>>> println() to >>>>>>> the left. >>>>>>> >>>>>>> line 71: return Long.parseLong(line.split(" ")[22]) / 1024; >>>>>>> How about at least a comment referring to the Linux proc(5) >>>>>>> man page... and the fact that the 23rd field is: >>>>>>> >>>>>>> vsize %lu Virtual memory size in bytes. >>>>>>> >>>>>>> Again, very nicely done! >>>>>>> >>>>>>> Dan >>>>>>> >>>>>>> >>>>>>>> >>>>>>>> The surprising thing is that modified test detected the leak >>>>>>>> with the latest JDK8! >>>>>>>> Latest 6 and 7 are fine, so it might be regression in JDK8. >>>>>>>> >>>>>>>> I've filled a bug >>>>>>>> http://bugs.sun.com/view_bug.do?bug_id=8019845 "Memory leak >>>>>>>> during class redefenition" (not yet available.) >>>>>>>> >>>>>>>> Sincerely yours, >>>>>>>> Ivan Gerasimov >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>> >>>>> >>>>> >>>>> >>>> >>> >> > > > From bill.pittore at oracle.com Mon Jul 8 16:56:06 2013 From: bill.pittore at oracle.com (BILL PITTORE) Date: Mon, 08 Jul 2013 12:56:06 -0400 Subject: RFR - Changes to address CCC 8014135: Support for statically linked agents In-Reply-To: <51D5A5CD.2070805@oracle.com> References: <51D494E9.2020200@oracle.com> <51D5A5CD.2070805@oracle.com> Message-ID: <51DAEF26.5030204@oracle.com> On 7/4/2013 12:41 PM, Alan Bateman wrote: > On 03/07/2013 22:17, BILL PITTORE wrote: >> These changes address bug 8014135 which adds support for statically >> linked agents in the VM. This is a followup to the recent JNI spec >> changes that addressed statically linked JNI libraries( 8005716). >> The JEP for this change is the same JEP as the JNI changes: >> http://openjdk.java.net/jeps/178 >> >> Webrevs are here: >> >> http://cr.openjdk.java.net/~bpittore/8014135/jdk/webrev.00/ > > I looked at the javadoc updates to the attach API. > > One thing that doesn't come across very clearly is the mapping from > the agentLibrary parameter to "agent-lib-name". I think that needs a > few words so that it's clear that it is not literally looking for > "Agent_OnAttach_agent-lib-name" but rather "Agent_OnAttach" + > where is the library name in the > agentLibrary parameter. > > As I recall, the JVM Tool Interface is supposed to be referred so as > "JVM TI" rather than "JVMTI". Ok, I'll try to re-word it and send it out again. bill > > Otherwise it looks okay to me. > > -Alan > > > > From paul.sandoz at oracle.com Mon Jul 8 17:11:19 2013 From: paul.sandoz at oracle.com (Paul Sandoz) Date: Mon, 8 Jul 2013 19:11:19 +0200 Subject: RFR 8019395 Consolidate StreamSupport.{stream, parallelStream} into a single method In-Reply-To: References: Message-ID: <907C289C-4F81-47D9-80FF-48B0041EE893@oracle.com> I updated the patch and fixed JavaDoc issues to StreamSupport based on feedback from Henry. Changes can be seen here: http://hg.openjdk.java.net/lambda/lambda/jdk/rev/be7d33d54613 Paul. On Jul 8, 2013, at 5:22 PM, Paul Sandoz wrote: > Hi, > > This patch reduced the methods on j.u.stream.StreamSupport from 16 to 8: > > http://cr.openjdk.java.net/~psandoz/tl/JDK-8019395-StreamSupport/webrev/ > > Instead of methods stream/parallelStream, and inStream/intParallelStream etc, there is just stream, and intStream etc, that take a boolean value controlling whether the stream is parallel or sequential. > > There are lots of small changes to source due to the refactoring (most which was done automatically). > > Paul. From sean.coffey at oracle.com Mon Jul 8 17:27:56 2013 From: sean.coffey at oracle.com (=?UTF-8?B?U2XDoW4gQ29mZmV5?=) Date: Mon, 08 Jul 2013 18:27:56 +0100 Subject: RFR [8016838] java/lang/instrument/RedefineBigClass.sh needs modification In-Reply-To: <51DAEF13.8010000@oracle.com> References: <51D45B8C.7010109@oracle.com> <51D595ED.7050902@oracle.com> <51D5AEB6.3060608@oracle.com> <51D5B4C5.7060402@oracle.com> <51D61A66.5010001@oracle.com> <51D64D15.2090105@oracle.com> <51D6A59A.1060703@oracle.com> <51D6B1ED.9090709@oracle.com> <51DAEF13.8010000@oracle.com> Message-ID: <51DAF69C.3000404@oracle.com> On 08/07/13 17:55, Ivan Gerasimov wrote: > Thanks, Se?n! > > I located the build in which the memleak was first introduced -- it is > jdk8-b69 (hs25-b13). > I've updated the bug http://bugs.sun.com/view_bug.do?bug_id=8019845 > with this. > > So what is the correct procedure to go forward now? > Should I update the webrev to include changes to the problem list? > I believe I shouldn't -- this list seems to be a sensitive stuff. I'd suggest updating the webrev with the ProblemList modification/addition. It's best not to add a test to testruns if it's knowingly failing. The test can be removed from ProblemList when the jdk8 regression is fixed. regards, Sean. > > Sincerely yours, > Ivan > > > On 05.07.2013 15:45, Se?n Coffey wrote: >> Nice work indeed Ivan. Good to have a reliable testcase to catch >> leaks in this area. >> >> I'd also suggest that this test goes on the ProblemList until the new >> leak is sorted out for jdk8. The goal of JPRT runs is to have clean >> runs. If it's on the problemList, then it's a known issue and is >> normally tagged with the relevant bug ID so that the responsible >> engineer knows the current state. >> >> regards, >> Sean. >> >> On 05/07/2013 11:53, Ivan Gerasimov wrote: >>> >>> On 05.07.2013 8:35, Daniel D. Daugherty wrote: >>>> Ivan, >>>> >>>> The changes look fine, I can sponsor your commit, looks like your >>>> OpenJDK user name is 'igerasim', but I need to know a little bit >>>> more about your testing of these fixes. Did you do a test JPRT >>>> job to run the JLI tests (or just the two tests themselves)? >>>> >>> I've only run test from java/lang/instrument when checked the change >>> with JDK6u60 (all passed) and with JDK6u51 (the test failed as >>> expected, since the leak had still been there.) >>> >>>> Based on e-mail about this bug fix, I believe you've found a new >>>> leak in JDK8/HSX-25 with test >>>> java/lang/instrument/RedefineBigClass.sh. >>> Right. The test shown a memleak with the the latest jdk8. >>> I filed a bug 8019845 about this leak. >>> Stefan Karlsson guessed that this may be related to 8003419 (NPG: >>> Clean up metadata created during class loading if failure) >>> Then I've checked the builds b57 (test failed) and b58 (test >>> passed), so I confirmed that it may be the reason of the leak being >>> observed now. >>> But now I think that the reason may be different. >>> It just turns out that the test shows failures for (at least) three >>> different leaks - the one you, Daniel, solved (7121600), the one >>> Stefan wrote about (8003419) and the one currently observed (8019845). >>> >>>> That's a good thing, but I think Alan and company would be a bit >>>> grumpy with me if I pushed a test that failed as soon as someone >>>> ran it. :-) Do you know if the revised RetransformBigClass.sh also >>>> finds a new memory leak in JDK8/HSX-25? >>>> >>>> The way to deal with that is to put the test on the Problem.list >>>> as part of the same changeset. However, the T&L folks might not like >>>> that either... >>> >>> Well, the leak is there, and why not have a failing test as a >>> reminder to have it fixed? >>> >>> Sincerely yours, >>> Ivan Gerasimov >>> >>>> >>>> Dan >>>> >>>> >>>> On 7/4/13 6:59 PM, Ivan Gerasimov wrote: >>>>> Thank you, Daniel! >>>>> >>>>> Please find an updated webrev at >>>>> http://cr.openjdk.java.net/~igerasim/8016838/2/webrev/. >>>>> It now includes the RetransformBigClass test modified in the same >>>>> way as RedefineBigClass >>>>> If the changes look fine, may I ask you to sponsor the commit, as >>>>> I'm not a committer? >>>>> Here's a link to hg export: >>>>> http://cr.openjdk.java.net/~igerasim/2commit/8016838-jdk8-ReBigClass-improved.patch >>>>> >>>>> >>>>> Thanks in advance, >>>>> Ivan >>>>> >>>>> On 04.07.2013 21:45, Daniel D. Daugherty wrote: >>>>>> On 7/4/13 11:19 AM, Ivan Gerasimov wrote: >>>>>>> Daniel, thank you for review! >>>>>>> >>>>>>> Here's the updated with all all your suggestions adopted. >>>>>>> http://cr.openjdk.java.net/~igerasim/8016838/1/webrev/ >>>>>> >>>>>> Looks good. >>>>>> >>>>>> >>>>>>> >>>>>>> I haven't yet considered applying the approach to >>>>>>> RetransformBigClass. >>>>>>> Do you want me to include this into this same change set or >>>>>>> should I make it separately? >>>>>> >>>>>> I would include it in the same changeset. >>>>>> >>>>>> Dan >>>>>> >>>>>> >>>>>>> >>>>>>> Sincerely yours, >>>>>>> Ivan >>>>>>> >>>>>>> >>>>>>> On 04.07.2013 19:34, Daniel D. Daugherty wrote: >>>>>>>> On 7/3/13 11:12 AM, Ivan Gerasimov wrote: >>>>>>>>> Hello everybody! >>>>>>>>> >>>>>>>>> We have a request to improve jtreg test. >>>>>>>>> The test had been written to verify fix for memory leak during >>>>>>>>> class redefinition. >>>>>>>>> The problem is that it always is reported as PASSED even in >>>>>>>>> the presence of the leak. >>>>>>>>> >>>>>>>>> The proposed change is platform specific. >>>>>>>>> It allows memory leak detection only on Linux. >>>>>>>>> This is because the memory leak was in native code, so there's >>>>>>>>> no easy way to detect it from within Java code. >>>>>>>>> >>>>>>>>> Here's the webrev for JDK8 repository: >>>>>>>>> http://cr.openjdk.java.net/~igerasim/8016838/0/webrev/ >>>>>>>> >>>>>>>> Very nicely done! The logic in RedefineBigClass.sh only catches a >>>>>>>> leak big enough to cause an Exception to be thrown. >>>>>>>> >>>>>>>> When I originally wrote this test and its companion: >>>>>>>> >>>>>>>> test/java/lang/instrument/RetransformBigClass* >>>>>>>> >>>>>>>> I could not come up with a platform independent way to put a small >>>>>>>> upper limit on memory growth. It never dawned on me that >>>>>>>> putting in >>>>>>>> something on one platform (Linux) was better than nothing. >>>>>>>> >>>>>>>> Are you planning to add this same logic to RetransformBigClass*? >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> test/java/lang/instrument/RedefineBigClass.sh >>>>>>>> No comments. >>>>>>>> >>>>>>>> test/java/lang/instrument/RedefineBigClassApp.java >>>>>>>> line 48: final long MEM_LEAK_THRESHOLD = 32 * 1024; // 32Mb >>>>>>>> Would be better at the top of RedefineBigClassApp >>>>>>>> rather than >>>>>>>> "buried" down here. >>>>>>>> >>>>>>>> line 51: Long.valueOf(vmMemDelta) >>>>>>>> There are several places where a long is passed to >>>>>>>> Long.valueOf(). >>>>>>>> Is there some reason you're not passing them directly >>>>>>>> to println()? >>>>>>>> >>>>>>>> line 54: } else { >>>>>>>> The "else" is redundant due to the "System.exit(1)" >>>>>>>> call above it. >>>>>>>> You can drop the "else {" and "}" and shift that last >>>>>>>> println() to >>>>>>>> the left. >>>>>>>> >>>>>>>> line 71: return Long.parseLong(line.split(" ")[22]) / 1024; >>>>>>>> How about at least a comment referring to the Linux >>>>>>>> proc(5) >>>>>>>> man page... and the fact that the 23rd field is: >>>>>>>> >>>>>>>> vsize %lu Virtual memory size in bytes. >>>>>>>> >>>>>>>> Again, very nicely done! >>>>>>>> >>>>>>>> Dan >>>>>>>> >>>>>>>> >>>>>>>>> >>>>>>>>> The surprising thing is that modified test detected the leak >>>>>>>>> with the latest JDK8! >>>>>>>>> Latest 6 and 7 are fine, so it might be regression in JDK8. >>>>>>>>> >>>>>>>>> I've filled a bug >>>>>>>>> http://bugs.sun.com/view_bug.do?bug_id=8019845 "Memory leak >>>>>>>>> during class redefenition" (not yet available.) >>>>>>>>> >>>>>>>>> Sincerely yours, >>>>>>>>> Ivan Gerasimov >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>> >>>>>> >>>>>> >>>>>> >>>>> >>>> >>> >> >> >> > From henry.jen at oracle.com Mon Jul 8 18:31:12 2013 From: henry.jen at oracle.com (Henry Jen) Date: Mon, 08 Jul 2013 11:31:12 -0700 Subject: RFR: 8017141: java.util/stream Spliterators from sequential sources should not catch OOME In-Reply-To: References: <51D4AB0E.8090501@oracle.com> Message-ID: <51DB0570.4030708@oracle.com> On 07/04/2013 12:01 AM, Paul Sandoz wrote: > On Jul 4, 2013, at 12:51 AM, Henry Jen wrote: >> Hi, >> >> Please review the webrev at >> >> http://cr.openjdk.java.net/~henryjen/tl/8017141.0/webrev/ >> > > Note that the same change has already been fixed/pushed forrelevant implementations in j.u.c. > > This change in part of a wider change to fix rampant resource usage in some scenarios (other impl changes will follow from lambda to tl later on). > > Paul. > Ping again. This is a relative small/straightforward change, and as Paul suggested it's in a larger context of other changes. Cheers, Henry From forax at univ-mlv.fr Mon Jul 8 18:54:10 2013 From: forax at univ-mlv.fr (Remi Forax) Date: Mon, 08 Jul 2013 20:54:10 +0200 Subject: RFR: 8017141: java.util/stream Spliterators from sequential sources should not catch OOME In-Reply-To: <51DB0570.4030708@oracle.com> References: <51D4AB0E.8090501@oracle.com> <51DB0570.4030708@oracle.com> Message-ID: <51DB0AD2.5000304@univ-mlv.fr> On 07/08/2013 08:31 PM, Henry Jen wrote: > On 07/04/2013 12:01 AM, Paul Sandoz wrote: >> On Jul 4, 2013, at 12:51 AM, Henry Jen wrote: >>> Hi, >>> >>> Please review the webrev at >>> >>> http://cr.openjdk.java.net/~henryjen/tl/8017141.0/webrev/ >>> >> Note that the same change has already been fixed/pushed forrelevant implementations in j.u.c. >> >> This change in part of a wider change to fix rampant resource usage in some scenarios (other impl changes will follow from lambda to tl later on). >> >> Paul. >> > Ping again. > > This is a relative small/straightforward change, and as Paul suggested > it's in a larger context of other changes. > > Cheers, > Henry > I'm Ok with this patch. R?mi From henry.jen at oracle.com Mon Jul 8 19:42:25 2013 From: henry.jen at oracle.com (Henry Jen) Date: Mon, 08 Jul 2013 12:42:25 -0700 Subject: RFR (2nd): 8015315: Stream.concat methods In-Reply-To: References: <51D524D5.4030404@oracle.com> Message-ID: <51DB1621.8080702@oracle.com> On 07/04/2013 12:46 AM, Paul Sandoz wrote: > On Jul 4, 2013, at 9:31 AM, Henry Jen wrote: >> Hi, >> >> I updated the test, and split the ConcatTest.java so we don't encounter >> the ClassNotFoundException issue on test-ng. >> >> Please review the webrev at >> >> http://cr.openjdk.java.net/~henryjen/ccc/8015315.1/webrev/ >> > > Looks good. I would like to get this in quickly as it will unblock the F/J patch and others. I can push this for you. > Thanks, that would be great. > Peter's keen observation on Spliterator characteristics can be addressed as a separate issue. > +1. There is a bug tracking this, 8020061. > I think the remarks on should be also be treated as a separate discussion as it has wider implications. > I agree with you, and had replied on why it is safe. I did a quick experiment, it would need quite some effort to work out the type system for various spliterator implementations. Cheers, Henry From henry.jen at oracle.com Mon Jul 8 19:55:16 2013 From: henry.jen at oracle.com (Henry Jen) Date: Mon, 08 Jul 2013 12:55:16 -0700 Subject: RFR: 8017141: java.util/stream Spliterators from sequential sources should not catch OOME In-Reply-To: <51DB0AD2.5000304@univ-mlv.fr> References: <51D4AB0E.8090501@oracle.com> <51DB0570.4030708@oracle.com> <51DB0AD2.5000304@univ-mlv.fr> Message-ID: <51DB1924.4070101@oracle.com> On 07/08/2013 11:54 AM, Remi Forax wrote: > On 07/08/2013 08:31 PM, Henry Jen wrote: >> On 07/04/2013 12:01 AM, Paul Sandoz wrote: >>> On Jul 4, 2013, at 12:51 AM, Henry Jen wrote: >>>> Hi, >>>> >>>> Please review the webrev at >>>> >>>> http://cr.openjdk.java.net/~henryjen/tl/8017141.0/webrev/ >>>> >>> Note that the same change has already been fixed/pushed forrelevant >>> implementations in j.u.c. >>> >>> This change in part of a wider change to fix rampant resource usage >>> in some scenarios (other impl changes will follow from lambda to tl >>> later on). >>> >>> Paul. >>> >> Ping again. >> >> This is a relative small/straightforward change, and as Paul suggested >> it's in a larger context of other changes. >> >> Cheers, >> Henry >> > > I'm Ok with this patch. > Thanks for looking at it, we still need a jdk8 'reviewer'. Cheers, Henry From mandy.chung at oracle.com Mon Jul 8 19:57:37 2013 From: mandy.chung at oracle.com (Mandy Chung) Date: Mon, 08 Jul 2013 12:57:37 -0700 Subject: RFR: 8017141: java.util/stream Spliterators from sequential sources should not catch OOME In-Reply-To: <51DB0570.4030708@oracle.com> References: <51D4AB0E.8090501@oracle.com> <51DB0570.4030708@oracle.com> Message-ID: <51DB19B1.3020904@oracle.com> On 7/8/2013 11:31 AM, Henry Jen wrote: > On 07/04/2013 12:01 AM, Paul Sandoz wrote: >> On Jul 4, 2013, at 12:51 AM, Henry Jen wrote: >>> Hi, >>> >>> Please review the webrev at >>> >>> http://cr.openjdk.java.net/~henryjen/tl/8017141.0/webrev/ >>> >> Note that the same change has already been fixed/pushed forrelevant implementations in j.u.c. >> >> This change in part of a wider change to fix rampant resource usage in some scenarios (other impl changes will follow from lambda to tl later on). >> >> Paul. >> > Ping again. > > This is a relative small/straightforward change, and as Paul suggested > it's in a larger context of other changes. Looks good to me. Mandy From peter.levart at gmail.com Mon Jul 8 20:54:12 2013 From: peter.levart at gmail.com (Peter Levart) Date: Mon, 08 Jul 2013 22:54:12 +0200 Subject: RFR 7122142 : (ann) Race condition between isAnnotationPresent and getAnnotations In-Reply-To: References: <51C1BEC6.1080308@gmail.com> <51C1FE64.3020000@oracle.com> <51C88EBF.9020704@gmail.com> <51D43A72.8090508@oracle.com> <51D5895B.5020006@gmail.com> <51D68489.2020000@gmail.com> <51D68DED.2030308@gmail.com> Message-ID: <51DB26F4.8060305@gmail.com> Helo, I need a Reviewer for the following patch: http://cr.openjdk.java.net/~plevart/jdk8-tl/AnnotationType/webrev.05/ This fixes deadlock situation described in bug: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7122142 The in-depth evaluation of the patch is described in the introductory message of this thread: http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-June/018226.html The above is the 5th revision of the patch that also makes sure a single AnnotationType instance is ever returned for the same Class object even when multiple threads concurrently request one. Regards, Peter On 07/05/2013 04:04 PM, Joel Borggr?n-Franck wrote: > Hi Peter, > > Thanks for the quick update! > > While I have looked over the changes to j.l.Class and the cas in AnnotationType I don't think I'm qualified to review that. (FWIW it looked fine to me but my jmm isn't swapped in at the moment so I won't pretend to know the interactions between volatile and Unsafe cas). Thinking out loud I suppose we can assume a stable offset of fields in Class, and I realize that part has been under review before. > > The rest of AnnotationType, AnnotationParser and the tests look fine though. I also ran the tests before and after the change and results were as expected. > > Since I'm not a Reviewer kind of reviewer you need to get one those to sign off but after that I think you are good to go. I can sponsor this as well if Alan is busy. > > cheers > /Joel > > On 5 jul 2013, at 11:12, Peter Levart wrote: > >> Hi Again, >> >> Sorry, the 4th revision I posted is not rebased to the current tip of jdk8-tl so it contained some diffs that reverted some things. >> >> Here's the correct patch: >> >> http://cr.openjdk.java.net/~plevart/jdk8-tl/AnnotationType/webrev.05/ >> >> >> Regards, Peter >> >> >> On 07/05/2013 10:32 AM, Peter Levart wrote: >>> Hi Joel, >>> >>> Here's the 4th revision of the patch: >>> >>> http://cr.openjdk.java.net/~plevart/jdk8-tl/AnnotationType/webrev.04/ >>> >>> This one introduces CAS-ing of the AnnotationType instance into the Class.annotationType field so that there's only a single instance ever returned for a single Class. I also introduced new private static Class.Atomic nested class that is used to lazily initialize Unsafe machinery and to provide a safe wrapper for internal j.l.Class use. Previously this was part of ReflectionData nested class because it was only used for it's purpose. In anticipation to have a need for more atomic operations in the future, I moved this code to a separate class. ReflectionData is now just a record. >>> >>> Regards, Peter From tbuktu at hotmail.com Mon Jul 8 22:28:22 2013 From: tbuktu at hotmail.com (Tim Buktu) Date: Tue, 9 Jul 2013 00:28:22 +0200 Subject: Final patch for 8014319: Faster division of large integers Message-ID: Hi, I hope everyone had a good July 4 weekend. I updated the patch for 8014319 (i.e. phase 3 of the BigInteger work). The patch still consists of three files; they can be found at https://gist.github.com/tbuktu/1576025/raw/f93093a412eac86d8d81e03b8b9135eb827f2a84/BigInteger.java.phase3 https://gist.github.com/tbuktu/1576025/raw/f628f854491520de472a15fbcc2b6b751efe74e7/MutableBigInteger.java.phase3 https://gist.github.com/tbuktu/1576025/raw/4c3faad4cdebffbd77485482a1e61c9a7a475060/BigIntegerTest.java.phase3 There are only two changes vs last week's version. A missing @author tag has been added, and common powers of two are now cancelled before dividing numbers. I realize the review of the phase 3 patch is about to begin, so I won't make any more changes to the code. Thanks, Tim From henry.jen at oracle.com Mon Jul 8 22:56:49 2013 From: henry.jen at oracle.com (Henry Jen) Date: Mon, 08 Jul 2013 15:56:49 -0700 Subject: RFR: 8019551: Make BaseStream public Message-ID: <51DB43B1.7040208@oracle.com> Hi, Please review webrev at http://cr.openjdk.java.net/~henryjen/ccc/8019551/0/webrev/ This webrev makes BaseStream interface public and has AbstractPipeline implements BaseStream. The discussion on make this public can be found at http://mail.openjdk.java.net/pipermail/lambda-libs-spec-experts/2013-July/002113.html Cheers, Henry From huizhe.wang at oracle.com Tue Jul 9 01:07:32 2013 From: huizhe.wang at oracle.com (huizhe wang) Date: Mon, 08 Jul 2013 18:07:32 -0700 Subject: RFR: JAXP 1.5 for JDK8/7u40: 8016648: FEATURE_SECURE_PROCESSING set to true or false causes SAXParseException to be thrown In-Reply-To: <51D77789.8080605@oracle.com> References: <51D13933.8090901@oracle.com> <51D1A3F2.2000707@oracle.com> <51D1CB94.90901@oracle.com> <51D1DE7D.3030105@oracle.com> <51D53C3A.6000708@oracle.com> <51D54E48.6060503@oracle.com> <51D5DA43.3050404@oracle.com> <51D68488.2050108@oracle.com> <51D77789.8080605@oracle.com> Message-ID: <51DB6254.1080906@oracle.com> Hi, I've updated webrev with improved property management, and quality backed by 320 test cases. Thanks Daniel for the help expanding the test suite! Here's the webrev: http://cr.openjdk.java.net/~joehw/jdk8/8016648/webrev/ -Joe On 7/5/2013 6:48 PM, huizhe wang wrote: > > On 7/5/2013 1:32 AM, Alan Bateman wrote: >> On 04/07/2013 21:25, huizhe wang wrote: >>> >>> Reverted back to the original code: >>> http://cr.openjdk.java.net/~joehw/jdk8/8016648/webrev/ >>> The code split the version number and look at the 1st or 2nd >>> element, it thus works for both the current format and the proposed >>> one, e.g. for 1.7.0, it compares with the 2nd element, and for the >>> proposed MAJOR.MINOR.FU.*, the 1st or MAJOR. >> Thanks for dropping the dependency on javax.lang.model. What you now >> is probably okay although I'm a bit dubious about attempting to >> support an alternative format (I'm not aware of any proposal that >> changes the format of the java.version property as changing it would >> like cause a lot of breakage). > > There was a survey from Iris last year, and the JPG site has a > presentation from Aurelio. But you're right, I'll remove it. If > there's any change in the future, that is if it happens at all, we can > always add that back. >> >> A minor point but isJDKOrAbove looks a bit odd to me, I'd probably go >> for something like isJavaVersionGTE or isJavaVersionAtLeast but as >> it's not part of the API then it doesn't matter of course. > > isJavaVersionAtLeast is easy to understand. What does GTE stand for? > >> >> I think I mentioned it a while back but have warnings emitted with >> System.err can be problematic (gets mixed up with application >> messages to stderr). I realize the Xerces code seems to do this in >> places but we really need to see about eliminating these messages or >> getting consistent logging into this code. > > I agree, this one is not particularly graceful. There were 88 matches > of System.err in Xalan and 75 in Xerces, although some I believe are > used for debugging. It could take quite some effort. > > I mentioned that with a standalone release, we were trying to stay > away from new JDK features. It's probably better to spend time/effort > on some upgrades. > >> >>> : >>> >>> The last scenario to work on is if FSP is set on the Validator >>> instead of SchemaFactory. With that, I'm looking at refactoring the >>> way properties are represented so that they carry state. It would >>> then be cleaner to pass them from SchemaFactory over to Schema and >>> then Validator. It's a bit of work. Fortunately, we only have three >>> of them to deal with. >> So are you planning to send another webrev or do it as a separate issue? > > Looking at affected code by this change, it doesn't seem to be too > bad. I'll send another webrev. > > Joe > >> >> -Alan > From joe.darcy at oracle.com Tue Jul 9 02:10:34 2013 From: joe.darcy at oracle.com (Joe Darcy) Date: Mon, 08 Jul 2013 19:10:34 -0700 Subject: JDK 8 code review request for JDK-8020095: Fix doclint warnings in java.util.regex Message-ID: <51DB711A.1040108@oracle.com> Hello, Please review my changes to resolve (almost all of): JDK-8020095 Fix doclint warnings in java.util.regex http://cr.openjdk.java.net/~darcy/8020095.0/ Full text of the patch also included below. For some reason I have not been able to determine, even with the patch, one error remains: > src/share/classes/java/util/regex/Pattern.java:222: error: text not > allowed in element > * > ^ > 1 error This line has the same structure as other that appear unproblematic. In any case, since over 200 doclint issues are resolved with the patch, I'd like to go forward with the patch and have this lone remaining error investigated later on. Thanks, -Joe --- old/src/share/classes/java/util/regex/MatchResult.java 2013-07-08 19:03:31.000000000 -0700 +++ new/src/share/classes/java/util/regex/MatchResult.java 2013-07-08 19:03:31.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -77,7 +77,7 @@ public int start(int group); /** - * Returns the offset after the last character matched.

+ * Returns the offset after the last character matched. * * @return The offset after the last character matched * --- old/src/share/classes/java/util/regex/Matcher.java 2013-07-08 19:03:32.000000000 -0700 +++ new/src/share/classes/java/util/regex/Matcher.java 2013-07-08 19:03:32.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,7 +29,7 @@ /** * An engine that performs match operations on a {@link java.lang.CharSequence - * character sequence} by interpreting a {@link Pattern}. + * character sequence} by interpreting a {@link Pattern}. * *

A matcher is created from a pattern by invoking the pattern's {@link * Pattern#matcher matcher} method. Once created, a matcher can be used to @@ -330,7 +330,7 @@ } /** - * Returns the start index of the previous match.

+ * Returns the start index of the previous match. * * @return The index of the first character matched * @@ -402,7 +402,7 @@ } /** - * Returns the offset after the last character matched.

+ * Returns the offset after the last character matched. * * @return The offset after the last character matched * @@ -647,6 +647,7 @@ * invocations of the {@link #find()} method will start at the first * character not matched by this match.

* + * @param start the index to start searching for a match * @throws IndexOutOfBoundsException * If start is less than zero or if start is greater than the * length of the input sequence. @@ -736,8 +737,8 @@ * captured during the previous match: Each occurrence of * ${name} or $g * will be replaced by the result of evaluating the corresponding - * {@link #group(String) group(name)} or {@link #group(int) group(g)} - * respectively. For $g, + * {@link #group(String) group(name)} or {@link #group(int) group(g)} + * respectively. For $g, * the first number after the $ is always treated as part of * the group reference. Subsequent numbers are incorporated into g if * they would form a legal group reference. Only the numerals '0' --- old/src/share/classes/java/util/regex/Pattern.java 2013-07-08 19:03:32.000000000 -0700 +++ new/src/share/classes/java/util/regex/Pattern.java 2013-07-08 19:03:32.000000000 -0700 @@ -45,8 +45,8 @@ * *

A regular expression, specified as a string, must first be compiled into * an instance of this class. The resulting pattern can then be used to create - * a {@link Matcher} object that can match arbitrary {@link - * java.lang.CharSequence character sequences} against the regular + * a {@link Matcher} object that can match arbitrary {@linkplain + * java.lang.CharSequence character sequences} against the regular * expression. All of the state involved in performing a match resides in the * matcher, so many matchers can share the same pattern. * @@ -73,15 +73,15 @@ * such use. * * - * - *

Summary of regular-expression constructs

+ * + *

Summary of regular-expression constructs

* *
Classes for Unicode > scripts, blocks, categories and binary properties
* * - * - * + * + * * * * @@ -128,24 +128,24 @@ * * * - * - * - * - * - * - * - * - * - * - * - * - * - * - * + * + * + * + * + * + * + * + * + * + * + * + * + * + * * * * @@ -175,36 +175,36 @@ * * * - * + * * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * * * * @@ -220,19 +220,19 @@ * * * - * * + * * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * * * @@ -376,8 +376,8 @@ *
* * - * - *

Backslashes, escapes, and quoting

+ *
+ *

Backslashes, escapes, and quoting

* *

The backslash character ('\') serves to introduce escaped * constructs, as defined in the table above, as well as to quote characters @@ -405,8 +405,8 @@ * (hello) the string literal "\\(hello\\)" * must be used. * - * - *

Character Classes

+ * + *

Character Classes

* *

Character classes may appear within other character classes, and * may be composed by the union operator (implicit) and the intersection @@ -435,7 +435,7 @@ *

* * - * + * *
ConstructMatchesConstructMatches
 
 
Character classes
[abc]a, b, or c (simple class)
[^abc]Any character except a, b, or c (negation)
[a-zA-Z]a through z - * or A through Z, inclusive (range)
[a-d[m-p]]a through d, - * or m through p: [a-dm-p] (union)
[a-z&&[def]]d, e, or f (intersection)
[a-z&&[^bc]]a through z, - * except for b and c: [ad-z] (subtraction)
[a-z&&[^m-p]]a through z, - * and not m through p: [a-lq-z](subtraction)
{@code [abc]}{@code a}, {@code b}, or {@code c} (simple class)
{@code [^abc]}Any character except {@code a}, {@code b}, or {@code c} (negation)
{@code [a-zA-Z]}{@code a} through {@code z} + * or {@code A} through {@code Z}, inclusive (range)
{@code [a-d[m-p]]}{@code a} through {@code d}, + * or {@code m} through {@code p}: {@code [a-dm-p]} (union)
{@code [a-z&&[def]]}{@code d}, {@code e}, or {@code f} (intersection)
{@code [a-z&&[^bc]]}{@code a} through {@code z}, + * except for {@code b} and {@code c}: {@code [ad-z]} (subtraction)
{@code [a-z&&[^m-p]]}{@code a} through {@code z}, + * and not {@code m} through {@code p}: {@code [a-lq-z]}(subtraction)
 
Predefined character classes
\WA non-word character: [^\w]
 
POSIX character classes (US-ASCII only)
POSIX character classes (US-ASCII only)
\p{Lower}A lower-case alphabetic character: [a-z]
\p{Upper}An upper-case alphabetic character:[A-Z]
\p{ASCII}All ASCII:[\x00-\x7F]
\p{Alpha}An alphabetic character:[\p{Lower}\p{Upper}]
\p{Digit}A decimal digit: [0-9]
\p{Alnum}An alphanumeric character:[\p{Alpha}\p{Digit}]
\p{Punct}Punctuation: One of !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~
\p{Graph}A visible character: [\p{Alnum}\p{Punct}]
\p{Print}A printable character: [\p{Graph}\x20]
\p{Blank}A space or a tab: [ \t]
\p{Cntrl}A control character: [\x00-\x1F\x7F]
\p{XDigit}A hexadecimal digit: [0-9a-fA-F]
\p{Space}A whitespace character: [ \t\n\x0B\f\r]
{@code \p{Lower}}A lower-case alphabetic character: {@code [a-z]}
{@code \p{Upper}}An upper-case alphabetic character:{@code [A-Z]}
{@code \p{ASCII}}All ASCII:{@code [\x00-\x7F]}
{@code \p{Alpha}}An alphabetic character:{@code [\p{Lower}\p{Upper}]}
{@code \p{Digit}}A decimal digit: {@code [0-9]}
{@code \p{Alnum}}An alphanumeric character:{@code [\p{Alpha}\p{Digit}]}
{@code \p{Punct}}Punctuation: One of {@code !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~}
{@code \p{Graph}}A visible character: {@code [\p{Alnum}\p{Punct}]}
{@code \p{Print}}A printable character: {@code [\p{Graph}\x20]}
{@code \p{Blank}}A space or a tab: {@code [ \t]}
{@code \p{Cntrl}}A control character: {@code [\x00-\x1F\x7F]}
{@code \p{XDigit}}A hexadecimal digit: {@code [0-9a-fA-F]}
{@code \p{Space}}A whitespace character: {@code [ \t\n\x0B\f\r]}
 
java.lang.Character classes (simple java character type)
 
Classes for Unicode scripts, blocks, categories and binary properties
\p{IsLatin}
{@code \p{IsLatin}}A Latin script character (script)
\p{InGreek}
{@code \p{InGreek}}A character in the Greek block (block)
\p{Lu}
{@code \p{Lu}}An uppercase letter (category)
\p{IsAlphabetic}
{@code \p{IsAlphabetic}}An alphabetic character (binary property)
\p{Sc}
{@code \p{Sc}}A currency symbol
\P{InGreek}
{@code \P{InGreek}}Any character except one in the Greek block (negation)
[\p{L}&&[^\p{Lu}]] 
{@code [\p{L}&&[^\p{Lu}]]}Any letter except an uppercase letter (subtraction)
 
[a-e][i-u]
5    Intersection[a-z&&[aeiou]]
{@code [a-z&&[aeiou]]}
* *

Note that a different set of metacharacters are in effect inside @@ -444,8 +444,8 @@ * character class, while the expression - becomes a range * forming metacharacter. * - * - *

Line terminators

+ * + *

Line terminators

* *

A line terminator is a one- or two-character sequence that marks * the end of a line of the input character sequence. The following are @@ -480,11 +480,11 @@ * except at the end of input. When in {@link #MULTILINE} mode $ * matches just before a line terminator or the end of the input sequence. * - * - *

Groups and capturing

+ * + *

Groups and capturing

* - * - *
Group number
+ *
+ *

Group number

*

Capturing groups are numbered by counting their opening parentheses from * left to right. In the expression ((A)(B(C))), for example, there * are four such groups:

@@ -507,8 +507,8 @@ * subsequence may be used later in the expression, via a back reference, and * may also be retrieved from the matcher once the match operation is complete. * - * - *
Group name
+ *
+ *

Group name

*

A capturing group can also be assigned a "name", a named-capturing group, * and then be back-referenced later by the "name". Group names are composed of * the following characters. The first character must be a letter. @@ -537,7 +537,7 @@ * that do not capture text and do not count towards the group total, or * named-capturing group. * - *

Unicode support

+ *

Unicode support

* *

This class is in conformance with Level 1 of Unicode Technical @@ -568,7 +568,7 @@ *

* Scripts, blocks, categories and binary properties can be used both inside * and outside of a character class. - * + * *

* Scripts are specified either with the prefix {@code Is}, as in * {@code IsHiragana}, or by using the {@code script} keyword (or its short @@ -577,7 +577,7 @@ * The script names supported by Pattern are the valid script names * accepted and defined by * {@link java.lang.Character.UnicodeScript#forName(String) UnicodeScript.forName}. - * + * *

* Blocks are specified with the prefix {@code In}, as in * {@code InMongolian}, or by using the keyword {@code block} (or its short @@ -587,7 +587,7 @@ * accepted and defined by * {@link java.lang.Character.UnicodeBlock#forName(String) UnicodeBlock.forName}. *

- * + * * Categories may be specified with the optional prefix {@code Is}: * Both {@code \p{L}} and {@code \p{IsL}} denote the category of Unicode * letters. Same as scripts and blocks, categories can also be specified @@ -600,7 +600,7 @@ * {@link java.lang.Character Character} class. The category names are those * defined in the Standard, both normative and informative. *

- * + * * Binary properties are specified with the prefix {@code Is}, as in * {@code IsAlphabetic}. The supported binary properties by Pattern * are @@ -629,8 +629,8 @@ * * - * - * + * + * * * * @@ -649,9 +649,9 @@ * * * - * + * * - * + * * * * @@ -672,13 +672,13 @@ * *
ClassesMatchesClassesMatches
\p{Lower}A lowercase character:\p{IsLowercase}
\p{Graph}A visible character: [^\p{IsWhite_Space}\p{gc=Cc}\p{gc=Cs}\p{gc=Cn}]
\p{Print}A printable character: [\p{Graph}\p{Blank}&&[^\p{Cntrl}]]
A printable character: {@code [\p{Graph}\p{Blank}&&[^\p{Cntrl}]]}
\p{Blank}A space or a tab: [\p{IsWhite_Space}&&[^\p{gc=Zl}\p{gc=Zp}\x0a\x0b\x0c\x0d\x85]]
A space or a tab: {@code [\p{IsWhite_Space}&&[^\p{gc=Zl}\p{gc=Zp}\x0a\x0b\x0c\x0d\x85]]}
\p{Cntrl}A control character: \p{gc=Cc}
\p{XDigit}A non-word character: [^\w]
*

- * + * * Categories that behave like the java.lang.Character * boolean ismethodname methods (except for the deprecated ones) are * available through the same \p{prop} syntax where * the specified property has the name javamethodname. * - *

Comparison to Perl 5

+ *

Comparison to Perl 5

* *

The Pattern engine performs traditional NFA-based matching * with ordered alternation as occurs in Perl 5. @@ -1023,11 +1023,11 @@ private transient boolean hasSupplementary; /** - * Compiles the given regular expression into a pattern.

+ * Compiles the given regular expression into a pattern. * * @param regex * The expression to be compiled - * + * @return the given regular expression compiled into a pattern * @throws PatternSyntaxException * If the expression's syntax is invalid */ @@ -1037,7 +1037,7 @@ /** * Compiles the given regular expression into a pattern with the given - * flags.

+ * flags. * * @param regex * The expression to be compiled @@ -1049,6 +1049,7 @@ * {@link #LITERAL}, {@link #UNICODE_CHARACTER_CLASS} * and {@link #COMMENTS} * + * @return the given regular expression compiled into a pattern with the given flags * @throws IllegalArgumentException * If bit values other than those corresponding to the defined * match flags are set in flags @@ -1062,7 +1063,6 @@ /** * Returns the regular expression from which this pattern was compiled. - *

* * @return The source of this pattern */ @@ -1084,7 +1084,6 @@ /** * Creates a matcher that will match the given input against this pattern. - *

* * @param input * The character sequence to be matched @@ -1103,7 +1102,7 @@ } /** - * Returns this pattern's match flags.

+ * Returns this pattern's match flags. * * @return The match flags specified when this pattern was compiled */ @@ -1133,7 +1132,7 @@ * * @param input * The character sequence to be matched - * + * @return whether or not the regular expression matches on the input * @throws PatternSyntaxException * If the expression's syntax is invalid */ @@ -1170,9 +1169,9 @@ * *
- * - * - * + * + * + * * * * @@ -1253,8 +1252,8 @@ * *

Regex    

Limit    

Result    

Regex    Limit    Result    
:2{ "boo", "and:foo" }
- * - * + * + * * * * From jason.uh at oracle.com Tue Jul 9 02:23:20 2013 From: jason.uh at oracle.com (Jason Uh) Date: Mon, 08 Jul 2013 19:23:20 -0700 Subject: [8] Request for review: 8020091: Fix HTML doclint issues in java.io In-Reply-To: <51DB6949.1070500@oracle.com> References: <51DB56A6.2040300@oracle.com> <51DB6949.1070500@oracle.com> Message-ID: <51DB7418.2050702@oracle.com> Yikes. Just realized I copied the wrong list. My apologies, all. Thanks for the review, Joe! Jason On 07/08/2013 06:37 PM, Joseph Darcy wrote: > Hi Jason; > > Looks good; approved to go back. > > Thanks, > > -Joe > > On 7/8/2013 5:17 PM, Jason Uh wrote: >> Hi Joe, >> >> Please review this changeset, which fixes the HTML doclint issues in >> java.io. >> >> Webrev: http://cr.openjdk.java.net/~juh/8020091/webrev.00/ >> >> No undesirable changes detected by specdiff. >> >> Thanks! >> >> Jason > From jason.uh at oracle.com Tue Jul 9 02:25:11 2013 From: jason.uh at oracle.com (jason.uh at oracle.com) Date: Tue, 09 Jul 2013 02:25:11 +0000 Subject: hg: jdk8/tl/jdk: 8020091: Fix HTML doclint issues in java.io Message-ID: <20130709022534.4BB75488D3@hg.openjdk.java.net> Changeset: 52454985425d Author: juh Date: 2013-07-08 19:24 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/52454985425d 8020091: Fix HTML doclint issues in java.io Reviewed-by: darcy ! src/share/classes/java/io/DataInput.java ! src/share/classes/java/io/FileInputStream.java ! src/share/classes/java/io/FileOutputStream.java ! src/share/classes/java/io/InputStreamReader.java ! src/share/classes/java/io/OutputStreamWriter.java ! src/share/classes/java/io/PipedInputStream.java ! src/share/classes/java/io/RandomAccessFile.java From yasu at ysfactory.dip.jp Tue Jul 9 04:47:06 2013 From: yasu at ysfactory.dip.jp (Yasu) Date: Tue, 9 Jul 2013 13:47:06 +0900 Subject: Build error with GCC4.8 on Fedora19 Message-ID: <20130709044709.00ED8B9A32E@msgw007-01.ocn.ad.jp> Hi, I tried to build JDK8 with GCC4.8 on Fedora19. However, build process has been failed as following: ------ /usr/src/OpenJDK/tl/jdk/src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c: In function ?Java_sun_nio_fs_UnixNativeDispatcher_getgrnam0?: /usr/src/OpenJDK/tl/jdk/src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c:1071:68: warning: unused parameter ?this? [-Wunused-parameter] Java_sun_nio_fs_UnixNativeDispatcher_getgrnam0(JNIEnv* env, jclass this, ^ gmake[1]: *** [libs-only] Error 2 make: *** [jdk-only] Error 2 ------ I guess this issue is caused by -Werror. So I've made a patch and it seems to work fine. Could you push this patch? Thanks, Yasumasa Suenaga From yasu at ysfactory.dip.jp Tue Jul 9 04:54:59 2013 From: yasu at ysfactory.dip.jp (Yasu) Date: Tue, 9 Jul 2013 13:54:59 +0900 Subject: Build error with GCC4.8 on Fedora19 Message-ID: <20130709045501.4D23E3B6274@msgw008-05.ocn.ad.jp> Sorry, I forgot to attach a patch: ------ diff -r 52454985425d makefiles/CompileNativeLibraries.gmk --- a/makefiles/CompileNativeLibraries.gmk Mon Jul 08 19:24:22 2013 -0700 +++ b/makefiles/CompileNativeLibraries.gmk Tue Jul 09 13:41:12 2013 +0900 @@ -1987,7 +1987,7 @@ ifneq ($(OPENJDK_TARGET_OS),macosx) - SCTP_WERROR := -Werror + SCTP_WERROR := -Werror -Wno-error=unused-parameter ifeq ($(OPENJDK_TARGET_CPU_ARCH), ppc) SCTP_WERROR := endif From joe.darcy at oracle.com Tue Jul 9 05:05:43 2013 From: joe.darcy at oracle.com (Joe Darcy) Date: Mon, 08 Jul 2013 22:05:43 -0700 Subject: JDK 8 code review request for JDK-8020095: Fix doclint warnings in java.util.regex In-Reply-To: <51DB711A.1040108@oracle.com> References: <51DB711A.1040108@oracle.com> Message-ID: <51DB9A27.3090101@oracle.com> PS Updated webrev so that the ... structure don't have an empty "..." portion. http://cr.openjdk.java.net/~darcy/8020095.1/ -Joe On 07/08/2013 07:10 PM, Joe Darcy wrote: > Hello, > > Please review my changes to resolve (almost all of): > > JDK-8020095 Fix doclint warnings in java.util.regex > http://cr.openjdk.java.net/~darcy/8020095.0/ > > Full text of the patch also included below. > > For some reason I have not been able to determine, even with the > patch, one error remains: > >> src/share/classes/java/util/regex/Pattern.java:222: error: text not >> allowed in

Regex    

Result

Regex    Result
:{ "boo", "and", "foo" }
o
element >> * >> ^ >> 1 error > > This line has the same structure as other that appear unproblematic. > In any case, since over 200 doclint issues are resolved with the > patch, I'd like to go forward with the patch and have this lone > remaining error investigated later on. > > Thanks, > > -Joe > From mandy.chung at oracle.com Tue Jul 9 05:23:23 2013 From: mandy.chung at oracle.com (Mandy Chung) Date: Mon, 08 Jul 2013 22:23:23 -0700 Subject: JDK 8 code review request for JDK-8020095: Fix doclint warnings in java.util.regex In-Reply-To: <51DB711A.1040108@oracle.com> References: <51DB711A.1040108@oracle.com> Message-ID: <51DB9E4B.6000408@oracle.com> On 7/8/2013 7:10 PM, Joe Darcy wrote: > Hello, > > Please review my changes to resolve (almost all of): > > JDK-8020095 Fix doclint warnings in java.util.regex > http://cr.openjdk.java.net/~darcy/8020095.0/ > I think line 32 in Matcher.java should be {@linkplain ...} instead of {@link ...} /** * An engine that performs match operations on a {@link java.lang.CharSequence - * character sequence} by interpreting a {@link Pattern}. + * character sequence} by interpreting a {@link Pattern}. * *

A matcher is created from a pattern by invoking the pattern's {@link * Pattern#matcher matcher} method. Once created, a matcher can be used to @@ -330,7 +330,7 @@ } Other than that, the patch looks fine to me. Mandy From joe.darcy at oracle.com Tue Jul 9 05:29:47 2013 From: joe.darcy at oracle.com (Joe Darcy) Date: Mon, 08 Jul 2013 22:29:47 -0700 Subject: JDK 8 code review request for JDK-8020095: Fix doclint warnings in java.util.regex In-Reply-To: <51DB9E4B.6000408@oracle.com> References: <51DB711A.1040108@oracle.com> <51DB9E4B.6000408@oracle.com> Message-ID: <51DB9FCB.6020302@oracle.com> On 07/08/2013 10:23 PM, Mandy Chung wrote: > > On 7/8/2013 7:10 PM, Joe Darcy wrote: >> Hello, >> >> Please review my changes to resolve (almost all of): >> >> JDK-8020095 Fix doclint warnings in java.util.regex >> http://cr.openjdk.java.net/~darcy/8020095.0/ >> > > I think line 32 in Matcher.java should be {@linkplain ...} instead of > {@link ...} Agreed; I'll change that before I push. (FWIW, I've also run specdiff over the changes and everything looks fine on that front.) > > /** > * An engine that performs match operations on a {@link > java.lang.CharSequence > - * character sequence} by interpreting a {@link Pattern}. > + * character sequence} by interpreting a {@link Pattern}. > * > *

A matcher is created from a pattern by invoking the pattern's > {@link > * Pattern#matcher matcher} method. Once created, a matcher can be > used to > @@ -330,7 +330,7 @@ > } > > Other than that, the patch looks fine to me. > Thanks for the review Mandy, -Joe From joe.darcy at oracle.com Tue Jul 9 05:43:47 2013 From: joe.darcy at oracle.com (joe.darcy at oracle.com) Date: Tue, 09 Jul 2013 05:43:47 +0000 Subject: hg: jdk8/tl/jdk: 8020095: Fix doclint warnings in java.util.regex Message-ID: <20130709054443.B2F2A488DC@hg.openjdk.java.net> Changeset: eab8f4e29f5e Author: darcy Date: 2013-07-08 22:43 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/eab8f4e29f5e 8020095: Fix doclint warnings in java.util.regex Reviewed-by: mchung ! src/share/classes/java/util/regex/MatchResult.java ! src/share/classes/java/util/regex/Matcher.java ! src/share/classes/java/util/regex/Pattern.java From dan.xu at oracle.com Tue Jul 9 05:46:53 2013 From: dan.xu at oracle.com (Dan Xu) Date: Mon, 08 Jul 2013 22:46:53 -0700 Subject: Build error with GCC4.8 on Fedora19 In-Reply-To: <20130709045501.4D23E3B6274@msgw008-05.ocn.ad.jp> References: <20130709045501.4D23E3B6274@msgw008-05.ocn.ad.jp> Message-ID: <51DBA3CD.9020605@oracle.com> Adding build-dev mailing list. On 07/08/2013 09:54 PM, Yasu wrote: > Sorry, I forgot to attach a patch: > > ------ > > diff -r 52454985425d makefiles/CompileNativeLibraries.gmk > --- a/makefiles/CompileNativeLibraries.gmk Mon Jul 08 19:24:22 2013 -0700 > +++ b/makefiles/CompileNativeLibraries.gmk Tue Jul 09 13:41:12 2013 +0900 > @@ -1987,7 +1987,7 @@ > > ifneq ($(OPENJDK_TARGET_OS),macosx) > > - SCTP_WERROR := -Werror > + SCTP_WERROR := -Werror -Wno-error=unused-parameter > ifeq ($(OPENJDK_TARGET_CPU_ARCH), ppc) > SCTP_WERROR := > endif From david.holmes at oracle.com Tue Jul 9 06:28:36 2013 From: david.holmes at oracle.com (David Holmes) Date: Tue, 09 Jul 2013 16:28:36 +1000 Subject: PermGen leak In-Reply-To: <51DA5DAA.8020204@oracle.com> References: <51DA5DAA.8020204@oracle.com> Message-ID: <51DBAD94.1000601@oracle.com> On 8/07/2013 4:35 PM, feng l.liu wrote: > Hello Experts, > > I am building up a test tool with ant, but I encountered so many > DelegatingClassLoaders that put pressures on PermGen. I know that > DelegatingClassLoaders are caused by java reflection. > > Google search show some posts indicating generation of > DelegatingClassLoader will be depressed if > sun.reflect.inflationThreshold to zero , I tried it and found that this > idea did not work at all. I dived into the code and found the snippets > as below: > > It looks that the DelegatingClassLoader will go away if I set > sun.reflect.noInflation = true and sun.reflect.inflationThreshold to > Integer.MAX_VALUE. I tried it again but this idea did not work as well. Inflation is the process by which we start with a native accessor and then "inflate" it to a MethodAccessorGenerator when we reach the inflation threshold. It is the MethodAccessorGenerator that will cause the DelegatingClassLoader to be used. If inflation is disabled by noInflation=true then you got straight to using the MethodAccessorGenerator - not what you want. You want to remain with the native accessor, in which case you only want to set sun.reflect.inflationThreshold to Integer.MAX_VALUE. HTH David ----- > can you please give me some advices on this leak? > > thank you in advance > > ReflectionFactory.java > > String val = > System.getProperty("sun.reflect.noInflation"); > if (val != null && val.equals("true")) { > noInflation = true; > } > > val = > System.getProperty("sun.reflect.inflationThreshold"); > if (val != null) { > try { > inflationThreshold = Integer.parseInt(val); > } catch (NumberFormatException e) { > throw (RuntimeException) > new RuntimeException("Unable to parse > property sun.reflect.inflationThreshold"). > initCause(e); > } > } > > initted = true; > return null; > } > > > NativeMethodAccessorImpl.java > > public Object invoke(Object obj, Object[] args) > throws IllegalArgumentException, InvocationTargetException > { > if (++numInvocations > ReflectionFactory.inflationThreshold()) { > MethodAccessorImpl acc = (MethodAccessorImpl) > new MethodAccessorGenerator(). > generateMethod(method.getDeclaringClass(), > method.getName(), > method.getParameterTypes(), > method.getReturnType(), > method.getExceptionTypes(), > method.getModifiers()); > parent.setDelegate(acc); > } > > return invoke0(method, obj, args); > } > > > Best regards > From paul.sandoz at oracle.com Tue Jul 9 06:37:58 2013 From: paul.sandoz at oracle.com (Paul Sandoz) Date: Tue, 9 Jul 2013 08:37:58 +0200 Subject: RFR: 8019551: Make BaseStream public In-Reply-To: <51DB43B1.7040208@oracle.com> References: <51DB43B1.7040208@oracle.com> Message-ID: On Jul 9, 2013, at 12:56 AM, Henry Jen wrote: > Hi, > > Please review webrev at > > http://cr.openjdk.java.net/~henryjen/ccc/8019551/0/webrev/ > > This webrev makes BaseStream interface public and has AbstractPipeline > implements BaseStream. > Looks good. Paul. From paul.sandoz at oracle.com Tue Jul 9 07:22:39 2013 From: paul.sandoz at oracle.com (paul.sandoz at oracle.com) Date: Tue, 09 Jul 2013 07:22:39 +0000 Subject: hg: jdk8/tl/jdk: 8017141: java.util/stream Spliterators from sequential sources should not catch OOME Message-ID: <20130709072304.6DB76488DF@hg.openjdk.java.net> Changeset: 628432ee4d68 Author: henryjen Date: 2013-07-09 09:15 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/628432ee4d68 8017141: java.util/stream Spliterators from sequential sources should not catch OOME Reviewed-by: mchung Contributed-by: paul.sandoz at oracle.com ! src/share/classes/java/util/LinkedList.java ! src/share/classes/java/util/Spliterators.java From erik.joelsson at oracle.com Tue Jul 9 07:40:44 2013 From: erik.joelsson at oracle.com (Erik Joelsson) Date: Tue, 09 Jul 2013 09:40:44 +0200 Subject: Build error with GCC4.8 on Fedora19 In-Reply-To: <51DBA3CD.9020605@oracle.com> References: <20130709045501.4D23E3B6274@msgw008-05.ocn.ad.jp> <51DBA3CD.9020605@oracle.com> Message-ID: <51DBBE7C.6070801@oracle.com> I would like to see a comment explaining why the option was needed. Is this a bug in gcc or has the checking just become better? /Erik On 2013-07-09 07:46, Dan Xu wrote: > Adding build-dev mailing list. > > > On 07/08/2013 09:54 PM, Yasu wrote: >> Sorry, I forgot to attach a patch: >> >> ------ >> >> diff -r 52454985425d makefiles/CompileNativeLibraries.gmk >> --- a/makefiles/CompileNativeLibraries.gmk Mon Jul 08 19:24:22 2013 -0700 >> +++ b/makefiles/CompileNativeLibraries.gmk Tue Jul 09 13:41:12 2013 +0900 >> @@ -1987,7 +1987,7 @@ >> >> ifneq ($(OPENJDK_TARGET_OS),macosx) >> >> - SCTP_WERROR := -Werror >> + SCTP_WERROR := -Werror -Wno-error=unused-parameter >> ifeq ($(OPENJDK_TARGET_CPU_ARCH), ppc) >> SCTP_WERROR := >> endif From chris.hegarty at oracle.com Tue Jul 9 07:58:22 2013 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Tue, 9 Jul 2013 09:58:22 +0200 Subject: RFR: 8019551: Make BaseStream public In-Reply-To: References: <51DB43B1.7040208@oracle.com> Message-ID: On 9 Jul 2013, at 08:37, Paul Sandoz wrote: > On Jul 9, 2013, at 12:56 AM, Henry Jen wrote: >> Hi, >> >> Please review webrev at >> >> http://cr.openjdk.java.net/~henryjen/ccc/8019551/0/webrev/ >> >> This webrev makes BaseStream interface public and has AbstractPipeline >> implements BaseStream. > > Looks good. +1 -Chris > > Paul. > From paul.sandoz at oracle.com Tue Jul 9 08:45:21 2013 From: paul.sandoz at oracle.com (paul.sandoz at oracle.com) Date: Tue, 09 Jul 2013 08:45:21 +0000 Subject: hg: jdk8/tl/jdk: 8019551: Make BaseStream public Message-ID: <20130709084547.A32E2488E5@hg.openjdk.java.net> Changeset: 44a634c1edc4 Author: psandoz Date: 2013-07-09 10:44 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/44a634c1edc4 8019551: Make BaseStream public Reviewed-by: chegar, psandoz Contributed-by: brian goetz ! src/share/classes/java/util/stream/AbstractPipeline.java ! src/share/classes/java/util/stream/BaseStream.java From heliofrota at gmail.com Tue Jul 9 10:41:29 2013 From: heliofrota at gmail.com (Helio Frota) Date: Tue, 9 Jul 2013 07:41:29 -0300 Subject: Build error with GCC4.8 on Fedora19 In-Reply-To: <51DBBE7C.6070801@oracle.com> References: <20130709045501.4D23E3B6274@msgw008-05.ocn.ad.jp> <51DBA3CD.9020605@oracle.com> <51DBBE7C.6070801@oracle.com> Message-ID: Hi great all, This is my first mail here, i'm Jug Leader of CEJUG and OpenJDK Adoptor. I did the build of OpenJDK with GCC 4.8.1 Please look: http://www.heliofrota.com/blog/2013/06/25/building-openjdk8-plus-gcc-4-dot-8-1-plus-manjaro-gnu-linux-x86/ And here all discussion on Adopt OpenJDK mailing list: https://groups.google.com/d/msg/adopt-openjdk/-6CQLEclN-Q/NkrCc96WeM8J I will try with fedora 19 soon. Thanks. 2013/7/9 Erik Joelsson > I would like to see a comment explaining why the option was needed. Is > this a bug in gcc or has the checking just become better? > > /Erik > > On 2013-07-09 07:46, Dan Xu wrote: > > Adding build-dev mailing list. > > > > > > On 07/08/2013 09:54 PM, Yasu wrote: > >> Sorry, I forgot to attach a patch: > >> > >> ------ > >> > >> diff -r 52454985425d makefiles/CompileNativeLibraries.gmk > >> --- a/makefiles/CompileNativeLibraries.gmk Mon Jul 08 19:24:22 2013 > -0700 > >> +++ b/makefiles/CompileNativeLibraries.gmk Tue Jul 09 13:41:12 2013 > +0900 > >> @@ -1987,7 +1987,7 @@ > >> > >> ifneq ($(OPENJDK_TARGET_OS),macosx) > >> > >> - SCTP_WERROR := -Werror > >> + SCTP_WERROR := -Werror -Wno-error=unused-parameter > >> ifeq ($(OPENJDK_TARGET_CPU_ARCH), ppc) > >> SCTP_WERROR := > >> endif > -- Helio Frota JUG Leader - CEJUG http://www.cejug.org/ http://www.linkedin.com/in/heliofrota From yasu at ysfactory.dip.jp Tue Jul 9 11:11:17 2013 From: yasu at ysfactory.dip.jp (Yasu) Date: Tue, 9 Jul 2013 20:11:17 +0900 Subject: Build error with GCC4.8 on Fedora19 Message-ID: <20130709111120.D78664E58EE@msgw008-04.ocn.ad.jp> Hi Erik, I posted email as following: http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-July/018790.html --- Hi, I tried to build JDK8 with GCC4.8 on Fedora19. However, build process has been failed as following: ------ /usr/src/OpenJDK/tl/jdk/src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c: In function ?Java_sun_nio_fs_UnixNativeDispatcher_getgrnam0?: /usr/src/OpenJDK/tl/jdk/src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c:1071:68: warning: unused parameter ?this? [-Wunused-parameter] Java_sun_nio_fs_UnixNativeDispatcher_getgrnam0(JNIEnv* env, jclass this, ^ gmake[1]: *** [libs-only] Error 2 make: *** [jdk-only] Error 2 ------ I guess this issue is caused by -Werror. So I've made a patch and it seems to work fine. Could you push this patch? Thanks, Yasumasa Suenaga --- I think that this is GCC spec. This option is described in manpage of gcc as following: --- -Wunused All the above -Wunused options combined. In order to get a warning about an unused function parameter, you must either specify -Wextra -Wunused (note that -Wall implies -Wunused), or separately specify -Wunused-parameter. --- Thanks, Yasumasa From yasu at ysfactory.dip.jp Tue Jul 9 11:15:43 2013 From: yasu at ysfactory.dip.jp (Yasu) Date: Tue, 9 Jul 2013 20:15:43 +0900 Subject: Build error with GCC4.8 on Fedora19 Message-ID: <20130709111545.57D434D596E@msgw007-03.ocn.ad.jp> Hi Helio, I've read your article. Can you try to build class library? I encountered this issue on building SCTP module. Thanks, Yasumasa From Lance.Andersen at oracle.com Tue Jul 9 11:18:43 2013 From: Lance.Andersen at oracle.com (Lance Andersen - Oracle) Date: Tue, 9 Jul 2013 07:18:43 -0400 Subject: JDK 8 code review request for JDK-8020095: Fix doclint warnings in java.util.regex In-Reply-To: <51DB711A.1040108@oracle.com> References: <51DB711A.1040108@oracle.com> Message-ID: <0818B3D3-5CFF-4C53-8F74-55DA6B6786D3@oracle.com> Looks fine Joe including Mandy's feedback Best Lance On Jul 8, 2013, at 10:10 PM, Joe Darcy wrote: > Hello, > > Please review my changes to resolve (almost all of): > > JDK-8020095 Fix doclint warnings in java.util.regex > http://cr.openjdk.java.net/~darcy/8020095.0/ > > Full text of the patch also included below. > > For some reason I have not been able to determine, even with the patch, one error remains: > >> src/share/classes/java/util/regex/Pattern.java:222: error: text not allowed in

Classes for Unicode >> scripts, blocks, categories and binary properties
element >> * >> ^ >> 1 error > > This line has the same structure as other that appear unproblematic. In any case, since over 200 doclint issues are resolved with the patch, I'd like to go forward with the patch and have this lone remaining error investigated later on. > > Thanks, > > -Joe > > --- old/src/share/classes/java/util/regex/MatchResult.java 2013-07-08 19:03:31.000000000 -0700 > +++ new/src/share/classes/java/util/regex/MatchResult.java 2013-07-08 19:03:31.000000000 -0700 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. > + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. > * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. > * > * This code is free software; you can redistribute it and/or modify it > @@ -77,7 +77,7 @@ > public int start(int group); > > /** > - * Returns the offset after the last character matched.

> + * Returns the offset after the last character matched. > * > * @return The offset after the last character matched > * > --- old/src/share/classes/java/util/regex/Matcher.java 2013-07-08 19:03:32.000000000 -0700 > +++ new/src/share/classes/java/util/regex/Matcher.java 2013-07-08 19:03:32.000000000 -0700 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. > + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. > * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. > * > * This code is free software; you can redistribute it and/or modify it > @@ -29,7 +29,7 @@ > > /** > * An engine that performs match operations on a {@link java.lang.CharSequence > - *
character sequence} by interpreting a {@link Pattern}. > + * character sequence} by interpreting a {@link Pattern}. > * > *

A matcher is created from a pattern by invoking the pattern's {@link > * Pattern#matcher matcher} method. Once created, a matcher can be used to > @@ -330,7 +330,7 @@ > } > > /** > - * Returns the start index of the previous match.

> + * Returns the start index of the previous match. > * > * @return The index of the first character matched > * > @@ -402,7 +402,7 @@ > } > > /** > - * Returns the offset after the last character matched.

> + * Returns the offset after the last character matched. > * > * @return The offset after the last character matched > * > @@ -647,6 +647,7 @@ > * invocations of the {@link #find()} method will start at the first > * character not matched by this match.

> * > + * @param start the index to start searching for a match > * @throws IndexOutOfBoundsException > * If start is less than zero or if start is greater than the > * length of the input sequence. > @@ -736,8 +737,8 @@ > * captured during the previous match: Each occurrence of > * ${name} or $g > * will be replaced by the result of evaluating the corresponding > - * {@link #group(String) group(name)} or {@link #group(int) group(g)} > - * respectively. For $g, > + * {@link #group(String) group(name)} or {@link #group(int) group(g)} > + * respectively. For $g, > * the first number after the $ is always treated as part of > * the group reference. Subsequent numbers are incorporated into g if > * they would form a legal group reference. Only the numerals '0' > --- old/src/share/classes/java/util/regex/Pattern.java 2013-07-08 19:03:32.000000000 -0700 > +++ new/src/share/classes/java/util/regex/Pattern.java 2013-07-08 19:03:32.000000000 -0700 > @@ -45,8 +45,8 @@ > * > *

A regular expression, specified as a string, must first be compiled into > * an instance of this class. The resulting pattern can then be used to create > - * a {@link Matcher} object that can match arbitrary {@link > - * java.lang.CharSequence character sequences} against the regular > + * a {@link Matcher} object that can match arbitrary {@linkplain > + * java.lang.CharSequence character sequences} against the regular > * expression. All of the state involved in performing a match resides in the > * matcher, so many matchers can share the same pattern. > * > @@ -73,15 +73,15 @@ > * such use. > * > * > - * > - *

Summary of regular-expression constructs

> + * > + *

Summary of regular-expression constructs

> * > *
Classes for Unicode scripts, blocks, categories and binary properties
* summary="Regular expression constructs, and what they match"> > * > * > - * > - * > + * > + * > * > * > * > @@ -128,24 +128,24 @@ > * > * > * > - * > - * > - * > - * > - * > - * > - * > - * > - * > - * > - * > - * > - * > - * > + * > + * > + * > + * > + * > + * > + * > + * > + * > + * > + * > + * > + * > + * > * > * > * > @@ -175,36 +175,36 @@ > * > * > * > - * > + * > * > - * > - * > - * > - * > - * > - * > - * > - * > - * > - * > - * > - * > - * > - * > - * > - * > - * > - * > - * > - * > - * > - * > - * > - * > - * > - * > - * > + * > + * > + * > + * > + * > + * > + * > + * > + * > + * > + * > + * > + * > + * > + * > + * > + * > + * > + * > + * > + * > + * > + * > + * > + * > + * > + * > * > * > * > @@ -220,19 +220,19 @@ > * > * > * > - * * > + * * > * > - * > + * > * > - * > + * > * > - * > + * > * > - * > + * > * > - * > + * > * > - * > + * > * > * > * > @@ -376,8 +376,8 @@ > *
> * > * > - * > - *

Backslashes, escapes, and quoting

> + *
> + *

Backslashes, escapes, and quoting

> * > *

The backslash character ('\') serves to introduce escaped > * constructs, as defined in the table above, as well as to quote characters > @@ -405,8 +405,8 @@ > * (hello) the string literal "\\(hello\\)" > * must be used. > * > - * > - *

Character Classes

> + * > + *

Character Classes

> * > *

Character classes may appear within other character classes, and > * may be composed by the union operator (implicit) and the intersection > @@ -435,7 +435,7 @@ > *

> * > * > - * > + * > *
ConstructMatchesConstructMatches
 
 
Character classes
[abc]a, b, or c (simple class)
[^abc]Any character except a, b, or c (negation)
[a-zA-Z]a through z > - * or A through Z, inclusive (range)
[a-d[m-p]]a through d, > - * or m through p: [a-dm-p] (union)
[a-z&&[def]]d, e, or f (intersection)
[a-z&&[^bc]]a through z, > - * except for b and c: [ad-z] (subtraction)
[a-z&&[^m-p]]a through z, > - * and not m through p: [a-lq-z](subtraction)
{@code [abc]}{@code a}, {@code b}, or {@code c} (simple class)
{@code [^abc]}Any character except {@code a}, {@code b}, or {@code c} (negation)
{@code [a-zA-Z]}{@code a} through {@code z} > + * or {@code A} through {@code Z}, inclusive (range)
{@code [a-d[m-p]]}{@code a} through {@code d}, > + * or {@code m} through {@code p}: {@code [a-dm-p]} (union)
{@code [a-z&&[def]]}{@code d}, {@code e}, or {@code f} (intersection)
{@code [a-z&&[^bc]]}{@code a} through {@code z}, > + * except for {@code b} and {@code c}: {@code [ad-z]} (subtraction)
{@code [a-z&&[^m-p]]}{@code a} through {@code z}, > + * and not {@code m} through {@code p}: {@code [a-lq-z]}(subtraction)
 
Predefined character classes
\WA non-word character: [^\w]
 
POSIX character classes (US-ASCII only)
POSIX character classes (US-ASCII only)
\p{Lower}A lower-case alphabetic character: [a-z]
\p{Upper}An upper-case alphabetic character:[A-Z]
\p{ASCII}All ASCII:[\x00-\x7F]
\p{Alpha}An alphabetic character:[\p{Lower}\p{Upper}]
\p{Digit}A decimal digit: [0-9]
\p{Alnum}An alphanumeric character:[\p{Alpha}\p{Digit}]
\p{Punct}Punctuation: One of !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~
\p{Graph}A visible character: [\p{Alnum}\p{Punct}]
\p{Print}A printable character: [\p{Graph}\x20]
\p{Blank}A space or a tab: [ \t]
\p{Cntrl}A control character: [\x00-\x1F\x7F]
\p{XDigit}A hexadecimal digit: [0-9a-fA-F]
\p{Space}A whitespace character: [ \t\n\x0B\f\r]
{@code \p{Lower}}A lower-case alphabetic character: {@code [a-z]}
{@code \p{Upper}}An upper-case alphabetic character:{@code [A-Z]}
{@code \p{ASCII}}All ASCII:{@code [\x00-\x7F]}
{@code \p{Alpha}}An alphabetic character:{@code [\p{Lower}\p{Upper}]}
{@code \p{Digit}}A decimal digit: {@code [0-9]}
{@code \p{Alnum}}An alphanumeric character:{@code [\p{Alpha}\p{Digit}]}
{@code \p{Punct}}Punctuation: One of {@code !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~}
{@code \p{Graph}}A visible character: {@code [\p{Alnum}\p{Punct}]}
{@code \p{Print}}A printable character: {@code [\p{Graph}\x20]}
{@code \p{Blank}}A space or a tab: {@code [ \t]}
{@code \p{Cntrl}}A control character: {@code [\x00-\x1F\x7F]}
{@code \p{XDigit}}A hexadecimal digit: {@code [0-9a-fA-F]}
{@code \p{Space}}A whitespace character: {@code [ \t\n\x0B\f\r]}
 
java.lang.Character classes (simple java character type)
 
Classes for Unicode scripts, blocks, categories and binary properties
\p{IsLatin}
{@code \p{IsLatin}}A Latin script character (script)
\p{InGreek}
{@code \p{InGreek}}A character in the Greek block (block)
\p{Lu}
{@code \p{Lu}}An uppercase letter (category)
\p{IsAlphabetic}
{@code \p{IsAlphabetic}}An alphabetic character (binary property)
\p{Sc}
{@code \p{Sc}}A currency symbol
\P{InGreek}
{@code \P{InGreek}}Any character except one in the Greek block (negation)
[\p{L}&&[^\p{Lu}]] 
{@code [\p{L}&&[^\p{Lu}]]}Any letter except an uppercase letter (subtraction)
 
[a-e][i-u]
5    Intersection[a-z&&[aeiou]]
{@code [a-z&&[aeiou]]}
> * > *

Note that a different set of metacharacters are in effect inside > @@ -444,8 +444,8 @@ > * character class, while the expression - becomes a range > * forming metacharacter. > * > - * > - *

Line terminators

> + * > + *

Line terminators

> * > *

A line terminator is a one- or two-character sequence that marks > * the end of a line of the input character sequence. The following are > @@ -480,11 +480,11 @@ > * except at the end of input. When in {@link #MULTILINE} mode $ > * matches just before a line terminator or the end of the input sequence. > * > - * > - *

Groups and capturing

> + * > + *

Groups and capturing

> * > - * > - *
Group number
> + *
> + *

Group number

> *

Capturing groups are numbered by counting their opening parentheses from > * left to right. In the expression ((A)(B(C))), for example, there > * are four such groups:

> @@ -507,8 +507,8 @@ > * subsequence may be used later in the expression, via a back reference, and > * may also be retrieved from the matcher once the match operation is complete. > * > - * > - *
Group name
> + *
> + *

Group name

> *

A capturing group can also be assigned a "name", a named-capturing group, > * and then be back-referenced later by the "name". Group names are composed of > * the following characters. The first character must be a letter. > @@ -537,7 +537,7 @@ > * that do not capture text and do not count towards the group total, or > * named-capturing group. > * > - *

Unicode support

> + *

Unicode support

> * > *

This class is in conformance with Level 1 of * href="http://www.unicode.org/reports/tr18/">Unicode Technical > @@ -568,7 +568,7 @@ > *

> * Scripts, blocks, categories and binary properties can be used both inside > * and outside of a character class. > - * > + * > *

> * Scripts are specified either with the prefix {@code Is}, as in > * {@code IsHiragana}, or by using the {@code script} keyword (or its short > @@ -577,7 +577,7 @@ > * The script names supported by Pattern are the valid script names > * accepted and defined by > * {@link java.lang.Character.UnicodeScript#forName(String) UnicodeScript.forName}. > - * > + * > *

> * Blocks are specified with the prefix {@code In}, as in > * {@code InMongolian}, or by using the keyword {@code block} (or its short > @@ -587,7 +587,7 @@ > * accepted and defined by > * {@link java.lang.Character.UnicodeBlock#forName(String) UnicodeBlock.forName}. > *

> - * > + * > * Categories may be specified with the optional prefix {@code Is}: > * Both {@code \p{L}} and {@code \p{IsL}} denote the category of Unicode > * letters. Same as scripts and blocks, categories can also be specified > @@ -600,7 +600,7 @@ > * {@link java.lang.Character Character} class. The category names are those > * defined in the Standard, both normative and informative. > *

> - * > + * > * Binary properties are specified with the prefix {@code Is}, as in > * {@code IsAlphabetic}. The supported binary properties by Pattern > * are > @@ -629,8 +629,8 @@ > * * summary="predefined and posix character classes in Unicode mode"> > * > - * > - * > + * > + * > * > * > * > @@ -649,9 +649,9 @@ > * > * > * > - * > + * > * > - * > + * > * > * > * > @@ -672,13 +672,13 @@ > * > *
ClassesMatchesClassesMatches
\p{Lower}A lowercase character:\p{IsLowercase}
\p{Graph}A visible character: [^\p{IsWhite_Space}\p{gc=Cc}\p{gc=Cs}\p{gc=Cn}]
\p{Print}A printable character: [\p{Graph}\p{Blank}&&[^\p{Cntrl}]]
A printable character: {@code [\p{Graph}\p{Blank}&&[^\p{Cntrl}]]}
\p{Blank}A space or a tab: [\p{IsWhite_Space}&&[^\p{gc=Zl}\p{gc=Zp}\x0a\x0b\x0c\x0d\x85]]
A space or a tab: {@code [\p{IsWhite_Space}&&[^\p{gc=Zl}\p{gc=Zp}\x0a\x0b\x0c\x0d\x85]]}
\p{Cntrl}A control character: \p{gc=Cc}
\p{XDigit}A non-word character: [^\w]
> *

> - * > + * > * Categories that behave like the java.lang.Character > * boolean ismethodname methods (except for the deprecated ones) are > * available through the same \p{prop} syntax where > * the specified property has the name javamethodname. > * > - *

Comparison to Perl 5

> + *

Comparison to Perl 5

> * > *

The Pattern engine performs traditional NFA-based matching > * with ordered alternation as occurs in Perl 5. > @@ -1023,11 +1023,11 @@ > private transient boolean hasSupplementary; > > /** > - * Compiles the given regular expression into a pattern.

> + * Compiles the given regular expression into a pattern. > * > * @param regex > * The expression to be compiled > - * > + * @return the given regular expression compiled into a pattern > * @throws PatternSyntaxException > * If the expression's syntax is invalid > */ > @@ -1037,7 +1037,7 @@ > > /** > * Compiles the given regular expression into a pattern with the given > - * flags.

> + * flags. > * > * @param regex > * The expression to be compiled > @@ -1049,6 +1049,7 @@ > * {@link #LITERAL}, {@link #UNICODE_CHARACTER_CLASS} > * and {@link #COMMENTS} > * > + * @return the given regular expression compiled into a pattern with the given flags > * @throws IllegalArgumentException > * If bit values other than those corresponding to the defined > * match flags are set in flags > @@ -1062,7 +1063,6 @@ > > /** > * Returns the regular expression from which this pattern was compiled. > - *

> * > * @return The source of this pattern > */ > @@ -1084,7 +1084,6 @@ > > /** > * Creates a matcher that will match the given input against this pattern. > - *

> * > * @param input > * The character sequence to be matched > @@ -1103,7 +1102,7 @@ > } > > /** > - * Returns this pattern's match flags.

> + * Returns this pattern's match flags. > * > * @return The match flags specified when this pattern was compiled > */ > @@ -1133,7 +1132,7 @@ > * > * @param input > * The character sequence to be matched > - * > + * @return whether or not the regular expression matches on the input > * @throws PatternSyntaxException > * If the expression's syntax is invalid > */ > @@ -1170,9 +1169,9 @@ > * > *
* summary="Split examples showing regex, limit, and result"> > - * > - * > - * > + * > + * > + * > * > * > * > @@ -1253,8 +1252,8 @@ > * > *

Regex    

Limit    

Result    

Regex    Limit    Result    
:2{ "boo", "and:foo" }
* summary="Split examples showing regex and result"> > - * > - * > + * > + * > * > * > * > > -------------- next part -------------- Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 Oracle Java Engineering 1 Network Drive Burlington, MA 01803 Lance.Andersen at oracle.com From heliofrota at gmail.com Tue Jul 9 11:29:22 2013 From: heliofrota at gmail.com (Helio Frota) Date: Tue, 9 Jul 2013 08:29:22 -0300 Subject: Build error with GCC4.8 on Fedora19 In-Reply-To: <20130709111545.57D434D596E@msgw007-03.ocn.ad.jp> References: <20130709111545.57D434D596E@msgw007-03.ocn.ad.jp> Message-ID: Hi Yasu, Can you try to build class library? Yes i will try. Thanks, 2013/7/9 Yasu > Hi Helio, > > I've read your article. > Can you try to build class library? > I encountered this issue on building SCTP module. > > > Thanks, > > Yasumasa > -- Helio Frota JUG Leader - CEJUG http://www.cejug.org/ http://www.linkedin.com/in/heliofrota From aph at redhat.com Tue Jul 9 11:40:27 2013 From: aph at redhat.com (Andrew Haley) Date: Tue, 09 Jul 2013 12:40:27 +0100 Subject: Build error with GCC4.8 on Fedora19 In-Reply-To: <20130709111120.D78664E58EE@msgw008-04.ocn.ad.jp> References: <20130709111120.D78664E58EE@msgw008-04.ocn.ad.jp> Message-ID: <51DBF6AB.5070308@redhat.com> On 07/09/2013 12:11 PM, Yasu wrote: > Hi Erik, > > I posted email as following: > http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-July/018790.html > --- > Hi, > > I tried to build JDK8 with GCC4.8 on Fedora19. > However, build process has been failed as following: > > ------ > /usr/src/OpenJDK/tl/jdk/src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c: In function ?Java_sun_nio_fs_UnixNativeDispatcher_getgrnam0?: > /usr/src/OpenJDK/tl/jdk/src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c:1071:68: warning: unused parameter ?this? [-Wunused-parameter] > Java_sun_nio_fs_UnixNativeDispatcher_getgrnam0(JNIEnv* env, jclass this, > ^ > gmake[1]: *** [libs-only] Error 2 > make: *** [jdk-only] Error 2 > ------ > > I guess this issue is caused by -Werror. Better to fix the code: --- a/src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c Tue Jul 02 15:08:32 2013 +0100 +++ b/src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c Tue Jul 09 12:39:35 2013 +0100 @@ -1039,7 +1039,7 @@ } JNIEXPORT jint JNICALL -Java_sun_nio_fs_UnixNativeDispatcher_getgrnam0(JNIEnv* env, jclass this, +Java_sun_nio_fs_UnixNativeDispatcher_getgrnam0(JNIEnv* env, jclass, jlong nameAddress) { jint gid = -1; Andrew. From fweimer at redhat.com Tue Jul 9 12:18:14 2013 From: fweimer at redhat.com (Florian Weimer) Date: Tue, 09 Jul 2013 14:18:14 +0200 Subject: hg: jdk8/tl/langtools: 8019308: Add descriptions of Java SE 7 and 8 language changes to SourceVersion In-Reply-To: <51CCA782.90902@univ-mlv.fr> References: <20130627184914.3D2B9485D0@hg.openjdk.java.net> <51CCA782.90902@univ-mlv.fr> Message-ID: <51DBFF86.3020100@redhat.com> On 06/27/2013 10:58 PM, Remi Forax wrote: > On 06/27/2013 08:49 PM, joe.darcy at oracle.com wrote: >> Changeset: 065f8cb7bd89 >> Author: darcy >> Date: 2013-06-27 11:46 -0700 >> URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/065f8cb7bd89 >> >> 8019308: Add descriptions of Java SE 7 and 8 language changes to >> SourceVersion >> Reviewed-by: jjg >> >> ! src/share/classes/javax/lang/model/SourceVersion.java >> > > too late for this changeset, but I think that enhanced inference is also > a feature of 8. Doesn't this affect method bodies alone and thus isn't visible in the public javax.lang.model API? -- Florian Weimer / Red Hat Product Security Team From ivan.gerasimov at oracle.com Tue Jul 9 13:09:32 2013 From: ivan.gerasimov at oracle.com (Ivan Gerasimov) Date: Tue, 09 Jul 2013 17:09:32 +0400 Subject: RFR [8016838] java/lang/instrument/RedefineBigClass.sh needs modification In-Reply-To: <51DAF69C.3000404@oracle.com> References: <51D45B8C.7010109@oracle.com> <51D595ED.7050902@oracle.com> <51D5AEB6.3060608@oracle.com> <51D5B4C5.7060402@oracle.com> <51D61A66.5010001@oracle.com> <51D64D15.2090105@oracle.com> <51D6A59A.1060703@oracle.com> <51D6B1ED.9090709@oracle.com> <51DAEF13.8010000@oracle.com> <51DAF69C.3000404@oracle.com> Message-ID: <51DC0B8C.9010804@oracle.com> Please have a chance to review an updated webrev. It now includes a change to ProblemList.txt, so both modified tests are ignored for linux-x64. Sincerely yours, Ivan Gersimov On 08.07.2013 21:27, Se?n Coffey wrote: > > On 08/07/13 17:55, Ivan Gerasimov wrote: >> Thanks, Se?n! >> >> I located the build in which the memleak was first introduced -- it >> is jdk8-b69 (hs25-b13). >> I've updated the bug http://bugs.sun.com/view_bug.do?bug_id=8019845 >> with this. >> >> So what is the correct procedure to go forward now? >> Should I update the webrev to include changes to the problem list? >> I believe I shouldn't -- this list seems to be a sensitive stuff. > I'd suggest updating the webrev with the ProblemList > modification/addition. It's best not to add a test to testruns if it's > knowingly failing. The test can be removed from ProblemList when the > jdk8 regression is fixed. > > regards, > Sean. > >> >> Sincerely yours, >> Ivan >> >> >> On 05.07.2013 15:45, Se?n Coffey wrote: >>> Nice work indeed Ivan. Good to have a reliable testcase to catch >>> leaks in this area. >>> >>> I'd also suggest that this test goes on the ProblemList until the >>> new leak is sorted out for jdk8. The goal of JPRT runs is to have >>> clean runs. If it's on the problemList, then it's a known issue and >>> is normally tagged with the relevant bug ID so that the responsible >>> engineer knows the current state. >>> >>> regards, >>> Sean. >>> >>> On 05/07/2013 11:53, Ivan Gerasimov wrote: >>>> >>>> On 05.07.2013 8:35, Daniel D. Daugherty wrote: >>>>> Ivan, >>>>> >>>>> The changes look fine, I can sponsor your commit, looks like your >>>>> OpenJDK user name is 'igerasim', but I need to know a little bit >>>>> more about your testing of these fixes. Did you do a test JPRT >>>>> job to run the JLI tests (or just the two tests themselves)? >>>>> >>>> I've only run test from java/lang/instrument when checked the >>>> change with JDK6u60 (all passed) and with JDK6u51 (the test failed >>>> as expected, since the leak had still been there.) >>>> >>>>> Based on e-mail about this bug fix, I believe you've found a new >>>>> leak in JDK8/HSX-25 with test >>>>> java/lang/instrument/RedefineBigClass.sh. >>>> Right. The test shown a memleak with the the latest jdk8. >>>> I filed a bug 8019845 about this leak. >>>> Stefan Karlsson guessed that this may be related to 8003419 (NPG: >>>> Clean up metadata created during class loading if failure) >>>> Then I've checked the builds b57 (test failed) and b58 (test >>>> passed), so I confirmed that it may be the reason of the leak being >>>> observed now. >>>> But now I think that the reason may be different. >>>> It just turns out that the test shows failures for (at least) three >>>> different leaks - the one you, Daniel, solved (7121600), the one >>>> Stefan wrote about (8003419) and the one currently observed (8019845). >>>> >>>>> That's a good thing, but I think Alan and company would be a bit >>>>> grumpy with me if I pushed a test that failed as soon as someone >>>>> ran it. :-) Do you know if the revised RetransformBigClass.sh also >>>>> finds a new memory leak in JDK8/HSX-25? >>>>> >>>>> The way to deal with that is to put the test on the Problem.list >>>>> as part of the same changeset. However, the T&L folks might not like >>>>> that either... >>>> >>>> Well, the leak is there, and why not have a failing test as a >>>> reminder to have it fixed? >>>> >>>> Sincerely yours, >>>> Ivan Gerasimov >>>> >>>>> >>>>> Dan >>>>> >>>>> >>>>> On 7/4/13 6:59 PM, Ivan Gerasimov wrote: >>>>>> Thank you, Daniel! >>>>>> >>>>>> Please find an updated webrev at >>>>>> http://cr.openjdk.java.net/~igerasim/8016838/2/webrev/. >>>>>> It now includes the RetransformBigClass test modified in the same >>>>>> way as RedefineBigClass >>>>>> If the changes look fine, may I ask you to sponsor the commit, as >>>>>> I'm not a committer? >>>>>> Here's a link to hg export: >>>>>> http://cr.openjdk.java.net/~igerasim/2commit/8016838-jdk8-ReBigClass-improved.patch >>>>>> >>>>>> >>>>>> Thanks in advance, >>>>>> Ivan >>>>>> >>>>>> On 04.07.2013 21:45, Daniel D. Daugherty wrote: >>>>>>> On 7/4/13 11:19 AM, Ivan Gerasimov wrote: >>>>>>>> Daniel, thank you for review! >>>>>>>> >>>>>>>> Here's the updated with all all your suggestions adopted. >>>>>>>> http://cr.openjdk.java.net/~igerasim/8016838/1/webrev/ >>>>>>> >>>>>>> Looks good. >>>>>>> >>>>>>> >>>>>>>> >>>>>>>> I haven't yet considered applying the approach to >>>>>>>> RetransformBigClass. >>>>>>>> Do you want me to include this into this same change set or >>>>>>>> should I make it separately? >>>>>>> >>>>>>> I would include it in the same changeset. >>>>>>> >>>>>>> Dan >>>>>>> >>>>>>> >>>>>>>> >>>>>>>> Sincerely yours, >>>>>>>> Ivan >>>>>>>> >>>>>>>> >>>>>>>> On 04.07.2013 19:34, Daniel D. Daugherty wrote: >>>>>>>>> On 7/3/13 11:12 AM, Ivan Gerasimov wrote: >>>>>>>>>> Hello everybody! >>>>>>>>>> >>>>>>>>>> We have a request to improve jtreg test. >>>>>>>>>> The test had been written to verify fix for memory leak >>>>>>>>>> during class redefinition. >>>>>>>>>> The problem is that it always is reported as PASSED even in >>>>>>>>>> the presence of the leak. >>>>>>>>>> >>>>>>>>>> The proposed change is platform specific. >>>>>>>>>> It allows memory leak detection only on Linux. >>>>>>>>>> This is because the memory leak was in native code, so >>>>>>>>>> there's no easy way to detect it from within Java code. >>>>>>>>>> >>>>>>>>>> Here's the webrev for JDK8 repository: >>>>>>>>>> http://cr.openjdk.java.net/~igerasim/8016838/0/webrev/ >>>>>>>>> >>>>>>>>> Very nicely done! The logic in RedefineBigClass.sh only catches a >>>>>>>>> leak big enough to cause an Exception to be thrown. >>>>>>>>> >>>>>>>>> When I originally wrote this test and its companion: >>>>>>>>> >>>>>>>>> test/java/lang/instrument/RetransformBigClass* >>>>>>>>> >>>>>>>>> I could not come up with a platform independent way to put a >>>>>>>>> small >>>>>>>>> upper limit on memory growth. It never dawned on me that >>>>>>>>> putting in >>>>>>>>> something on one platform (Linux) was better than nothing. >>>>>>>>> >>>>>>>>> Are you planning to add this same logic to RetransformBigClass*? >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> test/java/lang/instrument/RedefineBigClass.sh >>>>>>>>> No comments. >>>>>>>>> >>>>>>>>> test/java/lang/instrument/RedefineBigClassApp.java >>>>>>>>> line 48: final long MEM_LEAK_THRESHOLD = 32 * 1024; // 32Mb >>>>>>>>> Would be better at the top of RedefineBigClassApp >>>>>>>>> rather than >>>>>>>>> "buried" down here. >>>>>>>>> >>>>>>>>> line 51: Long.valueOf(vmMemDelta) >>>>>>>>> There are several places where a long is passed to >>>>>>>>> Long.valueOf(). >>>>>>>>> Is there some reason you're not passing them directly >>>>>>>>> to println()? >>>>>>>>> >>>>>>>>> line 54: } else { >>>>>>>>> The "else" is redundant due to the "System.exit(1)" >>>>>>>>> call above it. >>>>>>>>> You can drop the "else {" and "}" and shift that last >>>>>>>>> println() to >>>>>>>>> the left. >>>>>>>>> >>>>>>>>> line 71: return Long.parseLong(line.split(" ")[22]) / 1024; >>>>>>>>> How about at least a comment referring to the Linux >>>>>>>>> proc(5) >>>>>>>>> man page... and the fact that the 23rd field is: >>>>>>>>> >>>>>>>>> vsize %lu Virtual memory size in bytes. >>>>>>>>> >>>>>>>>> Again, very nicely done! >>>>>>>>> >>>>>>>>> Dan >>>>>>>>> >>>>>>>>> >>>>>>>>>> >>>>>>>>>> The surprising thing is that modified test detected the leak >>>>>>>>>> with the latest JDK8! >>>>>>>>>> Latest 6 and 7 are fine, so it might be regression in JDK8. >>>>>>>>>> >>>>>>>>>> I've filled a bug >>>>>>>>>> http://bugs.sun.com/view_bug.do?bug_id=8019845 "Memory leak >>>>>>>>>> during class redefenition" (not yet available.) >>>>>>>>>> >>>>>>>>>> Sincerely yours, >>>>>>>>>> Ivan Gerasimov >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>> >>>>> >>>> >>> >>> >>> >> > > > From sean.coffey at oracle.com Tue Jul 9 13:28:15 2013 From: sean.coffey at oracle.com (=?ISO-8859-1?Q?Se=E1n_Coffey?=) Date: Tue, 09 Jul 2013 14:28:15 +0100 Subject: RFR : 8019979 : Replace CheckPackageAccess test with better one from closed repo Message-ID: <51DC0FEF.3050507@oracle.com> I'd like to move this testcase from our internal test repo and replace the current "test/java/lang/SecurityManager/CheckPackageAccess.java" testcase . It's a straightforward test to ensure that the package restrictions enforced via the java.security file are those expected. The testcase should be updated any time the package.access or package.definition properties are updated. webrev : http://cr.openjdk.java.net/~coffeys/webrev.8019979/webrev/ bug report : http://bugs.sun.com/view_bug.do?bug_id=8019979 regards, Sean. From sean.mullan at oracle.com Tue Jul 9 13:49:57 2013 From: sean.mullan at oracle.com (Sean Mullan) Date: Tue, 09 Jul 2013 09:49:57 -0400 Subject: RFR : 8019979 : Replace CheckPackageAccess test with better one from closed repo In-Reply-To: <51DC0FEF.3050507@oracle.com> References: <51DC0FEF.3050507@oracle.com> Message-ID: <51DC1505.4040909@oracle.com> Looks good to me. --Sean On 07/09/2013 09:28 AM, Se?n Coffey wrote: > I'd like to move this testcase from our internal test repo and replace > the current "test/java/lang/SecurityManager/CheckPackageAccess.java" > testcase . It's a straightforward test to ensure that the package > restrictions enforced via the java.security file are those expected. > > The testcase should be updated any time the package.access or > package.definition properties are updated. > > webrev : http://cr.openjdk.java.net/~coffeys/webrev.8019979/webrev/ > > bug report : http://bugs.sun.com/view_bug.do?bug_id=8019979 > > regards, > Sean. > > > > From paul.sandoz at oracle.com Tue Jul 9 14:15:23 2013 From: paul.sandoz at oracle.com (paul.sandoz at oracle.com) Date: Tue, 09 Jul 2013 14:15:23 +0000 Subject: hg: jdk8/tl/jdk: 8019370: Sync j.u.c Fork/Join from 166 to tl Message-ID: <20130709141553.2B297488F7@hg.openjdk.java.net> Changeset: 43134e79c0bb Author: psandoz Date: 2013-07-09 16:04 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/43134e79c0bb 8019370: Sync j.u.c Fork/Join from 166 to tl Reviewed-by: chegar, martin Contributed-by: Doug Lea
! src/share/classes/java/util/concurrent/AbstractExecutorService.java ! src/share/classes/java/util/concurrent/Callable.java ! src/share/classes/java/util/concurrent/CancellationException.java ! src/share/classes/java/util/concurrent/CompletableFuture.java ! src/share/classes/java/util/concurrent/CompletionService.java ! src/share/classes/java/util/concurrent/CountedCompleter.java ! src/share/classes/java/util/concurrent/ExecutionException.java ! src/share/classes/java/util/concurrent/Executor.java ! src/share/classes/java/util/concurrent/ExecutorService.java ! src/share/classes/java/util/concurrent/Executors.java ! src/share/classes/java/util/concurrent/ForkJoinPool.java ! src/share/classes/java/util/concurrent/ForkJoinTask.java ! src/share/classes/java/util/concurrent/ForkJoinWorkerThread.java ! src/share/classes/java/util/concurrent/Future.java ! src/share/classes/java/util/concurrent/FutureTask.java ! src/share/classes/java/util/concurrent/RecursiveAction.java ! src/share/classes/java/util/concurrent/RecursiveTask.java ! src/share/classes/java/util/concurrent/RejectedExecutionException.java ! src/share/classes/java/util/concurrent/RunnableFuture.java ! src/share/classes/java/util/concurrent/RunnableScheduledFuture.java ! src/share/classes/java/util/concurrent/ScheduledExecutorService.java ! src/share/classes/java/util/concurrent/ScheduledThreadPoolExecutor.java ! src/share/classes/java/util/concurrent/ThreadPoolExecutor.java From sean.coffey at oracle.com Tue Jul 9 15:04:04 2013 From: sean.coffey at oracle.com (sean.coffey at oracle.com) Date: Tue, 09 Jul 2013 15:04:04 +0000 Subject: hg: jdk8/tl/jdk: 8019979: Replace CheckPackageAccess test with better one from closed repo Message-ID: <20130709150434.9A466488FA@hg.openjdk.java.net> Changeset: 83c2976ef8ee Author: coffeys Date: 2013-07-09 16:00 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/83c2976ef8ee 8019979: Replace CheckPackageAccess test with better one from closed repo Reviewed-by: mullan ! test/java/lang/SecurityManager/CheckPackageAccess.java From Lance.Andersen at oracle.com Tue Jul 9 18:22:18 2013 From: Lance.Andersen at oracle.com (Lance Andersen - Oracle) Date: Tue, 9 Jul 2013 14:22:18 -0400 Subject: RFR: JAXP 1.5 for JDK8/7u40: 8016648: FEATURE_SECURE_PROCESSING set to true or false causes SAXParseException to be thrown In-Reply-To: <51DB6254.1080906@oracle.com> References: <51D13933.8090901@oracle.com> <51D1A3F2.2000707@oracle.com> <51D1CB94.90901@oracle.com> <51D1DE7D.3030105@oracle.com> <51D53C3A.6000708@oracle.com> <51D54E48.6060503@oracle.com> <51D5DA43.3050404@oracle.com> <51D68488.2050108@oracle.com> <51D77789.8080605@oracle.com> <51DB6254.1080906@oracle.com> Message-ID: <2064CDF7-A00F-491C-A36F-926ACFEA327B@oracle.com> Hi Joe Looks good Best Lance On Jul 8, 2013, at 9:07 PM, huizhe wang wrote: > Hi, > > I've updated webrev with improved property management, and quality backed by 320 test cases. Thanks Daniel for the help expanding the test suite! > > Here's the webrev: > http://cr.openjdk.java.net/~joehw/jdk8/8016648/webrev/ > > -Joe > > On 7/5/2013 6:48 PM, huizhe wang wrote: >> >> On 7/5/2013 1:32 AM, Alan Bateman wrote: >>> On 04/07/2013 21:25, huizhe wang wrote: >>>> >>>> Reverted back to the original code: http://cr.openjdk.java.net/~joehw/jdk8/8016648/webrev/ >>>> The code split the version number and look at the 1st or 2nd element, it thus works for both the current format and the proposed one, e.g. for 1.7.0, it compares with the 2nd element, and for the proposed MAJOR.MINOR.FU.*, the 1st or MAJOR. >>> Thanks for dropping the dependency on javax.lang.model. What you now is probably okay although I'm a bit dubious about attempting to support an alternative format (I'm not aware of any proposal that changes the format of the java.version property as changing it would like cause a lot of breakage). >> >> There was a survey from Iris last year, and the JPG site has a presentation from Aurelio. But you're right, I'll remove it. If there's any change in the future, that is if it happens at all, we can always add that back. >>> >>> A minor point but isJDKOrAbove looks a bit odd to me, I'd probably go for something like isJavaVersionGTE or isJavaVersionAtLeast but as it's not part of the API then it doesn't matter of course. >> >> isJavaVersionAtLeast is easy to understand. What does GTE stand for? >> >>> >>> I think I mentioned it a while back but have warnings emitted with System.err can be problematic (gets mixed up with application messages to stderr). I realize the Xerces code seems to do this in places but we really need to see about eliminating these messages or getting consistent logging into this code. >> >> I agree, this one is not particularly graceful. There were 88 matches of System.err in Xalan and 75 in Xerces, although some I believe are used for debugging. It could take quite some effort. >> >> I mentioned that with a standalone release, we were trying to stay away from new JDK features. It's probably better to spend time/effort on some upgrades. >> >>> >>>> : >>>> >>>> The last scenario to work on is if FSP is set on the Validator instead of SchemaFactory. With that, I'm looking at refactoring the way properties are represented so that they carry state. It would then be cleaner to pass them from SchemaFactory over to Schema and then Validator. It's a bit of work. Fortunately, we only have three of them to deal with. >>> So are you planning to send another webrev or do it as a separate issue? >> >> Looking at affected code by this change, it doesn't seem to be too bad. I'll send another webrev. >> >> Joe >> >>> >>> -Alan >> > -------------- next part -------------- Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 Oracle Java Engineering 1 Network Drive Burlington, MA 01803 Lance.Andersen at oracle.com From brian.burkhalter at oracle.com Tue Jul 9 18:46:39 2013 From: brian.burkhalter at oracle.com (Brian Burkhalter) Date: Tue, 9 Jul 2013 11:46:39 -0700 Subject: Java 8 RFR 6480539: BigDecimal.stripTrailingZeros() has no effect on zero itself ("0.0") In-Reply-To: References: <51D460F3.5070103@oracle.com> Message-ID: <0ADEDC48-48AE-42B4-98A4-9B261257D337@oracle.com> I've updated the webrev http://cr.openjdk.java.net/~bpb/6480539/ with all suggested changes. The javadoc change (CCC request) was approved. Thanks, Brian From brian.burkhalter at oracle.com Tue Jul 9 18:50:25 2013 From: brian.burkhalter at oracle.com (Brian Burkhalter) Date: Tue, 9 Jul 2013 11:50:25 -0700 Subject: Final patch for 8014319: Faster division of large integers In-Reply-To: References: Message-ID: <70879B0A-44AA-415B-85A6-78AE95325734@oracle.com> On Jul 8, 2013, at 3:28 PM, Tim Buktu wrote: > I hope everyone had a good July 4 weekend. Most definitely - thanks! > I updated the patch for 8014319 (i.e. phase 3 of the BigInteger work). > The patch still consists of three files; they can be found at > > https://gist.github.com/tbuktu/1576025/raw/f93093a412eac86d8d81e03b8b9135eb827f2a84/BigInteger.java.phase3 > > https://gist.github.com/tbuktu/1576025/raw/f628f854491520de472a15fbcc2b6b751efe74e7/MutableBigInteger.java.phase3 > > https://gist.github.com/tbuktu/1576025/raw/4c3faad4cdebffbd77485482a1e61c9a7a475060/BigIntegerTest.java.phase3 > > There are only two changes vs last week's version. A missing @author tag > has been added, and common powers of two are now cancelled before > dividing numbers. Good, thank you. > I realize the review of the phase 3 patch is about to begin, so I won't > make any more changes to the code. A good idea. Thanks, Brian From joe.darcy at oracle.com Tue Jul 9 19:17:02 2013 From: joe.darcy at oracle.com (Joe Darcy) Date: Tue, 09 Jul 2013 12:17:02 -0700 Subject: Java 8 RFR 6480539: BigDecimal.stripTrailingZeros() has no effect on zero itself ("0.0") In-Reply-To: <0ADEDC48-48AE-42B4-98A4-9B261257D337@oracle.com> References: <51D460F3.5070103@oracle.com> <0ADEDC48-48AE-42B4-98A4-9B261257D337@oracle.com> Message-ID: <51DC61AE.8000103@oracle.com> On 07/09/2013 11:46 AM, Brian Burkhalter wrote: > I've updated the webrev > > http://cr.openjdk.java.net/~bpb/6480539/ > > with all suggested changes. The javadoc change (CCC request) was approved. > > Thanks, > > Brian If the specification change [...] If 2596 * {@code compareMagnitude(BigDecimal.ZERO) == 0}, then 2597 * {@code BigDecimal.ZERO} is returned. is modified to something like "If this BigDecimal is numerically equal to zero, then BigDecimal.ZERO is returned." then the change will be ready to go back. Cheers, -Joe From brian.burkhalter at oracle.com Tue Jul 9 19:46:20 2013 From: brian.burkhalter at oracle.com (Brian Burkhalter) Date: Tue, 9 Jul 2013 12:46:20 -0700 Subject: Java 8 RFR 6480539: BigDecimal.stripTrailingZeros() has no effect on zero itself ("0.0") In-Reply-To: <51DC61AE.8000103@oracle.com> References: <51D460F3.5070103@oracle.com> <0ADEDC48-48AE-42B4-98A4-9B261257D337@oracle.com> <51DC61AE.8000103@oracle.com> Message-ID: On Jul 9, 2013, at 12:17 PM, Joe Darcy wrote: > If the specification change > > [...] If > 2596 * {@code compareMagnitude(BigDecimal.ZERO) == 0}, then > 2597 * {@code BigDecimal.ZERO} is returned. > > is modified to something like "If this BigDecimal is numerically equal to zero, then BigDecimal.ZERO is returned." then the change will be ready to go back. Done: http://cr.openjdk.java.net/~bpb/6480539/ Thanks, Brian From kumar.x.srinivasan at oracle.com Tue Jul 9 20:25:27 2013 From: kumar.x.srinivasan at oracle.com (Kumar Srinivasan) Date: Tue, 09 Jul 2013 13:25:27 -0700 Subject: RFR: 8019799: api/java_util/jar/Pack200 test failed with compactX profiles. (EZ) Message-ID: <51DC71B7.1060506@oracle.com> Hi, We had earlier added a fail over to the java implementation, for reference: http://hg.openjdk.java.net/jdk8/jdk8/jdk/rev/1432a6247ac9 The first time the unpacker is called an UnsatisfiedLinkError will be thrown, but subsequent invocations in the same JDK/VM instance, a NoClassDefFoundError will be thrown. This error also needs to be caught and handled. Here is the modified webrev: http://cr.openjdk.java.net/~ksrini/8019799/webrev.0/ Thanks Kumar From dan.xu at oracle.com Tue Jul 9 21:18:27 2013 From: dan.xu at oracle.com (Dan Xu) Date: Tue, 09 Jul 2013 14:18:27 -0700 Subject: RFR JDK-8017212 - File.createTempFile requires unnecessary "read" permission In-Reply-To: <51C98C32.7080109@oracle.com> References: <51C8E19C.4010205@oracle.com> <51C98C32.7080109@oracle.com> Message-ID: <51DC7E23.605@oracle.com> On 06/25/2013 05:25 AM, Alan Bateman wrote: > On 25/06/2013 01:17, Dan Xu wrote: >> HiAll, >> >> The fix of JDK-8013827 added an unnecessary "read" permission >> requirement in File.createTempFile methods. This change is going to >> fix this issue. Please help review it. Thanks! >> >> >> webrev: http://cr.openjdk.java.net/~dxu/8017212/webrev.00/ >> bug: http://bugs.sun.com/view_bug.do?bug_id=8017212 > This looks fine. Have you considered adding a test? (as it managed to > slip through with the recent change). > > -Alan Thanks, Alan. I have updated my patch and added more tests for the permission check. The new webrev can be reviewed at, http://cr.openjdk.java.net/~dxu/8017212/webrev.01/ -Dan From henry.jen at oracle.com Tue Jul 9 21:38:19 2013 From: henry.jen at oracle.com (Henry Jen) Date: Tue, 09 Jul 2013 14:38:19 -0700 Subject: RFR (2nd): 8015318: Extend Collector with 'finish' operation Message-ID: <51DC82CB.2080007@oracle.com> Hi, An update from earlier request based on some feedbacks. The webrev is at http://cr.openjdk.java.net/~henryjen/ccc/8015318.1/webrev This webrev depends on fix of bug 8012238[1]. Before that bug is fixed, applies this patch[2] to add needed type information. See the summary of API changes, specdiff is at http://cr.openjdk.java.net/~henryjen/ccc/8015318.1/specdiff/overview-summary.html [1] http://bugs.sun.com/view_bug.do?bug_id=8012238 [2] http://cr.openjdk.java.net/~henryjen/ccc/8015318.1/collector-hacks.patch Cheers, Henry From kumar.x.srinivasan at oracle.com Tue Jul 9 21:55:00 2013 From: kumar.x.srinivasan at oracle.com (kumar.x.srinivasan at oracle.com) Date: Tue, 09 Jul 2013 21:55:00 +0000 Subject: hg: jdk8/tl/langtools: 8020214: TEST_BUG: test/tools/javap/8007907/JavapReturns0AfterClassNotFoundTest.java broken Message-ID: <20130709215503.592024891D@hg.openjdk.java.net> Changeset: aedb3bb327d5 Author: ksrini Date: 2013-07-09 14:54 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/aedb3bb327d5 8020214: TEST_BUG: test/tools/javap/8007907/JavapReturns0AfterClassNotFoundTest.java broken Reviewed-by: jjg ! test/tools/javap/8007907/JavapReturns0AfterClassNotFoundTest.java From henry.jen at oracle.com Tue Jul 9 22:52:38 2013 From: henry.jen at oracle.com (Henry Jen) Date: Tue, 09 Jul 2013 15:52:38 -0700 Subject: RFR: 8015320: Pull spliterator() up from Collection to Iterable Message-ID: <51DC9436.6010000@oracle.com> Hi, Please review the webrev at http://cr.openjdk.java.net/~henryjen/ccc/8015320.0/webrev/ This allows turning an Iterable into a stream with spliterator() methods if the implementation provides one(like many Collection implementations) rather than be forced to use less-efficient iterator(). Two small changes are not directly related, - cleanup on SpliteratorCollisions.java test - add a @see Spliterator for ConcurrentModificationException Cheers, Henry From joe.darcy at oracle.com Tue Jul 9 23:13:59 2013 From: joe.darcy at oracle.com (Joseph Darcy) Date: Tue, 09 Jul 2013 16:13:59 -0700 Subject: Java 8 RFR 6480539: BigDecimal.stripTrailingZeros() has no effect on zero itself ("0.0") In-Reply-To: References: <51D460F3.5070103@oracle.com> <0ADEDC48-48AE-42B4-98A4-9B261257D337@oracle.com> <51DC61AE.8000103@oracle.com> Message-ID: <51DC9937.1060001@oracle.com> On 7/9/2013 12:46 PM, Brian Burkhalter wrote: > On Jul 9, 2013, at 12:17 PM, Joe Darcy wrote: > >> If the specification change >> >> [...] If >> 2596 * {@code compareMagnitude(BigDecimal.ZERO) == 0}, then >> 2597 * {@code BigDecimal.ZERO} is returned. >> >> is modified to something like "If this BigDecimal is numerically equal to zero, then BigDecimal.ZERO is returned." then the change will be ready to go back. > Done: > > http://cr.openjdk.java.net/~bpb/6480539/ > > That version look fine; thanks, -Joe From huizhe.wang at oracle.com Tue Jul 9 23:35:26 2013 From: huizhe.wang at oracle.com (huizhe.wang at oracle.com) Date: Tue, 09 Jul 2013 23:35:26 +0000 Subject: hg: jdk8/tl/jaxp: 8016648: FEATURE_SECURE_PROCESSING set to true or false causes SAXParseException to be thrown Message-ID: <20130709233528.C625748920@hg.openjdk.java.net> Changeset: 3b071f506ab9 Author: joehw Date: 2013-07-09 16:34 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jaxp/rev/3b071f506ab9 8016648: FEATURE_SECURE_PROCESSING set to true or false causes SAXParseException to be thrown Summary: jaxp 1.5 feature update Reviewed-by: alanb, dfuchs, lancea ! src/com/sun/org/apache/xalan/internal/XalanConstants.java ! src/com/sun/org/apache/xalan/internal/utils/SecuritySupport.java + src/com/sun/org/apache/xalan/internal/utils/XMLSecurityPropertyManager.java ! src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerFactoryImpl.java ! src/com/sun/org/apache/xerces/internal/dom/DOMConfigurationImpl.java ! src/com/sun/org/apache/xerces/internal/impl/Constants.java ! src/com/sun/org/apache/xerces/internal/impl/PropertyManager.java ! src/com/sun/org/apache/xerces/internal/impl/XMLDocumentFragmentScannerImpl.java ! src/com/sun/org/apache/xerces/internal/impl/XMLEntityManager.java ! src/com/sun/org/apache/xerces/internal/impl/xs/XMLSchemaLoader.java ! src/com/sun/org/apache/xerces/internal/impl/xs/XMLSchemaValidator.java ! src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDHandler.java ! src/com/sun/org/apache/xerces/internal/jaxp/DocumentBuilderImpl.java ! src/com/sun/org/apache/xerces/internal/jaxp/SAXParserImpl.java ! src/com/sun/org/apache/xerces/internal/jaxp/validation/StreamValidatorHelper.java ! src/com/sun/org/apache/xerces/internal/jaxp/validation/ValidatorHandlerImpl.java ! src/com/sun/org/apache/xerces/internal/jaxp/validation/XMLSchemaFactory.java ! src/com/sun/org/apache/xerces/internal/jaxp/validation/XMLSchemaValidatorComponentManager.java ! src/com/sun/org/apache/xerces/internal/parsers/DOMParser.java ! src/com/sun/org/apache/xerces/internal/parsers/SAXParser.java ! src/com/sun/org/apache/xerces/internal/parsers/XML11Configuration.java ! src/com/sun/org/apache/xerces/internal/utils/SecuritySupport.java + src/com/sun/org/apache/xerces/internal/utils/XMLSecurityPropertyManager.java ! src/com/sun/org/apache/xerces/internal/xinclude/XIncludeHandler.java ! src/com/sun/org/apache/xml/internal/utils/XMLReaderManager.java From eamonn at mcmanus.net Wed Jul 10 00:12:01 2013 From: eamonn at mcmanus.net (Eamonn McManus) Date: Tue, 9 Jul 2013 17:12:01 -0700 Subject: JDK 8 code review request for JDK-8020095: Fix doclint warnings in java.util.regex In-Reply-To: <51DB9A27.3090101@oracle.com> References: <51DB711A.1040108@oracle.com> <51DB9A27.3090101@oracle.com> Message-ID: While you are at it,

...

is a lot simpler than

...

. ?amonn 2013/7/8 Joe Darcy > > PS Updated webrev so that the ... structure don't have an empty "..." portion. > > http://cr.openjdk.java.net/~darcy/8020095.1/ > > -Joe > > > On 07/08/2013 07:10 PM, Joe Darcy wrote: >> >> Hello, >> >> Please review my changes to resolve (almost all of): >> >> JDK-8020095 Fix doclint warnings in java.util.regex >> http://cr.openjdk.java.net/~darcy/8020095.0/ >> >> Full text of the patch also included below. >> >> For some reason I have not been able to determine, even with the patch, one error remains: >> >>> src/share/classes/java/util/regex/Pattern.java:222: error: text not allowed in

Regex    

Result

Regex    Result
:{ "boo", "and", "foo" }
o
element >>> * >>> ^ >>> 1 error >> >> >> This line has the same structure as other that appear unproblematic. In any case, since over 200 doclint issues are resolved with the patch, I'd like to go forward with the patch and have this lone remaining error investigated later on. >> >> Thanks, >> >> -Joe >> > From henry.jen at oracle.com Wed Jul 10 00:14:57 2013 From: henry.jen at oracle.com (Henry Jen) Date: Tue, 09 Jul 2013 17:14:57 -0700 Subject: RFR: 8020062: Nest StreamBuilder interfaces inside relevant Stream interfaces Message-ID: <51DCA781.9010609@oracle.com> Hi, Please review the webrev at http://cr.openjdk.java.net/~henryjen/ccc/8020062/0/webrev/index.html This webrev does as the bug suggested, is a refactoring that moves StreamBuilder interfaces implementations into relevant Stream interfaces. The patch is created against the version after applying two earlier RFR of 8015315+8019395, which we hope will be pushed before this one. That said, there is no hard dependency on those two changesets. Cheers, Henry From david.holmes at oracle.com Wed Jul 10 02:04:09 2013 From: david.holmes at oracle.com (david.holmes at oracle.com) Date: Wed, 10 Jul 2013 02:04:09 +0000 Subject: hg: jdk8/tl/jdk: 8016341: java/lang/ref/OOMEInReferenceHandler.java failing intermittently Message-ID: <20130710020433.BEABE48927@hg.openjdk.java.net> Changeset: 7bb17aa9a09f Author: dholmes Date: 2013-07-09 22:01 -0400 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/7bb17aa9a09f 8016341: java/lang/ref/OOMEInReferenceHandler.java failing intermittently Summary: Ensure WeakRef object can't be prematurely gc'd Reviewed-by: chegar, plevart ! test/java/lang/ref/OOMEInReferenceHandler.java From weijun.wang at oracle.com Wed Jul 10 07:13:03 2013 From: weijun.wang at oracle.com (weijun.wang at oracle.com) Date: Wed, 10 Jul 2013 07:13:03 +0000 Subject: hg: jdk8/tl/jdk: 8019267: NPE in AbstractSaslImpl when trace level >= FINER in KRB5 Message-ID: <20130710071327.63CE44892F@hg.openjdk.java.net> Changeset: 780a64979c8d Author: weijun Date: 2013-07-10 15:11 +0800 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/780a64979c8d 8019267: NPE in AbstractSaslImpl when trace level >= FINER in KRB5 Reviewed-by: mullan ! src/share/classes/com/sun/security/sasl/util/AbstractSaslImpl.java ! test/sun/security/krb5/auto/SaslGSS.java From paul.sandoz at oracle.com Wed Jul 10 07:53:00 2013 From: paul.sandoz at oracle.com (paul.sandoz at oracle.com) Date: Wed, 10 Jul 2013 07:53:00 +0000 Subject: hg: jdk8/tl/jdk: 8017447: Unmodifiable map entry becomes modifiable if taken from a stream of map entries Message-ID: <20130710075325.715E148935@hg.openjdk.java.net> Changeset: ff5df05222d1 Author: psandoz Date: 2013-07-10 09:52 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/ff5df05222d1 8017447: Unmodifiable map entry becomes modifiable if taken from a stream of map entries Reviewed-by: briangoetz ! src/share/classes/java/util/Collections.java + test/java/util/Collections/UnmodifiableMapEntrySet.java From paul.sandoz at oracle.com Wed Jul 10 08:25:56 2013 From: paul.sandoz at oracle.com (paul.sandoz at oracle.com) Date: Wed, 10 Jul 2013 08:25:56 +0000 Subject: hg: jdk8/tl/jdk: 8020040: Improve and generalize the F/J tasks to handle right or left-balanced trees Message-ID: <20130710082620.9896A4893A@hg.openjdk.java.net> Changeset: 882baa1e0a38 Author: psandoz Date: 2013-07-10 10:24 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/882baa1e0a38 8020040: Improve and generalize the F/J tasks to handle right or left-balanced trees Reviewed-by: briangoetz Contributed-by: doug lea
, paul sandoz ! src/share/classes/java/util/stream/AbstractShortCircuitTask.java ! src/share/classes/java/util/stream/AbstractTask.java ! src/share/classes/java/util/stream/ForEachOps.java ! src/share/classes/java/util/stream/Nodes.java From paul.sandoz at oracle.com Wed Jul 10 08:33:27 2013 From: paul.sandoz at oracle.com (Paul Sandoz) Date: Wed, 10 Jul 2013 10:33:27 +0200 Subject: RFR: 8015320: Pull spliterator() up from Collection to Iterable In-Reply-To: <51DC9436.6010000@oracle.com> References: <51DC9436.6010000@oracle.com> Message-ID: <588C2B65-FE1F-4091-80EB-EA4B5994ED4E@oracle.com> On Jul 10, 2013, at 12:52 AM, Henry Jen wrote: > Hi, > > Please review the webrev at > > http://cr.openjdk.java.net/~henryjen/ccc/8015320.0/webrev/ > > This allows turning an Iterable into a stream with spliterator() methods > if the implementation provides one(like many Collection implementations) > rather than be forced to use less-efficient iterator(). > > Two small changes are not directly related, > - cleanup on SpliteratorCollisions.java test > - add a @see Spliterator for ConcurrentModificationException > Looks good. -- As an aside there is lots of shared code in SpliteratorCollisions and SpliteratorTraversingAndSplittingTest that should be pulled out into a separate class. Paul. From paul.sandoz at oracle.com Wed Jul 10 08:41:00 2013 From: paul.sandoz at oracle.com (Paul Sandoz) Date: Wed, 10 Jul 2013 10:41:00 +0200 Subject: RFR: 8020062: Nest StreamBuilder interfaces inside relevant Stream interfaces In-Reply-To: <51DCA781.9010609@oracle.com> References: <51DCA781.9010609@oracle.com> Message-ID: <4AA241A5-D681-4571-A114-E6F34F38706B@oracle.com> On Jul 10, 2013, at 2:14 AM, Henry Jen wrote: > Hi, > > Please review the webrev at > > http://cr.openjdk.java.net/~henryjen/ccc/8020062/0/webrev/index.html > > This webrev does as the bug suggested, is a refactoring that moves > StreamBuilder interfaces implementations into relevant Stream interfaces. > Looks good. Paul. > The patch is created against the version after applying two earlier RFR > of 8015315+8019395, which we hope will be pushed before this one. That > said, there is no hard dependency on those two changesets. > > Cheers, > Henry > From paul.sandoz at oracle.com Wed Jul 10 08:53:36 2013 From: paul.sandoz at oracle.com (Paul Sandoz) Date: Wed, 10 Jul 2013 10:53:36 +0200 Subject: RFR: 8015320: Pull spliterator() up from Collection to Iterable In-Reply-To: <588C2B65-FE1F-4091-80EB-EA4B5994ED4E@oracle.com> References: <51DC9436.6010000@oracle.com> <588C2B65-FE1F-4091-80EB-EA4B5994ED4E@oracle.com> Message-ID: On Jul 10, 2013, at 10:33 AM, Paul Sandoz wrote: > > On Jul 10, 2013, at 12:52 AM, Henry Jen wrote: > >> Hi, >> >> Please review the webrev at >> >> http://cr.openjdk.java.net/~henryjen/ccc/8015320.0/webrev/ >> >> This allows turning an Iterable into a stream with spliterator() methods >> if the implementation provides one(like many Collection implementations) >> rather than be forced to use less-efficient iterator(). >> >> Two small changes are not directly related, >> - cleanup on SpliteratorCollisions.java test >> - add a @see Spliterator for ConcurrentModificationException >> > > Looks good. > Drat, i spoke too soon. I suggest the following change to the JavaDOc of Iterable.spliterator(): /** * Creates a {@link Spliterator} over the elements described by this * {@code Iterable}. * * @implSpec * The default implementation creates an * early-binding spliterator * from the iterable's {@code Iterator}. The spliterator inherits the * fail-fast properties of the iterable's iterator. * @implNote * The default implementation should usually be overridden. The spliterator * returned by the default implementation has poor splitting capabilities, * is unsized, and does not report any spliterator characteristics. * Implementing classes can nearly always provide a better implementation. * * @return a {@code Spliterator} over the elements described by this * {@code Iterable}. * @since 1.8 */ default Spliterator spliterator() { Paul. From sean.coffey at oracle.com Wed Jul 10 09:15:36 2013 From: sean.coffey at oracle.com (=?UTF-8?B?U2XDoW4gQ29mZmV5?=) Date: Wed, 10 Jul 2013 10:15:36 +0100 Subject: RFR [8016838] java/lang/instrument/RedefineBigClass.sh needs modification In-Reply-To: <51DC0B8C.9010804@oracle.com> References: <51D45B8C.7010109@oracle.com> <51D595ED.7050902@oracle.com> <51D5AEB6.3060608@oracle.com> <51D5B4C5.7060402@oracle.com> <51D61A66.5010001@oracle.com> <51D64D15.2090105@oracle.com> <51D6A59A.1060703@oracle.com> <51D6B1ED.9090709@oracle.com> <51DAEF13.8010000@oracle.com> <51DAF69C.3000404@oracle.com> <51DC0B8C.9010804@oracle.com> Message-ID: <51DD2638.9070801@oracle.com> Ivan, I'll assume this is the latest webrev : http://cr.openjdk.java.net/~igerasim/8016838/3/webrev/ One comment - should the test be excluded for all linux variants (i.e. linux-all) ? regards, Sean. On 09/07/2013 14:09, Ivan Gerasimov wrote: > Please have a chance to review an updated webrev. > It now includes a change to ProblemList.txt, so both modified tests > are ignored for linux-x64. > > Sincerely yours, > Ivan Gersimov > > On 08.07.2013 21:27, Se?n Coffey wrote: >> >> On 08/07/13 17:55, Ivan Gerasimov wrote: >>> Thanks, Se?n! >>> >>> I located the build in which the memleak was first introduced -- it >>> is jdk8-b69 (hs25-b13). >>> I've updated the bug http://bugs.sun.com/view_bug.do?bug_id=8019845 >>> with this. >>> >>> So what is the correct procedure to go forward now? >>> Should I update the webrev to include changes to the problem list? >>> I believe I shouldn't -- this list seems to be a sensitive stuff. >> I'd suggest updating the webrev with the ProblemList >> modification/addition. It's best not to add a test to testruns if >> it's knowingly failing. The test can be removed from ProblemList when >> the jdk8 regression is fixed. >> >> regards, >> Sean. >> >>> >>> Sincerely yours, >>> Ivan >>> >>> >>> On 05.07.2013 15:45, Se?n Coffey wrote: >>>> Nice work indeed Ivan. Good to have a reliable testcase to catch >>>> leaks in this area. >>>> >>>> I'd also suggest that this test goes on the ProblemList until the >>>> new leak is sorted out for jdk8. The goal of JPRT runs is to have >>>> clean runs. If it's on the problemList, then it's a known issue >>>> and is normally tagged with the relevant bug ID so that the >>>> responsible engineer knows the current state. >>>> >>>> regards, >>>> Sean. >>>> >>>> On 05/07/2013 11:53, Ivan Gerasimov wrote: >>>>> >>>>> On 05.07.2013 8:35, Daniel D. Daugherty wrote: >>>>>> Ivan, >>>>>> >>>>>> The changes look fine, I can sponsor your commit, looks like your >>>>>> OpenJDK user name is 'igerasim', but I need to know a little bit >>>>>> more about your testing of these fixes. Did you do a test JPRT >>>>>> job to run the JLI tests (or just the two tests themselves)? >>>>>> >>>>> I've only run test from java/lang/instrument when checked the >>>>> change with JDK6u60 (all passed) and with JDK6u51 (the test failed >>>>> as expected, since the leak had still been there.) >>>>> >>>>>> Based on e-mail about this bug fix, I believe you've found a new >>>>>> leak in JDK8/HSX-25 with test >>>>>> java/lang/instrument/RedefineBigClass.sh. >>>>> Right. The test shown a memleak with the the latest jdk8. >>>>> I filed a bug 8019845 about this leak. >>>>> Stefan Karlsson guessed that this may be related to 8003419 (NPG: >>>>> Clean up metadata created during class loading if failure) >>>>> Then I've checked the builds b57 (test failed) and b58 (test >>>>> passed), so I confirmed that it may be the reason of the leak >>>>> being observed now. >>>>> But now I think that the reason may be different. >>>>> It just turns out that the test shows failures for (at least) >>>>> three different leaks - the one you, Daniel, solved (7121600), the >>>>> one Stefan wrote about (8003419) and the one currently observed >>>>> (8019845). >>>>> >>>>>> That's a good thing, but I think Alan and company would be a bit >>>>>> grumpy with me if I pushed a test that failed as soon as someone >>>>>> ran it. :-) Do you know if the revised RetransformBigClass.sh also >>>>>> finds a new memory leak in JDK8/HSX-25? >>>>>> >>>>>> The way to deal with that is to put the test on the Problem.list >>>>>> as part of the same changeset. However, the T&L folks might not like >>>>>> that either... >>>>> >>>>> Well, the leak is there, and why not have a failing test as a >>>>> reminder to have it fixed? >>>>> >>>>> Sincerely yours, >>>>> Ivan Gerasimov >>>>> >>>>>> >>>>>> Dan >>>>>> >>>>>> >>>>>> On 7/4/13 6:59 PM, Ivan Gerasimov wrote: >>>>>>> Thank you, Daniel! >>>>>>> >>>>>>> Please find an updated webrev at >>>>>>> http://cr.openjdk.java.net/~igerasim/8016838/2/webrev/. >>>>>>> It now includes the RetransformBigClass test modified in the >>>>>>> same way as RedefineBigClass >>>>>>> If the changes look fine, may I ask you to sponsor the commit, >>>>>>> as I'm not a committer? >>>>>>> Here's a link to hg export: >>>>>>> http://cr.openjdk.java.net/~igerasim/2commit/8016838-jdk8-ReBigClass-improved.patch >>>>>>> >>>>>>> >>>>>>> Thanks in advance, >>>>>>> Ivan >>>>>>> >>>>>>> On 04.07.2013 21:45, Daniel D. Daugherty wrote: >>>>>>>> On 7/4/13 11:19 AM, Ivan Gerasimov wrote: >>>>>>>>> Daniel, thank you for review! >>>>>>>>> >>>>>>>>> Here's the updated with all all your suggestions adopted. >>>>>>>>> http://cr.openjdk.java.net/~igerasim/8016838/1/webrev/ >>>>>>>> >>>>>>>> Looks good. >>>>>>>> >>>>>>>> >>>>>>>>> >>>>>>>>> I haven't yet considered applying the approach to >>>>>>>>> RetransformBigClass. >>>>>>>>> Do you want me to include this into this same change set or >>>>>>>>> should I make it separately? >>>>>>>> >>>>>>>> I would include it in the same changeset. >>>>>>>> >>>>>>>> Dan >>>>>>>> >>>>>>>> >>>>>>>>> >>>>>>>>> Sincerely yours, >>>>>>>>> Ivan >>>>>>>>> >>>>>>>>> >>>>>>>>> On 04.07.2013 19:34, Daniel D. Daugherty wrote: >>>>>>>>>> On 7/3/13 11:12 AM, Ivan Gerasimov wrote: >>>>>>>>>>> Hello everybody! >>>>>>>>>>> >>>>>>>>>>> We have a request to improve jtreg test. >>>>>>>>>>> The test had been written to verify fix for memory leak >>>>>>>>>>> during class redefinition. >>>>>>>>>>> The problem is that it always is reported as PASSED even in >>>>>>>>>>> the presence of the leak. >>>>>>>>>>> >>>>>>>>>>> The proposed change is platform specific. >>>>>>>>>>> It allows memory leak detection only on Linux. >>>>>>>>>>> This is because the memory leak was in native code, so >>>>>>>>>>> there's no easy way to detect it from within Java code. >>>>>>>>>>> >>>>>>>>>>> Here's the webrev for JDK8 repository: >>>>>>>>>>> http://cr.openjdk.java.net/~igerasim/8016838/0/webrev/ >>>>>>>>>> >>>>>>>>>> Very nicely done! The logic in RedefineBigClass.sh only >>>>>>>>>> catches a >>>>>>>>>> leak big enough to cause an Exception to be thrown. >>>>>>>>>> >>>>>>>>>> When I originally wrote this test and its companion: >>>>>>>>>> >>>>>>>>>> test/java/lang/instrument/RetransformBigClass* >>>>>>>>>> >>>>>>>>>> I could not come up with a platform independent way to put a >>>>>>>>>> small >>>>>>>>>> upper limit on memory growth. It never dawned on me that >>>>>>>>>> putting in >>>>>>>>>> something on one platform (Linux) was better than nothing. >>>>>>>>>> >>>>>>>>>> Are you planning to add this same logic to RetransformBigClass*? >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> test/java/lang/instrument/RedefineBigClass.sh >>>>>>>>>> No comments. >>>>>>>>>> >>>>>>>>>> test/java/lang/instrument/RedefineBigClassApp.java >>>>>>>>>> line 48: final long MEM_LEAK_THRESHOLD = 32 * 1024; // 32Mb >>>>>>>>>> Would be better at the top of RedefineBigClassApp >>>>>>>>>> rather than >>>>>>>>>> "buried" down here. >>>>>>>>>> >>>>>>>>>> line 51: Long.valueOf(vmMemDelta) >>>>>>>>>> There are several places where a long is passed to >>>>>>>>>> Long.valueOf(). >>>>>>>>>> Is there some reason you're not passing them directly >>>>>>>>>> to println()? >>>>>>>>>> >>>>>>>>>> line 54: } else { >>>>>>>>>> The "else" is redundant due to the "System.exit(1)" >>>>>>>>>> call above it. >>>>>>>>>> You can drop the "else {" and "}" and shift that last >>>>>>>>>> println() to >>>>>>>>>> the left. >>>>>>>>>> >>>>>>>>>> line 71: return Long.parseLong(line.split(" ")[22]) / 1024; >>>>>>>>>> How about at least a comment referring to the Linux >>>>>>>>>> proc(5) >>>>>>>>>> man page... and the fact that the 23rd field is: >>>>>>>>>> >>>>>>>>>> vsize %lu Virtual memory size in bytes. >>>>>>>>>> >>>>>>>>>> Again, very nicely done! >>>>>>>>>> >>>>>>>>>> Dan >>>>>>>>>> >>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> The surprising thing is that modified test detected the leak >>>>>>>>>>> with the latest JDK8! >>>>>>>>>>> Latest 6 and 7 are fine, so it might be regression in JDK8. >>>>>>>>>>> >>>>>>>>>>> I've filled a bug >>>>>>>>>>> http://bugs.sun.com/view_bug.do?bug_id=8019845 "Memory leak >>>>>>>>>>> during class redefenition" (not yet available.) >>>>>>>>>>> >>>>>>>>>>> Sincerely yours, >>>>>>>>>>> Ivan Gerasimov >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>> >>>>>> >>>>> >>>> >>>> >>>> >>> >> >> >> > From ivan.gerasimov at oracle.com Wed Jul 10 10:38:22 2013 From: ivan.gerasimov at oracle.com (Ivan Gerasimov) Date: Wed, 10 Jul 2013 14:38:22 +0400 Subject: RFR [8016838] java/lang/instrument/RedefineBigClass.sh needs modification In-Reply-To: <51DD2638.9070801@oracle.com> References: <51D45B8C.7010109@oracle.com> <51D595ED.7050902@oracle.com> <51D5AEB6.3060608@oracle.com> <51D5B4C5.7060402@oracle.com> <51D61A66.5010001@oracle.com> <51D64D15.2090105@oracle.com> <51D6A59A.1060703@oracle.com> <51D6B1ED.9090709@oracle.com> <51DAEF13.8010000@oracle.com> <51DAF69C.3000404@oracle.com> <51DC0B8C.9010804@oracle.com> <51DD2638.9070801@oracle.com> Message-ID: <51DD399E.4030105@oracle.com> Yes, I forgot to include the most important thing - a link to webrev! Your link is correct. http://cr.openjdk.java.net/~igerasim/8016838/3/webrev/ The tests fail on linux-x64 only, linux-i586 is fine. Here's the link to the logs of the tests run by Daniel Daugherty: http://prt-web.us.oracle.com//archive/2013/07/2013-07-05-045326.ddaugher.8016838_exp/logs/ Thus the memory leak seems to be specific to 64-bit Linux. Sincerely yours, Ivan On 10.07.2013 13:15, Se?n Coffey wrote: > Ivan, > > I'll assume this is the latest webrev : > http://cr.openjdk.java.net/~igerasim/8016838/3/webrev/ > > > One comment - should the test be excluded for all linux variants (i.e. > linux-all) ? > > regards, > Sean. > > On 09/07/2013 14:09, Ivan Gerasimov wrote: >> Please have a chance to review an updated webrev. >> It now includes a change to ProblemList.txt, so both modified tests >> are ignored for linux-x64. >> >> Sincerely yours, >> Ivan Gersimov >> >> On 08.07.2013 21:27, Se?n Coffey wrote: >>> >>> On 08/07/13 17:55, Ivan Gerasimov wrote: >>>> Thanks, Se?n! >>>> >>>> I located the build in which the memleak was first introduced -- it >>>> is jdk8-b69 (hs25-b13). >>>> I've updated the bug http://bugs.sun.com/view_bug.do?bug_id=8019845 >>>> with this. >>>> >>>> So what is the correct procedure to go forward now? >>>> Should I update the webrev to include changes to the problem list? >>>> I believe I shouldn't -- this list seems to be a sensitive stuff. >>> I'd suggest updating the webrev with the ProblemList >>> modification/addition. It's best not to add a test to testruns if >>> it's knowingly failing. The test can be removed from ProblemList >>> when the jdk8 regression is fixed. >>> >>> regards, >>> Sean. >>> >>>> >>>> Sincerely yours, >>>> Ivan >>>> >>>> >>>> On 05.07.2013 15:45, Se?n Coffey wrote: >>>>> Nice work indeed Ivan. Good to have a reliable testcase to catch >>>>> leaks in this area. >>>>> >>>>> I'd also suggest that this test goes on the ProblemList until the >>>>> new leak is sorted out for jdk8. The goal of JPRT runs is to have >>>>> clean runs. If it's on the problemList, then it's a known issue >>>>> and is normally tagged with the relevant bug ID so that the >>>>> responsible engineer knows the current state. >>>>> >>>>> regards, >>>>> Sean. >>>>> >>>>> On 05/07/2013 11:53, Ivan Gerasimov wrote: >>>>>> >>>>>> On 05.07.2013 8:35, Daniel D. Daugherty wrote: >>>>>>> Ivan, >>>>>>> >>>>>>> The changes look fine, I can sponsor your commit, looks like your >>>>>>> OpenJDK user name is 'igerasim', but I need to know a little bit >>>>>>> more about your testing of these fixes. Did you do a test JPRT >>>>>>> job to run the JLI tests (or just the two tests themselves)? >>>>>>> >>>>>> I've only run test from java/lang/instrument when checked the >>>>>> change with JDK6u60 (all passed) and with JDK6u51 (the test >>>>>> failed as expected, since the leak had still been there.) >>>>>> >>>>>>> Based on e-mail about this bug fix, I believe you've found a new >>>>>>> leak in JDK8/HSX-25 with test >>>>>>> java/lang/instrument/RedefineBigClass.sh. >>>>>> Right. The test shown a memleak with the the latest jdk8. >>>>>> I filed a bug 8019845 about this leak. >>>>>> Stefan Karlsson guessed that this may be related to 8003419 (NPG: >>>>>> Clean up metadata created during class loading if failure) >>>>>> Then I've checked the builds b57 (test failed) and b58 (test >>>>>> passed), so I confirmed that it may be the reason of the leak >>>>>> being observed now. >>>>>> But now I think that the reason may be different. >>>>>> It just turns out that the test shows failures for (at least) >>>>>> three different leaks - the one you, Daniel, solved (7121600), >>>>>> the one Stefan wrote about (8003419) and the one currently >>>>>> observed (8019845). >>>>>> >>>>>>> That's a good thing, but I think Alan and company would be a bit >>>>>>> grumpy with me if I pushed a test that failed as soon as someone >>>>>>> ran it. :-) Do you know if the revised RetransformBigClass.sh also >>>>>>> finds a new memory leak in JDK8/HSX-25? >>>>>>> >>>>>>> The way to deal with that is to put the test on the Problem.list >>>>>>> as part of the same changeset. However, the T&L folks might not >>>>>>> like >>>>>>> that either... >>>>>> >>>>>> Well, the leak is there, and why not have a failing test as a >>>>>> reminder to have it fixed? >>>>>> >>>>>> Sincerely yours, >>>>>> Ivan Gerasimov >>>>>> >>>>>>> >>>>>>> Dan >>>>>>> >>>>>>> >>>>>>> On 7/4/13 6:59 PM, Ivan Gerasimov wrote: >>>>>>>> Thank you, Daniel! >>>>>>>> >>>>>>>> Please find an updated webrev at >>>>>>>> http://cr.openjdk.java.net/~igerasim/8016838/2/webrev/. >>>>>>>> It now includes the RetransformBigClass test modified in the >>>>>>>> same way as RedefineBigClass >>>>>>>> If the changes look fine, may I ask you to sponsor the commit, >>>>>>>> as I'm not a committer? >>>>>>>> Here's a link to hg export: >>>>>>>> http://cr.openjdk.java.net/~igerasim/2commit/8016838-jdk8-ReBigClass-improved.patch >>>>>>>> >>>>>>>> >>>>>>>> Thanks in advance, >>>>>>>> Ivan >>>>>>>> >>>>>>>> On 04.07.2013 21:45, Daniel D. Daugherty wrote: >>>>>>>>> On 7/4/13 11:19 AM, Ivan Gerasimov wrote: >>>>>>>>>> Daniel, thank you for review! >>>>>>>>>> >>>>>>>>>> Here's the updated with all all your suggestions adopted. >>>>>>>>>> http://cr.openjdk.java.net/~igerasim/8016838/1/webrev/ >>>>>>>>> >>>>>>>>> Looks good. >>>>>>>>> >>>>>>>>> >>>>>>>>>> >>>>>>>>>> I haven't yet considered applying the approach to >>>>>>>>>> RetransformBigClass. >>>>>>>>>> Do you want me to include this into this same change set or >>>>>>>>>> should I make it separately? >>>>>>>>> >>>>>>>>> I would include it in the same changeset. >>>>>>>>> >>>>>>>>> Dan >>>>>>>>> >>>>>>>>> >>>>>>>>>> >>>>>>>>>> Sincerely yours, >>>>>>>>>> Ivan >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> On 04.07.2013 19:34, Daniel D. Daugherty wrote: >>>>>>>>>>> On 7/3/13 11:12 AM, Ivan Gerasimov wrote: >>>>>>>>>>>> Hello everybody! >>>>>>>>>>>> >>>>>>>>>>>> We have a request to improve jtreg test. >>>>>>>>>>>> The test had been written to verify fix for memory leak >>>>>>>>>>>> during class redefinition. >>>>>>>>>>>> The problem is that it always is reported as PASSED even in >>>>>>>>>>>> the presence of the leak. >>>>>>>>>>>> >>>>>>>>>>>> The proposed change is platform specific. >>>>>>>>>>>> It allows memory leak detection only on Linux. >>>>>>>>>>>> This is because the memory leak was in native code, so >>>>>>>>>>>> there's no easy way to detect it from within Java code. >>>>>>>>>>>> >>>>>>>>>>>> Here's the webrev for JDK8 repository: >>>>>>>>>>>> http://cr.openjdk.java.net/~igerasim/8016838/0/webrev/ >>>>>>>>>>> >>>>>>>>>>> Very nicely done! The logic in RedefineBigClass.sh only >>>>>>>>>>> catches a >>>>>>>>>>> leak big enough to cause an Exception to be thrown. >>>>>>>>>>> >>>>>>>>>>> When I originally wrote this test and its companion: >>>>>>>>>>> >>>>>>>>>>> test/java/lang/instrument/RetransformBigClass* >>>>>>>>>>> >>>>>>>>>>> I could not come up with a platform independent way to put a >>>>>>>>>>> small >>>>>>>>>>> upper limit on memory growth. It never dawned on me that >>>>>>>>>>> putting in >>>>>>>>>>> something on one platform (Linux) was better than nothing. >>>>>>>>>>> >>>>>>>>>>> Are you planning to add this same logic to >>>>>>>>>>> RetransformBigClass*? >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> test/java/lang/instrument/RedefineBigClass.sh >>>>>>>>>>> No comments. >>>>>>>>>>> >>>>>>>>>>> test/java/lang/instrument/RedefineBigClassApp.java >>>>>>>>>>> line 48: final long MEM_LEAK_THRESHOLD = 32 * 1024; // 32Mb >>>>>>>>>>> Would be better at the top of RedefineBigClassApp >>>>>>>>>>> rather than >>>>>>>>>>> "buried" down here. >>>>>>>>>>> >>>>>>>>>>> line 51: Long.valueOf(vmMemDelta) >>>>>>>>>>> There are several places where a long is passed to >>>>>>>>>>> Long.valueOf(). >>>>>>>>>>> Is there some reason you're not passing them >>>>>>>>>>> directly to println()? >>>>>>>>>>> >>>>>>>>>>> line 54: } else { >>>>>>>>>>> The "else" is redundant due to the "System.exit(1)" >>>>>>>>>>> call above it. >>>>>>>>>>> You can drop the "else {" and "}" and shift that >>>>>>>>>>> last println() to >>>>>>>>>>> the left. >>>>>>>>>>> >>>>>>>>>>> line 71: return Long.parseLong(line.split(" ")[22]) / 1024; >>>>>>>>>>> How about at least a comment referring to the Linux >>>>>>>>>>> proc(5) >>>>>>>>>>> man page... and the fact that the 23rd field is: >>>>>>>>>>> >>>>>>>>>>> vsize %lu Virtual memory size in bytes. >>>>>>>>>>> >>>>>>>>>>> Again, very nicely done! >>>>>>>>>>> >>>>>>>>>>> Dan >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> The surprising thing is that modified test detected the >>>>>>>>>>>> leak with the latest JDK8! >>>>>>>>>>>> Latest 6 and 7 are fine, so it might be regression in JDK8. >>>>>>>>>>>> >>>>>>>>>>>> I've filled a bug >>>>>>>>>>>> http://bugs.sun.com/view_bug.do?bug_id=8019845 "Memory leak >>>>>>>>>>>> during class redefenition" (not yet available.) >>>>>>>>>>>> >>>>>>>>>>>> Sincerely yours, >>>>>>>>>>>> Ivan Gerasimov >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>> >>>>>> >>>>> >>>>> >>>>> >>>> >>> >>> >>> >> > > > From sean.coffey at oracle.com Wed Jul 10 11:39:57 2013 From: sean.coffey at oracle.com (=?UTF-8?B?U2XDoW4gQ29mZmV5?=) Date: Wed, 10 Jul 2013 12:39:57 +0100 Subject: RFR [8016838] java/lang/instrument/RedefineBigClass.sh needs modification In-Reply-To: <51DD399E.4030105@oracle.com> References: <51D45B8C.7010109@oracle.com> <51D595ED.7050902@oracle.com> <51D5AEB6.3060608@oracle.com> <51D5B4C5.7060402@oracle.com> <51D61A66.5010001@oracle.com> <51D64D15.2090105@oracle.com> <51D6A59A.1060703@oracle.com> <51D6B1ED.9090709@oracle.com> <51DAEF13.8010000@oracle.com> <51DAF69C.3000404@oracle.com> <51DC0B8C.9010804@oracle.com> <51DD2638.9070801@oracle.com> <51DD399E.4030105@oracle.com> Message-ID: <51DD480D.8000005@oracle.com> On 10/07/13 11:38, Ivan Gerasimov wrote: > Yes, I forgot to include the most important thing - a link to webrev! > Your link is correct. > http://cr.openjdk.java.net/~igerasim/8016838/3/webrev/ > > The tests fail on linux-x64 only, linux-i586 is fine. > Here's the link to the logs of the tests run by Daniel Daugherty: > http://prt-web.us.oracle.com//archive/2013/07/2013-07-05-045326.ddaugher.8016838_exp/logs/ > > > Thus the memory leak seems to be specific to 64-bit Linux. Ok - didn't know that. Thanks. looks fine to me then, but use Dan or someone else as reviewer since I'm not one. regards, Sean. > > Sincerely yours, > Ivan > > On 10.07.2013 13:15, Se?n Coffey wrote: >> Ivan, >> >> I'll assume this is the latest webrev : >> http://cr.openjdk.java.net/~igerasim/8016838/3/webrev/ >> >> >> One comment - should the test be excluded for all linux variants >> (i.e. linux-all) ? >> >> regards, >> Sean. >> >> On 09/07/2013 14:09, Ivan Gerasimov wrote: >>> Please have a chance to review an updated webrev. >>> It now includes a change to ProblemList.txt, so both modified tests >>> are ignored for linux-x64. >>> >>> Sincerely yours, >>> Ivan Gersimov >>> >>> On 08.07.2013 21:27, Se?n Coffey wrote: >>>> >>>> On 08/07/13 17:55, Ivan Gerasimov wrote: >>>>> Thanks, Se?n! >>>>> >>>>> I located the build in which the memleak was first introduced -- >>>>> it is jdk8-b69 (hs25-b13). >>>>> I've updated the bug >>>>> http://bugs.sun.com/view_bug.do?bug_id=8019845 with this. >>>>> >>>>> So what is the correct procedure to go forward now? >>>>> Should I update the webrev to include changes to the problem list? >>>>> I believe I shouldn't -- this list seems to be a sensitive stuff. >>>> I'd suggest updating the webrev with the ProblemList >>>> modification/addition. It's best not to add a test to testruns if >>>> it's knowingly failing. The test can be removed from ProblemList >>>> when the jdk8 regression is fixed. >>>> >>>> regards, >>>> Sean. >>>> >>>>> >>>>> Sincerely yours, >>>>> Ivan >>>>> >>>>> >>>>> On 05.07.2013 15:45, Se?n Coffey wrote: >>>>>> Nice work indeed Ivan. Good to have a reliable testcase to catch >>>>>> leaks in this area. >>>>>> >>>>>> I'd also suggest that this test goes on the ProblemList until the >>>>>> new leak is sorted out for jdk8. The goal of JPRT runs is to have >>>>>> clean runs. If it's on the problemList, then it's a known issue >>>>>> and is normally tagged with the relevant bug ID so that the >>>>>> responsible engineer knows the current state. >>>>>> >>>>>> regards, >>>>>> Sean. >>>>>> >>>>>> On 05/07/2013 11:53, Ivan Gerasimov wrote: >>>>>>> >>>>>>> On 05.07.2013 8:35, Daniel D. Daugherty wrote: >>>>>>>> Ivan, >>>>>>>> >>>>>>>> The changes look fine, I can sponsor your commit, looks like your >>>>>>>> OpenJDK user name is 'igerasim', but I need to know a little bit >>>>>>>> more about your testing of these fixes. Did you do a test JPRT >>>>>>>> job to run the JLI tests (or just the two tests themselves)? >>>>>>>> >>>>>>> I've only run test from java/lang/instrument when checked the >>>>>>> change with JDK6u60 (all passed) and with JDK6u51 (the test >>>>>>> failed as expected, since the leak had still been there.) >>>>>>> >>>>>>>> Based on e-mail about this bug fix, I believe you've found a new >>>>>>>> leak in JDK8/HSX-25 with test >>>>>>>> java/lang/instrument/RedefineBigClass.sh. >>>>>>> Right. The test shown a memleak with the the latest jdk8. >>>>>>> I filed a bug 8019845 about this leak. >>>>>>> Stefan Karlsson guessed that this may be related to 8003419 >>>>>>> (NPG: Clean up metadata created during class loading if failure) >>>>>>> Then I've checked the builds b57 (test failed) and b58 (test >>>>>>> passed), so I confirmed that it may be the reason of the leak >>>>>>> being observed now. >>>>>>> But now I think that the reason may be different. >>>>>>> It just turns out that the test shows failures for (at least) >>>>>>> three different leaks - the one you, Daniel, solved (7121600), >>>>>>> the one Stefan wrote about (8003419) and the one currently >>>>>>> observed (8019845). >>>>>>> >>>>>>>> That's a good thing, but I think Alan and company would be a bit >>>>>>>> grumpy with me if I pushed a test that failed as soon as someone >>>>>>>> ran it. :-) Do you know if the revised RetransformBigClass.sh also >>>>>>>> finds a new memory leak in JDK8/HSX-25? >>>>>>>> >>>>>>>> The way to deal with that is to put the test on the Problem.list >>>>>>>> as part of the same changeset. However, the T&L folks might not >>>>>>>> like >>>>>>>> that either... >>>>>>> >>>>>>> Well, the leak is there, and why not have a failing test as a >>>>>>> reminder to have it fixed? >>>>>>> >>>>>>> Sincerely yours, >>>>>>> Ivan Gerasimov >>>>>>> >>>>>>>> >>>>>>>> Dan >>>>>>>> >>>>>>>> >>>>>>>> On 7/4/13 6:59 PM, Ivan Gerasimov wrote: >>>>>>>>> Thank you, Daniel! >>>>>>>>> >>>>>>>>> Please find an updated webrev at >>>>>>>>> http://cr.openjdk.java.net/~igerasim/8016838/2/webrev/. >>>>>>>>> It now includes the RetransformBigClass test modified in the >>>>>>>>> same way as RedefineBigClass >>>>>>>>> If the changes look fine, may I ask you to sponsor the commit, >>>>>>>>> as I'm not a committer? >>>>>>>>> Here's a link to hg export: >>>>>>>>> http://cr.openjdk.java.net/~igerasim/2commit/8016838-jdk8-ReBigClass-improved.patch >>>>>>>>> >>>>>>>>> >>>>>>>>> Thanks in advance, >>>>>>>>> Ivan >>>>>>>>> >>>>>>>>> On 04.07.2013 21:45, Daniel D. Daugherty wrote: >>>>>>>>>> On 7/4/13 11:19 AM, Ivan Gerasimov wrote: >>>>>>>>>>> Daniel, thank you for review! >>>>>>>>>>> >>>>>>>>>>> Here's the updated with all all your suggestions adopted. >>>>>>>>>>> http://cr.openjdk.java.net/~igerasim/8016838/1/webrev/ >>>>>>>>>> >>>>>>>>>> Looks good. >>>>>>>>>> >>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> I haven't yet considered applying the approach to >>>>>>>>>>> RetransformBigClass. >>>>>>>>>>> Do you want me to include this into this same change set or >>>>>>>>>>> should I make it separately? >>>>>>>>>> >>>>>>>>>> I would include it in the same changeset. >>>>>>>>>> >>>>>>>>>> Dan >>>>>>>>>> >>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> Sincerely yours, >>>>>>>>>>> Ivan >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> On 04.07.2013 19:34, Daniel D. Daugherty wrote: >>>>>>>>>>>> On 7/3/13 11:12 AM, Ivan Gerasimov wrote: >>>>>>>>>>>>> Hello everybody! >>>>>>>>>>>>> >>>>>>>>>>>>> We have a request to improve jtreg test. >>>>>>>>>>>>> The test had been written to verify fix for memory leak >>>>>>>>>>>>> during class redefinition. >>>>>>>>>>>>> The problem is that it always is reported as PASSED even >>>>>>>>>>>>> in the presence of the leak. >>>>>>>>>>>>> >>>>>>>>>>>>> The proposed change is platform specific. >>>>>>>>>>>>> It allows memory leak detection only on Linux. >>>>>>>>>>>>> This is because the memory leak was in native code, so >>>>>>>>>>>>> there's no easy way to detect it from within Java code. >>>>>>>>>>>>> >>>>>>>>>>>>> Here's the webrev for JDK8 repository: >>>>>>>>>>>>> http://cr.openjdk.java.net/~igerasim/8016838/0/webrev/ >>>>>>>>>>>> >>>>>>>>>>>> Very nicely done! The logic in RedefineBigClass.sh only >>>>>>>>>>>> catches a >>>>>>>>>>>> leak big enough to cause an Exception to be thrown. >>>>>>>>>>>> >>>>>>>>>>>> When I originally wrote this test and its companion: >>>>>>>>>>>> >>>>>>>>>>>> test/java/lang/instrument/RetransformBigClass* >>>>>>>>>>>> >>>>>>>>>>>> I could not come up with a platform independent way to put >>>>>>>>>>>> a small >>>>>>>>>>>> upper limit on memory growth. It never dawned on me that >>>>>>>>>>>> putting in >>>>>>>>>>>> something on one platform (Linux) was better than nothing. >>>>>>>>>>>> >>>>>>>>>>>> Are you planning to add this same logic to >>>>>>>>>>>> RetransformBigClass*? >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> test/java/lang/instrument/RedefineBigClass.sh >>>>>>>>>>>> No comments. >>>>>>>>>>>> >>>>>>>>>>>> test/java/lang/instrument/RedefineBigClassApp.java >>>>>>>>>>>> line 48: final long MEM_LEAK_THRESHOLD = 32 * 1024; // >>>>>>>>>>>> 32Mb >>>>>>>>>>>> Would be better at the top of RedefineBigClassApp >>>>>>>>>>>> rather than >>>>>>>>>>>> "buried" down here. >>>>>>>>>>>> >>>>>>>>>>>> line 51: Long.valueOf(vmMemDelta) >>>>>>>>>>>> There are several places where a long is passed to >>>>>>>>>>>> Long.valueOf(). >>>>>>>>>>>> Is there some reason you're not passing them >>>>>>>>>>>> directly to println()? >>>>>>>>>>>> >>>>>>>>>>>> line 54: } else { >>>>>>>>>>>> The "else" is redundant due to the "System.exit(1)" >>>>>>>>>>>> call above it. >>>>>>>>>>>> You can drop the "else {" and "}" and shift that >>>>>>>>>>>> last println() to >>>>>>>>>>>> the left. >>>>>>>>>>>> >>>>>>>>>>>> line 71: return Long.parseLong(line.split(" ")[22]) / >>>>>>>>>>>> 1024; >>>>>>>>>>>> How about at least a comment referring to the Linux >>>>>>>>>>>> proc(5) >>>>>>>>>>>> man page... and the fact that the 23rd field is: >>>>>>>>>>>> >>>>>>>>>>>> vsize %lu Virtual memory size in bytes. >>>>>>>>>>>> >>>>>>>>>>>> Again, very nicely done! >>>>>>>>>>>> >>>>>>>>>>>> Dan >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>> The surprising thing is that modified test detected the >>>>>>>>>>>>> leak with the latest JDK8! >>>>>>>>>>>>> Latest 6 and 7 are fine, so it might be regression in JDK8. >>>>>>>>>>>>> >>>>>>>>>>>>> I've filled a bug >>>>>>>>>>>>> http://bugs.sun.com/view_bug.do?bug_id=8019845 "Memory >>>>>>>>>>>>> leak during class redefenition" (not yet available.) >>>>>>>>>>>>> >>>>>>>>>>>>> Sincerely yours, >>>>>>>>>>>>> Ivan Gerasimov >>>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>> >>>>>> >>>>>> >>>>>> >>>>> >>>> >>>> >>>> >>> >> >> >> > From joel.franck at oracle.com Wed Jul 10 14:17:22 2013 From: joel.franck at oracle.com (Joel Borggren-Franck) Date: Wed, 10 Jul 2013 16:17:22 +0200 Subject: Code Review Request: More tests for 7184826: (reflect) Add support for Project Lambda concepts in core reflection In-Reply-To: <51B91AA5.6090807@oracle.com> References: <519E2C52.20203@oracle.com> <51B91AA5.6090807@oracle.com> Message-ID: <20130710141722.GA23047@jfranck-desktop.jrpg.bea.com> Hi Amy, Tristan, I'm not a Reviewer kind of reviewer, but I've started to look at the code and can sponsor this. Some comments on test/java/lang/reflect/Method/invoke/DefaultStaticTest.java: As there are a lot of non-public top-level classes perhaps this test should be in it own directory. It is very hard to read the data table: 292 {interface1.class, 1, 1, new Object1(), new Object[]{}, 293 new Object[]{}, "interface1", null}, I believe you should move the methodsNum constant and the declMethods num constant to an annotation on the interface/class in question. For example: @MyTestData(numMethods=1, declMethods=1) 41 interface interface1 { 42 @DefaultMethod(isDefault = true) 43 @StaticMethod(isStatic = false) 44 @ReturnValue(value = "interface1.defaultMethod") 45 default String defaultMethod(){ return "interface1.defaultMethod"; }; 46 } That way it is much easier to inspect that the constants are right. The same can probably be done with the return values encoded. Instead of all these "new Objects[] {}" can't you create a field, Object [] EMPTY_PARAMETERS = new Object() {} and reuse it? That way it will be much easier to verify that the encoded test data is correct. I'll comment on the other tests shortly. cheers /Joel On 2013-06-13, Amy Lu wrote: > This has been pending on review for long ... Please help to review. > I also need a sponsor for this. > > Thank you very much. > > /Amy > > On 5/23/13 10:48 PM, Amy Lu wrote: > >Please help to review: > > > >More tests for 7184826: (reflect) Add support for Project Lambda > >concepts in core reflection > > > >This includes: > >1. improvement for existing tests with more situations > >2. Test for invoking interface default/static method by j.l.r.Method > >3. Test for invoking interface default/static method by MethodHandle > > > >https://dl.dropboxusercontent.com/u/5812451/yl153753/7184826/webrev.00/index.html > > > > > >Thanks, > >Amy > From joe.darcy at oracle.com Wed Jul 10 18:05:56 2013 From: joe.darcy at oracle.com (joe.darcy at oracle.com) Date: Wed, 10 Jul 2013 18:05:56 +0000 Subject: hg: jdk8/tl/jdk: 8020294: Fix doclint issues in java.util.Spliterator Message-ID: <20130710180609.DF00048965@hg.openjdk.java.net> Changeset: 7c44ea602cc8 Author: darcy Date: 2013-07-10 11:05 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/7c44ea602cc8 8020294: Fix doclint issues in java.util.Spliterator Reviewed-by: psandoz ! src/share/classes/java/util/Spliterator.java From omajid at redhat.com Wed Jul 10 19:01:06 2013 From: omajid at redhat.com (Omair Majid) Date: Wed, 10 Jul 2013 15:01:06 -0400 Subject: Build error with GCC4.8 on Fedora19 In-Reply-To: <51DBBE7C.6070801@oracle.com> References: <20130709045501.4D23E3B6274@msgw008-05.ocn.ad.jp> <51DBA3CD.9020605@oracle.com> <51DBBE7C.6070801@oracle.com> Message-ID: <51DDAF72.4000909@redhat.com> On 07/09/2013 03:40 AM, Erik Joelsson wrote: > I would like to see a comment explaining why the option was needed. Is > this a bug in gcc or has the checking just become better? -Werror is not a great default. It means "all warnings are errors". The set of warnings that a compiler emits changes all the time. Users and distributions can enable additional warnings by default. Newer compiler versions may omit additional warnings. So on any compiler other than the typical compiler used, extra warnings are possible. With -Werror, this will probably fail. Lots of people discourage it [1]. We have been setting SCTP_WERROR="" to disable this -Werror on Fedora builds [2]. Cheers, Omair [1] https://blog.flameeyes.eu/2009/02/future-proof-your-code-dont-use-werror [2] http://pkgs.fedoraproject.org/cgit/java-1.8.0-openjdk.git/tree/java-1.8.0-openjdk.spec#n425 -- PGP Key: 66484681 (http://pgp.mit.edu/) Fingerprint = F072 555B 0A17 3957 4E95 0056 F286 F14F 6648 4681 From rob.mckenna at oracle.com Wed Jul 10 18:54:22 2013 From: rob.mckenna at oracle.com (rob.mckenna at oracle.com) Date: Wed, 10 Jul 2013 18:54:22 +0000 Subject: hg: jdk8/tl/jdk: 2 new changesets Message-ID: <20130710185506.7F13C4896A@hg.openjdk.java.net> Changeset: 607fa1ff3de2 Author: bpb Date: 2013-07-09 11:26 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/607fa1ff3de2 6178739: (fmt) Formatter.format("%0.4f\n", 56789.456789) generates MissingFormatWidthException Summary: Change the field width specification to require a positive value. The exception is still thrown but that is now explicitly consistent with the specification. Reviewed-by: darcy Contributed-by: Brian Burkhalter ! src/share/classes/java/util/Formatter.java Changeset: 2ee772cda1d6 Author: bpb Date: 2013-07-09 12:47 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/2ee772cda1d6 6480539: BigDecimal.stripTrailingZeros() has no effect on zero itself ("0.0") Summary: Make stripTrailingZeros() return BigDecimal.ZERO if the BigDecimal is numerically equal to zero. Reviewed-by: darcy Contributed-by: Brian Burkhalter ! src/share/classes/java/math/BigDecimal.java ! test/java/math/BigDecimal/StrippingZerosTest.java From dl at cs.oswego.edu Wed Jul 10 19:13:49 2013 From: dl at cs.oswego.edu (Doug Lea) Date: Wed, 10 Jul 2013 15:13:49 -0400 Subject: class SplittableRandom Message-ID: <51DDB26D.8050506@cs.oswego.edu> [Note: I'm also posting this on the concurrency-interest list.] We expect that using random numbers in parallel Stream computations will be common. (We know it is common in parallel computing in general.) But we had left support for it in an unsatisfactory state. If you want to create a stream of random numbers to drive a parallel computation, you'd choose among two options, neither of them providing what you probably want: (1) Use a stream based on a single shared java.util.Random object, in which case your program will encounter stunning slowdowns when run with many cores; or (2) Use a stream based on ThreadLocalRandom, which avoids contention, but gives you no control over the use or properties of the per-thread singleton Random object. While the ThreadLocalRandom option is great for many purposes, you wouldn't want to use it in, say, a high-quality Monte Carlo simulation. Enter Guy Steele. Guy has been working on an algorithm that addresses exactly the substantial range of uses not otherwise supported: It is, in essence, the Random number generator analog of a Spliterator. Class SplittableRandom supports method split() that creates a sub-generator that when used in parallel with the original, maintains its statistical properties. When Brian Goetz and I heard that this was nearing completion, we entered drop-everything mode to explore whether it could be added now in time for JDK8. We conclude that it should. We've been helping with JDK-ifying the basic algorithm, integrating java.util.Stream support, etc, to enable addition as class java.util.SplittableRandom. Just to be on the cautious side though, we are for the moment treating this in the same way we treat jsr166 candidates for potential OpenJDK integration. The initial version is available at http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/src/main/java/util/SplittableRandom.java?view=log With API docs at: http://gee.cs.oswego.edu/dl/jsr166/dist/docs/java/util/SplittableRandom.html This post serves as a request for comment, with shorter than usual turnaround (a couple of days) before considering a request to integrate into OpenJDK 8. So, please take a look. Here are answers to some likely questions: Q: How much faster is it than java.util.Random? A: In sequential usages, usually at least twice as fast for long and double methods; usually only slightly faster for int methods. In parallel usages, SplittableRandom is almost arbitrarily faster. The very first simple parallel Stream program I wrote (to generate and sum nextLong()'s) ran 2900 times faster than the java.util.Random equivalent on a 32-way machine. Q: When can/should I use it instead of java.util.Random? A: Whenever you are not sharing one across Threads. Instances of SplittableRandom are not thread-safe. They are designed to be split, not shared, across threads. When class SplittableRandom applies (or you can rework your program to make it apply), it is usually a better choice. Not only is it usually faster, it also has better statistical independence and uniformity properties. Q: When can/should I use it instead of java.util.concurrent.ThreadLocalRandom? A: When you are doing structured fork/join computations, so you can explicitly split one rather than relying on the per-thread singleton instance. Q: Why is this in java.util, not java.util.concurrent? A: Because, like java.util.Spliterator, SplittableRandom is a tool for arranging isolated parallel computations that don't entail any concurrency control themselves. Q: Why isn't SplittableRandom a subclass of Random? A: Class Random requires thread-safety in its spec. It would be nonsensical for SplittableRandom to comply. Q: Why don't you at least come up with a new interface that defines methods shared with java.util.Random? A: We spent a couple of days exploring this. We think it could and probably should be done, but not now. Method names and specs of SplittableRandom are chosen to make it possible. But we encountered enough short-term obstacles to conclude that this is an unwise move for JDK8. Among the issues are that we'd need to adjust some specs and possibly some code in java.util.Random, and that we are at a loss about whether or how to generalize SplittableRandom's added Stream methods. In the mean time, it would be more than acceptable for SplittableRandom to be used primarily in new code (or new adaptions of old code) that wouldn't need or want to be interoperable with code using java.util.Random. Q: Are we going to revisit with SplittableRandom all those memory contention issues we saw with ThreadLocalRandom? A: Most likely not. Most of the memory contention issues surrounding ThreadLocalRandom arise because they are long-lived. SplittableRandoms will tend to be short-lived. In any case, now that we have the tools to cope (@Contended), we can evaluate and adjust if more detailed empirical analysis warrants. From bill.pittore at oracle.com Wed Jul 10 19:29:54 2013 From: bill.pittore at oracle.com (BILL PITTORE) Date: Wed, 10 Jul 2013 15:29:54 -0400 Subject: RFR - Changes to address CCC 8014135: Support for statically linked agents In-Reply-To: References: <51D494E9.2020200@oracle.com> Message-ID: <51DDB632.4050805@oracle.com> On 7/3/2013 6:32 PM, Jeremy Manson wrote: > I know that this is mentioned in the JEP, but does it really make > sense to have -agentpath work here, rather than just -agentlib? I > would think that specifying a full pathname and getting the library > loaded out of the launcher would be a little surprising to people who > are basically saying "please load this agent from the given path". > > Also, in practice, we do something very similar at Google, and, when > testing, I find it occasionally useful to be able to say "please load > this agent on the command line via the agentpath I gave you, rather > than loading the one with the same name I baked into the launcher". > > (FWIW, when we did this internally at Google, we added a special -XX > flag for when the agent is in the launcher. I know that you don't > want to go that way, though.) > Thanks for the comments. I would say the thinking here is that we want this to be as transparent as possible to the end user. In our view of the end user is someone perhaps using an IDE and the actual execution of the VM with agent arguments is hidden. In your case it sounds like you are actually developing agents which is a whole different ball game. I could certainly see adding a -XX argument that forces agentpath to load the external library which would be good for agent development and debugging. No need to relink the entire VM with the new agent. Our tech lead is out on vacation this week so I'll bring this up when he's back. bill > > On Wed, Jul 3, 2013 at 2:17 PM, BILL PITTORE > wrote: > > These changes address bug 8014135 which adds support for > statically linked agents in the VM. This is a followup to the > recent JNI spec changes that addressed statically linked JNI > libraries( 8005716). > The JEP for this change is the same JEP as the JNI changes: > http://openjdk.java.net/jeps/178 > > Webrevs are here: > > http://cr.openjdk.java.net/~bpittore/8014135/jdk/webrev.00/ > > http://cr.openjdk.java.net/~bpittore/8014135/hotspot/webrev.00/ > > > The changes to jvmti.xml can also be seen in the output file that > I placed here: > http://cr.openjdk.java.net/~bpittore/8014135/hotspot/webrev.00/jvmti.html > > > Thanks, > bill > > > From aleksey.shipilev at oracle.com Wed Jul 10 20:49:28 2013 From: aleksey.shipilev at oracle.com (Aleksey Shipilev) Date: Thu, 11 Jul 2013 00:49:28 +0400 Subject: class SplittableRandom In-Reply-To: <51DDB26D.8050506@cs.oswego.edu> References: <51DDB26D.8050506@cs.oswego.edu> Message-ID: (juggling an Occam's razor) Hi Doug, On 10.07.2013, at 23:13, Doug Lea
wrote: > This post serves as a request for comment, with shorter than usual > turnaround (a couple of days) before considering a request to > integrate into OpenJDK 8. So, please take a look. I've glanced over the paper this work is based on, and did a few quick sweeps on SR code. My first reaction is: while interesting, not entirely convincing. > Here are answers to some likely questions: > > Q: How much faster is it than java.util.Random? > > A: In sequential usages, usually at least twice as fast for long and > double methods; usually only slightly faster for int methods. In > parallel usages, SplittableRandom is almost arbitrarily faster. The > very first simple parallel Stream program I wrote (to generate and sum > nextLong()'s) ran 2900 times faster than the java.util.Random > equivalent on a 32-way machine. D'oh, of course it is ludicrously faster than j.u.Random. I am not convinced it beats TLR though, given TLR is super-optimized now in JDK 8. Are you really implying you can beat < 10 cycles? I will check that once I get back in office in about 12 hours. > Q: When can/should I use it instead of java.util.Random? > > A: Whenever you are not sharing one across Threads. Instances of > SplittableRandom are not thread-safe. They are designed to be split, > not shared, across threads. When class SplittableRandom applies (or > you can rework your program to make it apply), it is usually a better > choice. Not only is it usually faster, it also has better statistical > independence and uniformity properties. Being the same linear congruental generator with a splash of bit twisting, it does not immediately follow how's the statistical properties are better. If it is actually true, why don't we fix TLR with more robust generation scheme and gain the same properties there? Also, I am not convinced passing DieHarder on some split sequence (was it really the non-empty sequence?) extends to arbitrary splits. > > Q: When can/should I use it instead of java.util.concurrent.ThreadLocalRandom? > > A: When you are doing structured fork/join computations, so you can > explicitly split one rather than relying on the per-thread singleton > instance. And gain what vs. TLR? That the pseudo-random sequence in each subtask will be oblivious to task scheduling? This seems to be the distinguishing feature, but not really obvious from the docs. -Aleksey From joe.darcy at oracle.com Wed Jul 10 21:20:34 2013 From: joe.darcy at oracle.com (joe.darcy at oracle.com) Date: Wed, 10 Jul 2013 21:20:34 +0000 Subject: hg: jdk8/tl/jdk: 8020308: Fix doclint issues in java.lang.management Message-ID: <20130710212057.488B34897A@hg.openjdk.java.net> Changeset: 69d9fe8175a0 Author: sspitsyn Date: 2013-07-10 14:20 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/69d9fe8175a0 8020308: Fix doclint issues in java.lang.management Reviewed-by: darcy Contributed-by: serguei.spitsyn at oracle.com ! src/share/classes/java/lang/management/LockInfo.java ! src/share/classes/java/lang/management/ManagementFactory.java ! src/share/classes/java/lang/management/MemoryMXBean.java ! src/share/classes/java/lang/management/MemoryNotificationInfo.java ! src/share/classes/java/lang/management/MemoryPoolMXBean.java ! src/share/classes/java/lang/management/MemoryUsage.java ! src/share/classes/java/lang/management/MonitorInfo.java ! src/share/classes/java/lang/management/RuntimeMXBean.java ! src/share/classes/java/lang/management/ThreadInfo.java ! src/share/classes/java/lang/management/ThreadMXBean.java From henry.jen at oracle.com Wed Jul 10 21:30:09 2013 From: henry.jen at oracle.com (Henry Jen) Date: Wed, 10 Jul 2013 14:30:09 -0700 Subject: RFR: 8017513: Support for closeable streams Message-ID: <51DDD261.5050406@oracle.com> Hi, Please review webrev at http://cr.openjdk.java.net/~henryjen/ccc/8017513/0/webrev/index.html This webrev improve resource release experience on Streams by eliminating CloseableStream, instead, fold close capability into Stream. A new interface, java.util.MayHoldCloseableResource, indicates an implementation may or may not hold a resource need to be closed. Annotation {@link HoldsResource} may be used to guide users/static analysis tools that a MHCR instance that definitely hold a Closeable resource. Cheers, Henry From zhong.j.yu at gmail.com Wed Jul 10 22:17:43 2013 From: zhong.j.yu at gmail.com (Zhong Yu) Date: Wed, 10 Jul 2013 17:17:43 -0500 Subject: RFR: 8017513: Support for closeable streams In-Reply-To: <51DDD261.5050406@oracle.com> References: <51DDD261.5050406@oracle.com> Message-ID: A few things that require clarification: If we have interface A extends B, C interface B extends MayHoldCloseableResource interface C extends AutoCloseable is A considered definitely holding resource? If @HoldsResource is applied to a subtype of MayHoldCloseableResource @HoldsResource interface D extends B What does it mean? If it mean that D definitely holds resource, is @HoldResource still necessary on methods that return D? Zhong Yu On Wed, Jul 10, 2013 at 4:30 PM, Henry Jen wrote: > Hi, > > Please review webrev at > http://cr.openjdk.java.net/~henryjen/ccc/8017513/0/webrev/index.html > > This webrev improve resource release experience on Streams by > eliminating CloseableStream, instead, fold close capability into Stream. > > A new interface, java.util.MayHoldCloseableResource, indicates an > implementation may or may not hold a resource need to be closed. > Annotation {@link HoldsResource} may be used to guide users/static > analysis tools that a MHCR instance that definitely hold a Closeable > resource. > > Cheers, > Henry From dl at cs.oswego.edu Wed Jul 10 23:01:31 2013 From: dl at cs.oswego.edu (Doug Lea) Date: Wed, 10 Jul 2013 19:01:31 -0400 Subject: class SplittableRandom In-Reply-To: References: <51DDB26D.8050506@cs.oswego.edu> Message-ID: <51DDE7CB.1080606@cs.oswego.edu> On 07/10/13 16:49, Aleksey Shipilev wrote: > (juggling an Occam's razor) Thanks keep it sharp; the more skepticism the better. > > D'oh, of course it is ludicrously faster than j.u.Random. I am not convinced > it beats TLR though, given TLR is super-optimized now in JDK 8. Are you > really implying you can beat < 10 cycles? I will check that once I get back > in office in about 12 hours. Not "beats TLR". But "beats TLR in the context of parallel streams". Which it currently does, in part because of the custom Stream generator support (those ints(...), longs(...), doubles(...) methods) that allow you to express things in a more efficient way. As the primary author of TLR, and tied for the most performance-obsessed person on this list, I'm reasonably aware of its strengths and weaknesses. I'm convinced that SplittableRandom is the best shot we have of addressing the weaknesses. > Also, I am not convinced passing DieHarder on some split sequence (was it > really the non-empty sequence?) extends to arbitrary splits. It's been fully DieHarder-tested for each of the first few hundred splits. The full tech-paper write-up is still being put together, so at this point I can't link to tables etc, but I think you can rely on your common sense that people putting together an algorithm with this as its main contribution would actually test it :-) -Doug From jason.uh at oracle.com Thu Jul 11 01:01:55 2013 From: jason.uh at oracle.com (jason.uh at oracle.com) Date: Thu, 11 Jul 2013 01:01:55 +0000 Subject: hg: jdk8/tl/jdk: 8020318: Fix doclint issues in java.net Message-ID: <20130711010218.031D448981@hg.openjdk.java.net> Changeset: 702556f7977e Author: juh Date: 2013-07-10 18:01 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/702556f7977e 8020318: Fix doclint issues in java.net Reviewed-by: darcy, khazra ! src/share/classes/java/net/CookieStore.java ! src/share/classes/java/net/HttpURLPermission.java ! src/share/classes/java/net/Inet4Address.java ! src/share/classes/java/net/Inet6Address.java ! src/share/classes/java/net/InetAddress.java ! src/share/classes/java/net/ProtocolFamily.java ! src/share/classes/java/net/SocketOption.java ! src/share/classes/java/net/URI.java From stephen.flores at oracle.com Thu Jul 11 04:15:02 2013 From: stephen.flores at oracle.com (Stephen Flores) Date: Thu, 11 Jul 2013 00:15:02 -0400 Subject: 8016036: RMI specification needs to be updated to allow Activation on remote hosts Message-ID: <51DE3146.2000908@oracle.com> Bob, Sean, Please review this webrev http://cr.openjdk.java.net/~sflores/8016036/webrev.00/ for RFE/CCC: 8016036 RMI specification needs to be updated to allow Activation on remote hosts A DESCRIPTION OF THE PROBLEM: A compact2 (client profile) JRE includes java.rmi.activation.ActivationSystem but not rmid and some mobile platforms cannot run rmid, this causes a problem when running the JCK, since it and rmid assume activation requests to be from the same platform. Evaluation: To avoid creating a special RMI test server in a closed workspace, rmid should be changed allow the tester specify which remote client can access activation interface. This will allow the tester to run rmid on a server running the full JRE instead of the compact2 client. To avoid changing the JCK, the JRE should be changed so that the tester can specify what the default activation host is. Description of fix: Change rmid to allow activation requests from a remote client specified in a system property instead of the local host. Change java.rmi.activation.ActivationGroup.getSystem to use a system property for the host (with a default of empty) when looking up the activation system. Thanks, Steve. From david.holmes at oracle.com Thu Jul 11 05:07:36 2013 From: david.holmes at oracle.com (David Holmes) Date: Thu, 11 Jul 2013 15:07:36 +1000 Subject: RFR: 8019799: api/java_util/jar/Pack200 test failed with compactX profiles. (EZ) In-Reply-To: <51DC71B7.1060506@oracle.com> References: <51DC71B7.1060506@oracle.com> Message-ID: <51DE3D98.7060700@oracle.com> On 10/07/2013 6:25 AM, Kumar Srinivasan wrote: > Hi, > > We had earlier added a fail over to the java implementation, for reference: > http://hg.openjdk.java.net/jdk8/jdk8/jdk/rev/1432a6247ac9 > > The first time the unpacker is called an UnsatisfiedLinkError will be > thrown, but > subsequent invocations in the same JDK/VM instance, a NoClassDefFoundError > will be thrown. This error also needs to be caught and handled. Ugghhh. Presumably we need a test update to catch this? > Here is the modified webrev: > http://cr.openjdk.java.net/~ksrini/8019799/webrev.0/ Looks okay - but no test. It would be better/more-efficient if the presence of the native implementation could be detected once during class initialization. But I won't try to force that on you. :) Thanks, David > Thanks > Kumar > From peter.levart at gmail.com Thu Jul 11 07:36:09 2013 From: peter.levart at gmail.com (Peter Levart) Date: Thu, 11 Jul 2013 09:36:09 +0200 Subject: class SplittableRandom In-Reply-To: <51DDB26D.8050506@cs.oswego.edu> References: <51DDB26D.8050506@cs.oswego.edu> Message-ID: <51DE6069.2060308@gmail.com> Hi Doug, I confess I'm not an expert in PRNGs, but I'll try to ask a hopefully no-nonsense question anyway. SplittableRandom seems to be a kind of PR-PRNG-G - a PseudoRandom-PseudoRandomGenerator-Generator. In a sense that it's split() method returns an instance that represents a PRNG which produces numbers of a different sequence than it's parent (it has it's own distinct gamma). So not only does a child SplittableRandom instance return numbers from different part of same sequence as parent, but from a different sequence altogether. While it is not obvious from the javadocs, repeatable invocations of split() performed on the same instance, return SplittableRandom instances that represent the same PRNG (same gamma), just initialized with different seeds. Is this important to know? Regards, Peter On 07/10/2013 09:13 PM, Doug Lea wrote: > [Note: I'm also posting this on the concurrency-interest list.] > > > We expect that using random numbers in parallel Stream computations > will be common. (We know it is common in parallel computing in > general.) But we had left support for it in an unsatisfactory state. > If you want to create a stream of random numbers to drive a parallel > computation, you'd choose among two options, neither of them providing > what you probably want: (1) Use a stream based on a single shared > java.util.Random object, in which case your program will encounter > stunning slowdowns when run with many cores; or (2) Use a stream based > on ThreadLocalRandom, which avoids contention, but gives you no > control over the use or properties of the per-thread singleton Random > object. While the ThreadLocalRandom option is great for many purposes, > you wouldn't want to use it in, say, a high-quality Monte Carlo > simulation. > > Enter Guy Steele. Guy has been working on an algorithm that addresses > exactly the substantial range of uses not otherwise supported: It is, > in essence, the Random number generator analog of a Spliterator. Class > SplittableRandom supports method split() that creates a sub-generator > that when used in parallel with the original, maintains its > statistical properties. > > When Brian Goetz and I heard that this was nearing completion, we > entered drop-everything mode to explore whether it could be added now > in time for JDK8. We conclude that it should. We've been helping with > JDK-ifying the basic algorithm, integrating java.util.Stream support, > etc, to enable addition as class java.util.SplittableRandom. > > Just to be on the cautious side though, we are for the moment treating > this in the same way we treat jsr166 candidates for potential > OpenJDK integration. The initial version is available at > http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/src/main/java/util/SplittableRandom.java?view=log > > With API docs at: > http://gee.cs.oswego.edu/dl/jsr166/dist/docs/java/util/SplittableRandom.html > > > This post serves as a request for comment, with shorter than usual > turnaround (a couple of days) before considering a request to > integrate into OpenJDK 8. So, please take a look. > > Here are answers to some likely questions: > > Q: How much faster is it than java.util.Random? > > A: In sequential usages, usually at least twice as fast for long and > double methods; usually only slightly faster for int methods. In > parallel usages, SplittableRandom is almost arbitrarily faster. The > very first simple parallel Stream program I wrote (to generate and sum > nextLong()'s) ran 2900 times faster than the java.util.Random > equivalent on a 32-way machine. > > Q: When can/should I use it instead of java.util.Random? > > A: Whenever you are not sharing one across Threads. Instances of > SplittableRandom are not thread-safe. They are designed to be split, > not shared, across threads. When class SplittableRandom applies (or > you can rework your program to make it apply), it is usually a better > choice. Not only is it usually faster, it also has better statistical > independence and uniformity properties. > > Q: When can/should I use it instead of > java.util.concurrent.ThreadLocalRandom? > > A: When you are doing structured fork/join computations, so you can > explicitly split one rather than relying on the per-thread singleton > instance. > > Q: Why is this in java.util, not java.util.concurrent? > > A: Because, like java.util.Spliterator, SplittableRandom is a tool for > arranging isolated parallel computations that don't entail any > concurrency control themselves. > > Q: Why isn't SplittableRandom a subclass of Random? > > A: Class Random requires thread-safety in its spec. It would be > nonsensical for SplittableRandom to comply. > > Q: Why don't you at least come up with a new interface that > defines methods shared with java.util.Random? > > A: We spent a couple of days exploring this. We think it could and > probably should be done, but not now. Method names and specs of > SplittableRandom are chosen to make it possible. But we encountered > enough short-term obstacles to conclude that this is an unwise move > for JDK8. Among the issues are that we'd need to adjust some specs and > possibly some code in java.util.Random, and that we are at a loss > about whether or how to generalize SplittableRandom's added Stream > methods. In the mean time, it would be more than acceptable for > SplittableRandom to be used primarily in new code (or new adaptions of > old code) that wouldn't need or want to be interoperable with code > using java.util.Random. > > Q: Are we going to revisit with SplittableRandom all those memory > contention issues we saw with ThreadLocalRandom? > > A: Most likely not. Most of the memory contention issues surrounding > ThreadLocalRandom arise because they are long-lived. SplittableRandoms > will tend to be short-lived. In any case, now that we have the tools > to cope (@Contended), we can evaluate and adjust if more detailed > empirical analysis warrants. > From fweimer at redhat.com Thu Jul 11 08:13:45 2013 From: fweimer at redhat.com (Florian Weimer) Date: Thu, 11 Jul 2013 10:13:45 +0200 Subject: RFR: 8017513: Support for closeable streams In-Reply-To: <51DDD261.5050406@oracle.com> References: <51DDD261.5050406@oracle.com> Message-ID: <51DE6939.40202@redhat.com> On 07/10/2013 11:30 PM, Henry Jen wrote: > A new interface, java.util.MayHoldCloseableResource, indicates an > implementation may or may not hold a resource need to be closed. Why doesn't close() throw Exception? > Annotation {@link HoldsResource} may be used to guide users/static > analysis tools that a MHCR instance that definitely hold a Closeable > resource. All this looks a bit odd to me. I suppose the idea is that you don't want to give up the last reference to a closeable resource without calling close()?and not leak references which out-live the call to close(). This is definitely not a property of the type of the resource, so I don't see why the MayHoldCloseableResource interface is needed (or can confer relevant information). The HoldsResource annotation could be useful, but based on the current documentation, it's not clear if it is actually intended to express the data flow property. -- Florian Weimer / Red Hat Product Security Team From blackdrag at gmx.org Thu Jul 11 08:21:30 2013 From: blackdrag at gmx.org (Jochen Theodorou) Date: Thu, 11 Jul 2013 10:21:30 +0200 Subject: problems with sun.reflect.Reflection.getCallerClass(int) Message-ID: <51DE6B0A.1010207@gmx.org> Hi all, I started a thread about this already on the mlvm list, but since I get no responses there I am going to ask here as well. Plus I have an actual problem with openjdk 7u25 related to this it seems. First the u25 problem. According to https://jira.codehaus.org/browse/GROOVY-6246 openjdk 1.7.0_25 freezes with 100% CPU load in this code: https://github.com/groovy/groovy-core/blob/master/src/main/org/codehaus/groovy/reflection/ReflectionUtils.java#L105 This is surely not the nicest piece of code and all that, but that is not the point. The point is that this worked in openjdk 1.7.0_9 and does not in openjdk 1.7.0_25. Where it does work is in the oracle jdk 1.7.0_25. Btw: it is too bad there are no .tar.gz packages of the openjdk builds available. Assuming the diagnosis is right, this should help pinpointing the problem. Has there been any changes already to that method? Of course Reflection.getCallerClass(int) is a bigger problem for us. It was announced, that in u40 of jdk 1.7.0 this method will be no longer operational, unless you use a jvm switch. This is quite troublesome for us, but at least there is some way. In jdk 1.8 this method is supposed to disappear without replacement. There seems then to be the getCallerClass() method, which ignores frames from reflection (I strongly hope for you guys that lambda and indy are included here), but this will not rescue us at all. We have almost always a frame of our own appearing in a "first call" in Groovy. And there is no way to avoid that (not even in indy). That means for us, that any functionality depending on this cannot be called from a Groovy program anymore. We already replace RessourceBundle.getBundle(String) to let it discover the right loader. But after the change this will not help. Transporting the not always available caller class from the callsite into the method is for current versions of Groovy (and all versions of Groovy are influenced here) We are currently investigating if we can find a workaround for @Grab (http://groovy.codehaus.org/Grape) in some cases. There won't be one for all cases of course. What I would like to hear is a statement if this is taken as serious or if it will be ignored. From the mlvm list I have so far the impression, that it will be ignored. bye Jochen -- Jochen "blackdrag" Theodorou - Groovy Project Tech Lead blog: http://blackdragsview.blogspot.com/ german groovy discussion newsgroup: de.comp.lang.misc For Groovy programming sources visit http://groovy-lang.org From jaroslav.bachorik at oracle.com Thu Jul 11 08:31:18 2013 From: jaroslav.bachorik at oracle.com (jaroslav.bachorik at oracle.com) Date: Thu, 11 Jul 2013 08:31:18 +0000 Subject: hg: jdk8/tl/jdk: 8019826: Test com/sun/management/HotSpotDiagnosticMXBean/SetVMOption.java fails with NPE Message-ID: <20130711083140.7F3214898B@hg.openjdk.java.net> Changeset: a46982a212e0 Author: jbachorik Date: 2013-07-11 09:21 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/a46982a212e0 8019826: Test com/sun/management/HotSpotDiagnosticMXBean/SetVMOption.java fails with NPE Reviewed-by: sjiang, dholmes, mchung ! test/com/sun/management/HotSpotDiagnosticMXBean/SetVMOption.java From mandy.chung at oracle.com Thu Jul 11 08:42:56 2013 From: mandy.chung at oracle.com (Mandy Chung) Date: Thu, 11 Jul 2013 16:42:56 +0800 Subject: problems with sun.reflect.Reflection.getCallerClass(int) In-Reply-To: <51DE6B0A.1010207@gmx.org> References: <51DE6B0A.1010207@gmx.org> Message-ID: <51DE7010.3010909@oracle.com> Hi Jochen, On 7/11/2013 4:21 PM, Jochen Theodorou wrote: > Hi all, > > I started a thread about this already on the mlvm list, but since I > get no responses there I am going to ask here as well. Plus I have an > actual problem with openjdk 7u25 related to this it seems. > > First the u25 problem. According to > https://jira.codehaus.org/browse/GROOVY-6246 openjdk 1.7.0_25 freezes > with 100% CPU load in this code: > https://github.com/groovy/groovy-core/blob/master/src/main/org/codehaus/groovy/reflection/ReflectionUtils.java#L105 > > This is surely not the nicest piece of code and all that, but that is > not the point. The point is that this worked in openjdk 1.7.0_9 and > does not in openjdk 1.7.0_25. Where it does work is in the oracle jdk > 1.7.0_25. Btw: it is too bad there are no .tar.gz packages of the > openjdk builds available. Assuming the diagnosis is right, this should > help pinpointing the problem. Has there been any changes already to > that method? > There is a regression in 7u25 that is fixed in 7u40: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8016814 The workaround is to call it with depth+1 when running in 7u25. I will reply the second part next (currently OOTO). Mandy > Of course Reflection.getCallerClass(int) is a bigger problem for us. > It was announced, that in u40 of jdk 1.7.0 this method will be no > longer operational, unless you use a jvm switch. This is quite > troublesome for us, but at least there is some way. In jdk 1.8 this > method is supposed to disappear without replacement. There seems then > to be the getCallerClass() method, which ignores frames from > reflection (I strongly hope for you guys that lambda and indy are > included here), but this will not rescue us at all. We have almost > always a frame of our own appearing in a "first call" in Groovy. And > there is no way to avoid that (not even in indy). That means for us, > that any functionality depending on this cannot be called from a > Groovy program anymore. We already replace > RessourceBundle.getBundle(String) to let it discover the right loader. > But after the change this will not help. Transporting the not always > available caller class from the callsite into the method is for > current versions of Groovy (and all versions of Groovy are influenced > here) > > We are currently investigating if we can find a workaround for @Grab > (http://groovy.codehaus.org/Grape) in some cases. There won't be one > for all cases of course. > > What I would like to hear is a statement if this is taken as serious > or if it will be ignored. From the mlvm list I have so far the > impression, that it will be ignored. > > > bye Jochen > From alexey.utkin at oracle.com Thu Jul 11 09:03:13 2013 From: alexey.utkin at oracle.com (Alexey Utkin) Date: Thu, 11 Jul 2013 13:03:13 +0400 Subject: Review request: JDK-7147084 (process) appA hangs when read output stream of appB which starts appC that runs forever (v.1) In-Reply-To: <51D6D139.40508@oracle.com> References: <518A88B1.3060105@oracle.com> <5190FC54.8050808@oracle.com> <5194B0D8.2040607@oracle.com> <51D685E1.1080606@oracle.com> <51D6D139.40508@oracle.com> Message-ID: <51DE74D1.70607@oracle.com> Rob, Could you help me with bug review. It stay in review pool too long. Nobody like to look into the native code. Here is the long problem & solution description: https://jbs.oracle.com/bugs/browse/JDK-7147084?focusedCommentId=13322689&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13322689 Discussion thread: http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-May/016753.html Bug description: https://jbs.oracle.com/bugs/browse/JDK-7147084 http://bugs.sun.com/view_bug.do?bug_id=7147084 Here is the suggested fix: http://cr.openjdk.java.net/~uta/openjdk-webrevs/JDK-7147084/webrev.01/ Summary for v1 changes: -- The set of handles that need to restore the inherit flag was extended by child process IOE handles. That was done to avoid "greedy sibling" problem for the file handles. The file handles are closed outside the synchronized block. -- "Greedy sibling" problem is covered by the [test/java/lang/ProcessBuilder/SiblingIOEHandle.java] test. -- The fact that the set of current process standard IOE handles and the set of child process IOE handles can intersect was taken into account. -- The [test/java/lang/ProcessBuilder/InheritIOEHandle.java] was changed in accordance with Martin's concern. Regards, -uta On 7/5/2013 5:59 PM, Alan Bateman wrote: > On 05/07/2013 09:37, Alexey Utkin wrote: >> Hi Alan, >> >> I know that your stack is overflowed, >> that is just ping. >> >> Regards, >> -uta > Sorry Alexey, I just have not had time to fully digest this one and > understand the performance/correctness trade-off. Also I've been > desperately trying to get through a list of things before going on > vacation this week (for 2 weeks). > > Rob - since you are interested in ProcessBuilder and Runtime.exec then > could you take a pass over Alexey's change on core-libs-dev. This one > fixes a long standing issue on Windows. I will get make time to help > review when I get back. > > -Alan > From dl at cs.oswego.edu Thu Jul 11 10:29:07 2013 From: dl at cs.oswego.edu (Doug Lea) Date: Thu, 11 Jul 2013 06:29:07 -0400 Subject: CompletableFuture updates and CompletionStage Message-ID: <51DE88F3.6030208@cs.oswego.edu> Last fall, when putting together class CompletableFuture, and when many issues surrounding lambdas and Streams were still up in the air, we postponed dealing with the question of how to extract out an interface that would support usages by those who need the fluent completion-style capabilities, but under different policies or mechanisms that cannot otherwise be captured using a single class. The lack of an interface was a serious problem because the variation among policies and methods beyond the base fluent methods is so wide and conflicting that some potential users wrote off CompletableFuture as unusable -- some need method X, some cannot allow that same method X, for X dealing with cancellation, blocking, overwrites, etc. We finally last week settled this in an acceptable and simple way, introducing interface CompletionStage, that is nearly just a subset of existing CompletableFuture methods, and adjusting CompletableFuture accordingly, in a way that provides a recipe for creating interoperable CompletionStage implementations that may differ wrt those methods not in the CompletionStage interface. The adjustments are small but still officially require CCC approval. We had to introduce a method form ("whenComplete") to deal with exceptional completions that otherwise required use of CompletableFuture-dependent methods. Plus a couple of utilities and some spec rewordings, and an overhaul of CompletableFuture class-level documentation to now reference CompletionStage. After expert-group and concurrency-interest discussions, no one disagrees that this is an improvement. Some people have lingering disagreements about those policy issues, but are more content that there is now a straightforward way of obtaining the ones they want. The updates have also been in lambda repo (although probably not used much) for about a week. Paul Sandoz has volunteered to coordinate the CCC and webrev and will post the details. (Thanks Paul for adding this to your already overcomitted workload!) -Doug From paul.sandoz at oracle.com Thu Jul 11 11:20:31 2013 From: paul.sandoz at oracle.com (paul.sandoz at oracle.com) Date: Thu, 11 Jul 2013 11:20:31 +0000 Subject: hg: jdk8/tl/jdk: 8019484: Sync j.u.c.ConcurrentHashMap from 166 to tl Message-ID: <20130711112056.05A2248993@hg.openjdk.java.net> Changeset: 05b164788aab Author: psandoz Date: 2013-07-11 13:07 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/05b164788aab 8019484: Sync j.u.c.ConcurrentHashMap from 166 to tl Reviewed-by: martin Contributed-by: Doug Lea
! src/share/classes/java/util/concurrent/ConcurrentHashMap.java ! src/share/classes/java/util/concurrent/ConcurrentMap.java ! src/share/classes/java/util/concurrent/ConcurrentNavigableMap.java From paul.sandoz at oracle.com Thu Jul 11 11:51:27 2013 From: paul.sandoz at oracle.com (Paul Sandoz) Date: Thu, 11 Jul 2013 13:51:27 +0200 Subject: RFR 8020921 Re: CompletableFuture updates and CompletionStage In-Reply-To: <51DE88F3.6030208@cs.oswego.edu> References: <51DE88F3.6030208@cs.oswego.edu> Message-ID: Hi, Doug's explanation provides an excellent hook to hang the RFR off: http://cr.openjdk.java.net/~psandoz/tl/JDK-8020291-completion-stage/specdiff/overview-summary.html http://cr.openjdk.java.net/~psandoz/tl/JDK-8020291-completion-stage/webrev/ Paul. On Jul 11, 2013, at 12:29 PM, Doug Lea
wrote: > > Last fall, when putting together class CompletableFuture, and when > many issues surrounding lambdas and Streams were still up in the air, > we postponed dealing with the question of how to extract out an > interface that would support usages by those who need the fluent > completion-style capabilities, but under different policies or > mechanisms that cannot otherwise be captured using a single class. The > lack of an interface was a serious problem because the variation among > policies and methods beyond the base fluent methods is so wide and > conflicting that some potential users wrote off CompletableFuture as > unusable -- some need method X, some cannot allow that same method X, > for X dealing with cancellation, blocking, overwrites, etc. > > We finally last week settled this in an acceptable and simple way, > introducing interface CompletionStage, that is nearly just a subset of > existing CompletableFuture methods, and adjusting CompletableFuture > accordingly, in a way that provides a recipe for creating > interoperable CompletionStage implementations that may differ wrt > those methods not in the CompletionStage interface. The adjustments > are small but still officially require CCC approval. We had to > introduce a method form ("whenComplete") to deal with exceptional > completions that otherwise required use of CompletableFuture-dependent > methods. Plus a couple of utilities and some spec rewordings, and an > overhaul of CompletableFuture class-level documentation to now > reference CompletionStage. > > After expert-group and concurrency-interest discussions, no one > disagrees that this is an improvement. Some people have lingering > disagreements about those policy issues, but are more content that > there is now a straightforward way of obtaining the ones they want. > > The updates have also been in lambda repo (although probably not used > much) for about a week. > > Paul Sandoz has volunteered to coordinate the CCC and webrev > and will post the details. (Thanks Paul for adding this > to your already overcomitted workload!) > > -Doug > > From sundararajan.athijegannathan at oracle.com Thu Jul 11 12:13:31 2013 From: sundararajan.athijegannathan at oracle.com (A. Sundararajan) Date: Thu, 11 Jul 2013 17:43:31 +0530 Subject: Review request for 7187144: JavaDoc for ScriptEngineFactory.getProgram() contains an error Message-ID: <51DEA16B.4040002@oracle.com> Bug: http://bugs.sun.com/view_bug.do?bug_id=7187144 Please review http://cr.openjdk.java.net/~sundar/7187144/ Thanks -Sundar From dl at cs.oswego.edu Thu Jul 11 12:16:48 2013 From: dl at cs.oswego.edu (Doug Lea) Date: Thu, 11 Jul 2013 08:16:48 -0400 Subject: class SplittableRandom In-Reply-To: <51DE6069.2060308@gmail.com> References: <51DDB26D.8050506@cs.oswego.edu> <51DE6069.2060308@gmail.com> Message-ID: <51DEA230.2060504@cs.oswego.edu> On 07/11/13 03:36, Peter Levart wrote: > Hi Doug, > > I confess I'm not an expert in PRNGs, but I'll try to ask a hopefully > no-nonsense question anyway. SplittableRandom seems to be a kind of PR-PRNG-G - > a PseudoRandom-PseudoRandomGenerator-Generator. In a sense that it's split() > method returns an instance that represents a PRNG which produces numbers of a > different sequence than it's parent (it has it's own distinct gamma). So not > only does a child SplittableRandom instance return numbers from different part > of same sequence as parent, but from a different sequence altogether. > > While it is not obvious from the javadocs, repeatable invocations of split() > performed on the same instance, return SplittableRandom instances that represent > the same PRNG (same gamma), just initialized with different seeds. Is this > important to know? > I don't think it's important to know the mechanics as a user of the class. In fact uses aren't even *allowed* to know them -- we are careful in the API specs not to promise anything except good statistical RNG properties. But your description is mostly accurate: Each instance seeds its split-off instances. The main algorithmic challenge is to find a version of this scheme that has good RNG properties -- both analytically good, and empirically good via DieHarder tests. SplittableRandom's algorithm does, and is simpler and faster than any others we know of. While I'm at it, here are a few follow-ups about SplittableRandom vs ThreadLocalRandom. There's no simple "one is better than the other" argument. They differ in multiple ways: * SplittableRandom has better statistical properties. Among them: The base algorithm in java.util.Random, shared by ThreadLocalRandom (as well as similar versions used in C "rand48" and elswehere) is known to have some weaknesses (it does not pass DieHarder). In particular, lower bits of consecutive values are less independent than higher bits. (I've been contemplating re-exploring alternatives in TLR, but the options are more limited because it is a subclass of Random. Which made sense at the time I did it, but ...) * Ignoring memory contention etc, ThreadLocalRandom is generally faster for nextInt, but slower for long and double methods. * SplittableRandom applies nicely in "structured parallelism" contexts (for/join, spliterators, etc). ThreadLocalRandom applies nicely in most unstructured-async contexts. * The two classes take different approaches to the memory-effects issues that haunt us core-parallel/concurrent component developers. ThreadLocalRandom keeps the state with the thread, which, after lots of help from Aleksey, works great. SplittableRandom keeps the state with the computation, which (we hope/predict) also works great. But neither is always best. Also, a note to those testing either or both: Especially if you are running on a multisocket-multicore, be sure to use either -XX:+UseCondCardMark or -XX:+UseG1GC. Otherwise the memory contention byproducts of garbage collector bookkeeping are likely to overwhelm other memory effects. -Doug From aleksey.shipilev at oracle.com Thu Jul 11 12:23:49 2013 From: aleksey.shipilev at oracle.com (Aleksey Shipilev) Date: Thu, 11 Jul 2013 16:23:49 +0400 Subject: class SplittableRandom In-Reply-To: <51DEA230.2060504@cs.oswego.edu> References: <51DDB26D.8050506@cs.oswego.edu> <51DE6069.2060308@gmail.com> <51DEA230.2060504@cs.oswego.edu> Message-ID: <51DEA3D5.5000509@oracle.com> (I've been distracted by other high priority stuff, and only starting to explore SR, sorry for dumb questions below) On 07/11/2013 04:16 PM, Doug Lea wrote: > (I've been contemplating re-exploring alternatives in TLR, > but the options are more limited because it is a subclass > of Random. Which made sense at the time I did it, but ...) What exactly limits us to adopt the PRNG from SR into TLR, thus gaining the same good statistical properties? Does extending Random actually forces us to match the PRNG j.u.Random has? It does not seem likely if we don't control the seed for TLR anyway. -Aleksey. From james.laskey at oracle.com Thu Jul 11 12:26:25 2013 From: james.laskey at oracle.com (Jim Laskey (Oracle)) Date: Thu, 11 Jul 2013 09:26:25 -0300 Subject: Review request for 7187144: JavaDoc for ScriptEngineFactory.getProgram() contains an error In-Reply-To: <51DEA16B.4040002@oracle.com> References: <51DEA16B.4040002@oracle.com> Message-ID: <755D78F3-0A06-4BE7-998A-A3F519C4EE01@oracle.com> +1 On 2013-07-11, at 9:13 AM, A. Sundararajan wrote: > Bug: http://bugs.sun.com/view_bug.do?bug_id=7187144 > > Please review http://cr.openjdk.java.net/~sundar/7187144/ > > Thanks > -Sundar From maurizio.cimadamore at oracle.com Thu Jul 11 12:57:23 2013 From: maurizio.cimadamore at oracle.com (Maurizio Cimadamore) Date: Thu, 11 Jul 2013 13:57:23 +0100 Subject: Review request for 7187144: JavaDoc for ScriptEngineFactory.getProgram() contains an error In-Reply-To: <755D78F3-0A06-4BE7-998A-A3F519C4EE01@oracle.com> References: <51DEA16B.4040002@oracle.com> <755D78F3-0A06-4BE7-998A-A3F519C4EE01@oracle.com> Message-ID: <51DEABB3.3060803@oracle.com> On 11/07/13 13:26, Jim Laskey (Oracle) wrote: > +1 > > On 2013-07-11, at 9:13 AM, A. Sundararajan wrote: > >> Bug: http://bugs.sun.com/view_bug.do?bug_id=7187144 >> >> Please review http://cr.openjdk.java.net/~sundar/7187144/ >> >> Thanks >> -Sundar Looks good Maurizio From sundararajan.athijegannathan at oracle.com Thu Jul 11 13:21:13 2013 From: sundararajan.athijegannathan at oracle.com (sundararajan.athijegannathan at oracle.com) Date: Thu, 11 Jul 2013 13:21:13 +0000 Subject: hg: jdk8/tl/jdk: 7187144: JavaDoc for ScriptEngineFactory.getProgram() contains an error Message-ID: <20130711132141.246B8489A8@hg.openjdk.java.net> Changeset: dadcfd84d33f Author: sundar Date: 2013-07-11 18:50 +0530 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/dadcfd84d33f 7187144: JavaDoc for ScriptEngineFactory.getProgram() contains an error Reviewed-by: mcimadamore, jlaskey, hannesw, attila ! src/share/classes/javax/script/ScriptEngineFactory.java From kumar.x.srinivasan at oracle.com Thu Jul 11 14:11:35 2013 From: kumar.x.srinivasan at oracle.com (Kumar Srinivasan) Date: Thu, 11 Jul 2013 07:11:35 -0700 Subject: RFR: 8019799: api/java_util/jar/Pack200 test failed with compactX profiles. (EZ) In-Reply-To: <51DE3D98.7060700@oracle.com> References: <51DC71B7.1060506@oracle.com> <51DE3D98.7060700@oracle.com> Message-ID: <51DEBD17.3020005@oracle.com> Hi David, thanks for reviewing this! > On 10/07/2013 6:25 AM, Kumar Srinivasan wrote: >> Hi, >> >> We had earlier added a fail over to the java implementation, for >> reference: >> http://hg.openjdk.java.net/jdk8/jdk8/jdk/rev/1432a6247ac9 >> >> The first time the unpacker is called an UnsatisfiedLinkError will be >> thrown, but >> subsequent invocations in the same JDK/VM instance, a >> NoClassDefFoundError >> will be thrown. This error also needs to be caught and handled. > > Ugghhh. Presumably we need a test update to catch this? Yes it is tedious to create this test, the test needs to make a copy of the JDK under test and modify it to remove the libunpack.so and call unpack repeatedly. But since we already have a JCK test, I marked the bug "noreg-jck" since the jck test catches this scenario. > >> Here is the modified webrev: >> http://cr.openjdk.java.net/~ksrini/8019799/webrev.0/ > > Looks okay - but no test. > > It would be better/more-efficient if the presence of the native > implementation could be detected once during class initialization. But > I won't try to force that on you. :) that is what I started with initially, later Bob and I agreed that testing for libunpack.so will need to be performed by SE always, where libunpack.so is sure to exist. Thanks Kumar > > Thanks, > David > >> Thanks >> Kumar >> From maurizio.cimadamore at oracle.com Thu Jul 11 14:37:38 2013 From: maurizio.cimadamore at oracle.com (maurizio.cimadamore at oracle.com) Date: Thu, 11 Jul 2013 14:37:38 +0000 Subject: hg: jdk8/tl/langtools: 8013404: Unclear spec for target typing with conditional operator (?:) Message-ID: <20130711143747.6555B489AC@hg.openjdk.java.net> Changeset: 87a951c88a33 Author: mcimadamore Date: 2013-07-11 15:37 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/87a951c88a33 8013404: Unclear spec for target typing with conditional operator (?:) Summary: Fix previously ignored test Reviewed-by: jjg, vromero ! test/tools/javac/lambda/TargetType36.java + test/tools/javac/lambda/TargetType36.out From forax at univ-mlv.fr Thu Jul 11 15:11:58 2013 From: forax at univ-mlv.fr (Remi Forax) Date: Thu, 11 Jul 2013 17:11:58 +0200 Subject: hg: jdk8/tl/langtools: 8013404: Unclear spec for target typing with conditional operator (?:) In-Reply-To: <20130711143747.6555B489AC@hg.openjdk.java.net> References: <20130711143747.6555B489AC@hg.openjdk.java.net> Message-ID: <51DECB3E.8010700@univ-mlv.fr> On 07/11/2013 04:37 PM, maurizio.cimadamore at oracle.com wrote: > Changeset: 87a951c88a33 > Author: mcimadamore > Date: 2013-07-11 15:37 +0100 > URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/87a951c88a33 > > 8013404: Unclear spec for target typing with conditional operator (?:) > Summary: Fix previously ignored test > Reviewed-by: jjg, vromero > > ! test/tools/javac/lambda/TargetType36.java > + test/tools/javac/lambda/TargetType36.out > may I ask why ? R?mi From maurizio.cimadamore at oracle.com Thu Jul 11 15:45:34 2013 From: maurizio.cimadamore at oracle.com (Maurizio Cimadamore) Date: Thu, 11 Jul 2013 16:45:34 +0100 Subject: hg: jdk8/tl/langtools: 8013404: Unclear spec for target typing with conditional operator (?:) In-Reply-To: <51DECB3E.8010700@univ-mlv.fr> References: <20130711143747.6555B489AC@hg.openjdk.java.net> <51DECB3E.8010700@univ-mlv.fr> Message-ID: <51DED31E.8020108@oracle.com> On 11/07/13 16:11, Remi Forax wrote: > On 07/11/2013 04:37 PM, maurizio.cimadamore at oracle.com wrote: >> Changeset: 87a951c88a33 >> Author: mcimadamore >> Date: 2013-07-11 15:37 +0100 >> URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/87a951c88a33 >> >> 8013404: Unclear spec for target typing with conditional operator (?:) >> Summary: Fix previously ignored test >> Reviewed-by: jjg, vromero >> >> ! test/tools/javac/lambda/TargetType36.java >> + test/tools/javac/lambda/TargetType36.out >> > > may I ask why ? > > R?mi > Why what? :-) Maurizio From forax at univ-mlv.fr Thu Jul 11 16:17:20 2013 From: forax at univ-mlv.fr (Remi Forax) Date: Thu, 11 Jul 2013 18:17:20 +0200 Subject: hg: jdk8/tl/langtools: 8013404: Unclear spec for target typing with conditional operator (?:) In-Reply-To: <51DED31E.8020108@oracle.com> References: <20130711143747.6555B489AC@hg.openjdk.java.net> <51DECB3E.8010700@univ-mlv.fr> <51DED31E.8020108@oracle.com> Message-ID: <51DEDA90.5010607@univ-mlv.fr> On 07/11/2013 05:45 PM, Maurizio Cimadamore wrote: > On 11/07/13 16:11, Remi Forax wrote: >> On 07/11/2013 04:37 PM, maurizio.cimadamore at oracle.com wrote: >>> Changeset: 87a951c88a33 >>> Author: mcimadamore >>> Date: 2013-07-11 15:37 +0100 >>> URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/87a951c88a33 >>> >>> 8013404: Unclear spec for target typing with conditional operator (?:) >>> Summary: Fix previously ignored test >>> Reviewed-by: jjg, vromero >>> >>> ! test/tools/javac/lambda/TargetType36.java >>> + test/tools/javac/lambda/TargetType36.out >>> >> >> may I ask why ? >> >> R?mi >> > Why what? :-) > > Maurizio Why the target typing in ?: has a special case for casting ? R?mi From valerie.peng at oracle.com Thu Jul 11 18:44:10 2013 From: valerie.peng at oracle.com (valerie.peng at oracle.com) Date: Thu, 11 Jul 2013 18:44:10 +0000 Subject: hg: jdk8/tl/jdk: 8020321: Problem in PKCS11 regression test TestRSAKeyLength Message-ID: <20130711184439.929B2489D1@hg.openjdk.java.net> Changeset: 162c015c434a Author: valeriep Date: 2013-07-11 11:43 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/162c015c434a 8020321: Problem in PKCS11 regression test TestRSAKeyLength Summary: Corrected the "isValidKeyLength" array Reviewed-by: xuelei ! test/sun/security/pkcs11/Signature/TestRSAKeyLength.java From henry.jen at oracle.com Thu Jul 11 19:37:41 2013 From: henry.jen at oracle.com (Henry Jen) Date: Thu, 11 Jul 2013 12:37:41 -0700 Subject: RFR: 8017513: Support for closeable streams In-Reply-To: References: <51DDD261.5050406@oracle.com> Message-ID: <51DF0985.4080708@oracle.com> On 07/10/2013 03:17 PM, Zhong Yu wrote: > A few things that require clarification: > > If we have > > interface A extends B, C > interface B extends MayHoldCloseableResource > interface C extends AutoCloseable > > is A considered definitely holding resource? Not programatically. A is both, from MHCR perspective, it's not without the annotation. > > If @HoldsResource is applied to a subtype of MayHoldCloseableResource > > @HoldsResource > interface D extends B > > What does it mean? > I would think that means instances of D holds resource. > If it mean that D definitely holds resource, is @HoldResource still > necessary on methods that return D? Not necessary. Cheers, Henry From jeffhain at rocketmail.com Thu Jul 11 19:50:12 2013 From: jeffhain at rocketmail.com (Jeff Hain) Date: Thu, 11 Jul 2013 20:50:12 +0100 (BST) Subject: class SplittableRandom In-Reply-To: <51DDB26D.8050506@cs.oswego.edu> References: <51DDB26D.8050506@cs.oswego.edu> Message-ID: <1373572212.76309.YahooMailNeo@web171701.mail.ir2.yahoo.com> Hello. 1) extending Random Doug Lea wrote: >Q: Why isn't SplittableRandom a subclass of Random? >A: Class Random requires thread-safety in its spec. It would be >nonsensical for SplittableRandom to comply. Random Javadoc states "Instances of java.util.Random are threadsafe." but ThreadLocalRandom extends Random and is not, so why not consider that the thread-safety statement only applies to Random.class, and not to Random subclasses? 2) third alternative Doug Lea wrote: >If you want to create a stream of random numbers to drive a parallel >computation, you'd choose among two options, neither of them providing >what you probably want: (1) Use a stream based on a single shared >java.util.Random object, in which case your program will encounter >stunning slowdowns when run with many cores; or (2) Use a stream based >on ThreadLocalRandom, What I would have used (maybe because I'm not an expert!) is something like this: ??? new Subtask(new MySequentialRandom(currentTaskRandom.nextLong())).fork() with nextLong() returning something else than current seed of course, to avoid ending up with the same sequence of pseudo-random numbers. In what way would ??? new Subtask(aSplittableRandom.split()).fork() be better than that? The Javadoc for split() says that the values of the returned object should have the same (i.e. as good?) statistical properties, but wouldn't it also be the case with a good non-thread-safe Random, like based on MersenneTwister, which could be seeded with multiple longs? 3) nextDouble() With this method: ??? public double nextDouble() { ??????? long bits = (1023L << 52) | (nextLong() >>> 12); ??????? return Double.longBitsToDouble(bits) - 1.0; ??? } the returned value granularity is only 1/2^52, i.e. last mantissa bit is always zero. For example the highest value you can return is 1.9999999999999998 - 1.0 i.e. 0.9999999999999998 and so 0.9999999999999999 is never returned. One could use that instead, which doesn't have that problem, and provides values in [0,1-1/2^53], with 1/2^53 granularity: ??? public double nextDouble() { ??????? return (this.nextLong() & ((1L<<53)-1)) * (1.0/(1L<<53)); ??? } but it can be a bit slower (maybe due to cast of huge longs into double being slow on some architectures). If needing speed over accuracy, one can replace nextLong() with nextInt(), mask with Integer.MAX_VALUE, and 53 with 31. 4) nextGaussian() Currently there is no nextGaussian(): if added, would it use Random/TLR's algorithm, or some variation of the Ziggurat method (which can be about four times faster)? -Jeff From henry.jen at oracle.com Thu Jul 11 20:01:01 2013 From: henry.jen at oracle.com (Henry Jen) Date: Thu, 11 Jul 2013 13:01:01 -0700 Subject: RFR: 8017513: Support for closeable streams In-Reply-To: <51DE6939.40202@redhat.com> References: <51DDD261.5050406@oracle.com> <51DE6939.40202@redhat.com> Message-ID: <51DF0EFD.605@oracle.com> On 07/11/2013 01:13 AM, Florian Weimer wrote: > On 07/10/2013 11:30 PM, Henry Jen wrote: > >> A new interface, java.util.MayHoldCloseableResource, indicates an >> implementation may or may not hold a resource need to be closed. > > Why doesn't close() throw Exception? Because there is really much a developer can do on that situation. The API simply make it not throw a *checked* exception. See EG discussion on this topic, http://mail.openjdk.java.net/pipermail/lambda-libs-spec-experts/2013-June/002081.html > >> Annotation {@link HoldsResource} may be used to guide users/static >> analysis tools that a MHCR instance that definitely hold a Closeable >> resource. > > All this looks a bit odd to me. I suppose the idea is that you don't > want to give up the last reference to a closeable resource without > calling close()?and not leak references which out-live the call to > close(). This is definitely not a property of the type of the resource, > so I don't see why the MayHoldCloseableResource interface is needed (or > can confer relevant information). The HoldsResource annotation could be > useful, but based on the current documentation, it's not clear if it is > actually intended to express the data flow property. > I would suggest you look at EG discussion on this topic. The MHCR is different from AutoCloseable on the chances of holding critical resources. Perhaps that suggests the javadoc is not clear enough, I would like to know what is important and missing. Cheers, Henry From jaroslav.bachorik at oracle.com Thu Jul 11 20:02:00 2013 From: jaroslav.bachorik at oracle.com (jaroslav.bachorik at oracle.com) Date: Thu, 11 Jul 2013 20:02:00 +0000 Subject: hg: jdk8/tl/jdk: 8010285: Enforce the requirement of Management Interfaces being public Message-ID: <20130711200242.7F884489E6@hg.openjdk.java.net> Changeset: f3211af79339 Author: jbachorik Date: 2013-07-11 21:11 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/f3211af79339 8010285: Enforce the requirement of Management Interfaces being public Reviewed-by: sjiang, dfuchs, mchung ! src/share/classes/com/sun/jmx/mbeanserver/Introspector.java ! src/share/classes/com/sun/jmx/mbeanserver/MBeanAnalyzer.java ! src/share/classes/javax/management/JMX.java ! src/share/classes/javax/management/MBeanServerInvocationHandler.java ! src/share/classes/javax/management/MXBean.java ! src/share/classes/javax/management/package.html ! src/share/classes/sun/management/ManagementFactoryHelper.java + test/javax/management/MBeanServer/MBeanFallbackTest.java + test/javax/management/MBeanServer/MBeanTest.java + test/javax/management/mxbean/MXBeanFallbackTest.java ! test/javax/management/mxbean/MXBeanTest.java + test/javax/management/proxy/JMXProxyFallbackTest.java + test/javax/management/proxy/JMXProxyTest.java From kumar.x.srinivasan at oracle.com Thu Jul 11 20:05:09 2013 From: kumar.x.srinivasan at oracle.com (kumar.x.srinivasan at oracle.com) Date: Thu, 11 Jul 2013 20:05:09 +0000 Subject: hg: jdk8/tl/jdk: 8019799: api/java_util/jar/Pack200 test failed with compactX profiles. Message-ID: <20130711200529.BA5C5489E7@hg.openjdk.java.net> Changeset: 0bd48087e2dc Author: ksrini Date: 2013-07-11 11:14 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/0bd48087e2dc 8019799: api/java_util/jar/Pack200 test failed with compactX profiles. Reviewed-by: dholmes ! src/share/classes/com/sun/java/util/jar/pack/UnpackerImpl.java From pbenedict at apache.org Thu Jul 11 20:22:44 2013 From: pbenedict at apache.org (Paul Benedict) Date: Thu, 11 Jul 2013 15:22:44 -0500 Subject: RFR: 8017513: Support for closeable streams In-Reply-To: <51DF0EFD.605@oracle.com> References: <51DDD261.5050406@oracle.com> <51DE6939.40202@redhat.com> <51DF0EFD.605@oracle.com> Message-ID: Paul S.'s said the "negative" of using AutoCloseable is "it is no longer clear whether a stream should be closed or not" (6/20). That's true because the semantics of AutoCloseable indicates you have a resource that requires closing. However, the choice to make MayHoldCloseableResource a sub-interface of AutoClosable should be resisted. It's an inverted design. The Liskov *substitution principle *says that sub-interfaces can't loosen the contracts of their superinterface. If anything, AutoCloseable should be subclass of this new interface, which MIGHT hold a resource that requires closing. The current choice is just plainly backwards. For the above reason stated, and for the fact the interface adds no new functionality, it's superfluous. If the interface relationship can't be inverted, then chuck it -- it does nothing anyway. At the least, keep the annotation. Paul On Thu, Jul 11, 2013 at 3:01 PM, Henry Jen wrote: > On 07/11/2013 01:13 AM, Florian Weimer wrote: > > On 07/10/2013 11:30 PM, Henry Jen wrote: > > > >> A new interface, java.util.MayHoldCloseableResource, indicates an > >> implementation may or may not hold a resource need to be closed. > > > > Why doesn't close() throw Exception? > > Because there is really much a developer can do on that situation. The > API simply make it not throw a *checked* exception. > > See EG discussion on this topic, > > > http://mail.openjdk.java.net/pipermail/lambda-libs-spec-experts/2013-June/002081.html > > > > >> Annotation {@link HoldsResource} may be used to guide users/static > >> analysis tools that a MHCR instance that definitely hold a Closeable > >> resource. > > > > All this looks a bit odd to me. I suppose the idea is that you don't > > want to give up the last reference to a closeable resource without > > calling close()?and not leak references which out-live the call to > > close(). This is definitely not a property of the type of the resource, > > so I don't see why the MayHoldCloseableResource interface is needed (or > > can confer relevant information). The HoldsResource annotation could be > > useful, but based on the current documentation, it's not clear if it is > > actually intended to express the data flow property. > > > > I would suggest you look at EG discussion on this topic. The MHCR is > different from AutoCloseable on the chances of holding critical resources. > > Perhaps that suggests the javadoc is not clear enough, I would like to > know what is important and missing. > > Cheers, > Henry > > > -- Cheers, Paul From dl at cs.oswego.edu Thu Jul 11 20:23:54 2013 From: dl at cs.oswego.edu (Doug Lea) Date: Thu, 11 Jul 2013 16:23:54 -0400 Subject: class SplittableRandom In-Reply-To: <1373572212.76309.YahooMailNeo@web171701.mail.ir2.yahoo.com> References: <51DDB26D.8050506@cs.oswego.edu> <1373572212.76309.YahooMailNeo@web171701.mail.ir2.yahoo.com> Message-ID: <51DF145A.1020506@cs.oswego.edu> On 07/11/13 15:50, Jeff Hain wrote: > Doug Lea wrote: > >Q: Why isn't SplittableRandom a subclass of Random? > >A: Class Random requires thread-safety in its spec. It would be > >nonsensical for SplittableRandom to comply. > > Random Javadoc states "Instances of java.util.Random are threadsafe." > but ThreadLocalRandom extends Random and is not, so why not consider > that the thread-safety statement only applies to Random.class, and > not to Random subclasses? ThreadLocalRandoms are (trivially) threadSafe in that you cannot share them among threads using any sanctioned usage construction. > > What I would have used (maybe because I'm not an expert!) is something > like this: > new Subtask(new MySequentialRandom(currentTaskRandom.nextLong())).fork() One way to think of SplittableRandom is that it makes your idea behind this code actually work. As it stands, if you were to do this with java.util.Random, both would generate the same sequence. > > The Javadoc for split() says that the values of the returned object > should have the same (i.e. as good?) statistical properties, but wouldn't > it also be the case with a good non-thread-safe Random, like based on > MersenneTwister, which could be seeded with multiple longs? It might be. It wasn't until a paper in PPoPP last year that researchers started looking more systematically at the independence properties of these parent-child generators. And of those we know something about, SplittableRandom's algorithm seems to be simplest and fastest. But if a better one comes along, we can plug it in; nothing in the specs requires the current implementation. > > With this method: > public double nextDouble() { > long bits = (1023L << 52) | (nextLong() >>> 12); > return Double.longBitsToDouble(bits) - 1.0; > } > the returned value granularity is only 1/2^52, Thanks. I'll relay this to a floating-point expert I know :-) and see whether we can/should improve it. > > 4) nextGaussian() > > Currently there is no nextGaussian(): > if added, would it use Random/TLR's algorithm, > or some variation of the Ziggurat method > (which can be about four times faster)? You've just answered why it is not there, and mostly answered why it shouldn't be there in any upcoming interface. There are many algorithms to choose from, that are all independent of the underlying uniform RNG algorithm. Plus, there are many more probability distributions out there. Singling out a particular algorithm/method for Gaussian stands mostly as an accident of history in java.util.Random. -Doug From dan.xu at oracle.com Thu Jul 11 20:41:02 2013 From: dan.xu at oracle.com (dan.xu at oracle.com) Date: Thu, 11 Jul 2013 20:41:02 +0000 Subject: hg: jdk8/tl/jdk: 8017212: File.createTempFile requires unnecessary "read" permission Message-ID: <20130711204146.D9245489F1@hg.openjdk.java.net> Changeset: 10d2a4b1e576 Author: dxu Date: 2013-07-11 13:40 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/10d2a4b1e576 8017212: File.createTempFile requires unnecessary "read" permission Summary: Directly call FileSystem method to check a file existence. Also reviewed by tom.hawtin at oracle.com Reviewed-by: alanb ! src/share/classes/java/io/File.java + test/java/io/File/CheckPermission.java ! test/java/io/File/NulFile.java ! test/java/io/File/createTempFile/SpecialTempFile.java From henry.jen at oracle.com Thu Jul 11 20:52:23 2013 From: henry.jen at oracle.com (Henry Jen) Date: Thu, 11 Jul 2013 13:52:23 -0700 Subject: RFR: 8017513: Support for closeable streams In-Reply-To: References: <51DDD261.5050406@oracle.com> <51DE6939.40202@redhat.com> <51DF0EFD.605@oracle.com> Message-ID: <51DF1B07.4090600@oracle.com> On 07/11/2013 01:22 PM, Paul Benedict wrote: > Paul S.'s said the "negative" of using AutoCloseable is "it is no longer > clear whether a stream should be closed or not" (6/20). That's true > because the semantics of AutoCloseable indicates you have a resource > that requires closing. > I believe that the negative of 'whether a stream should be closeable or not' is by eliminating CloseableStream vs. Stream, not the choice of AutoCloseable. > However, the choice to make MayHoldCloseableResource a sub-interface of > AutoClosable should be resisted. It's an inverted design. The Liskov > /substitution principle /says that sub-interfaces can't loosen the > contracts of their superinterface. If anything, AutoCloseable should be > subclass of this new interface, which MIGHT hold a resource that > requires closing. The current choice is just plainly backwards. > The reason to be subclass of AutoCloseable is Try-With-Resource construct. AutoCloseable is not a fit mainly because close() method throws Exception, and as you suggested, the "impression"(not explicit expressed, look at other AutoCloseable where close() is not required) that AutoCloseable means something should be closed. While I agree your argument, I sort of thinking it's more Closeable vs MayHoldCloseableResource, where AutoCloseable is a indicator that such resource can be closed with TWR. Cheers, Henry From pbenedict at apache.org Thu Jul 11 20:59:26 2013 From: pbenedict at apache.org (Paul Benedict) Date: Thu, 11 Jul 2013 15:59:26 -0500 Subject: RFR: 8017513: Support for closeable streams In-Reply-To: <51DF1B07.4090600@oracle.com> References: <51DDD261.5050406@oracle.com> <51DE6939.40202@redhat.com> <51DF0EFD.605@oracle.com> <51DF1B07.4090600@oracle.com> Message-ID: Interesting thought, Henry. Given your explanation, I perhaps garner the semantics of AutoCloseable should be loosen to equal what MayHoldCloseableResource is. Rather than say AutoCloseable is a resource that must be closed, simply say it's a resource that can be closed. Then MayHoldCloseableResource can disappear. On Thu, Jul 11, 2013 at 3:52 PM, Henry Jen wrote: > On 07/11/2013 01:22 PM, Paul Benedict wrote: > > Paul S.'s said the "negative" of using AutoCloseable is "it is no longer > > clear whether a stream should be closed or not" (6/20). That's true > > because the semantics of AutoCloseable indicates you have a resource > > that requires closing. > > > > I believe that the negative of 'whether a stream should be closeable or > not' is by eliminating CloseableStream vs. Stream, not the choice of > AutoCloseable. > > > However, the choice to make MayHoldCloseableResource a sub-interface of > > AutoClosable should be resisted. It's an inverted design. The Liskov > > /substitution principle /says that sub-interfaces can't loosen the > > contracts of their superinterface. If anything, AutoCloseable should be > > subclass of this new interface, which MIGHT hold a resource that > > requires closing. The current choice is just plainly backwards. > > > > The reason to be subclass of AutoCloseable is Try-With-Resource construct. > > AutoCloseable is not a fit mainly because close() method throws > Exception, and as you suggested, the "impression"(not explicit > expressed, look at other AutoCloseable where close() is not required) > that AutoCloseable means something should be closed. > > While I agree your argument, I sort of thinking it's more Closeable vs > MayHoldCloseableResource, where AutoCloseable is a indicator that such > resource can be closed with TWR. > > Cheers, > Henry > -- Cheers, Paul From peter.levart at gmail.com Thu Jul 11 21:08:46 2013 From: peter.levart at gmail.com (Peter Levart) Date: Thu, 11 Jul 2013 23:08:46 +0200 Subject: RFR: 8017513: Support for closeable streams In-Reply-To: References: <51DDD261.5050406@oracle.com> <51DE6939.40202@redhat.com> <51DF0EFD.605@oracle.com> Message-ID: <51DF1EDE.2040501@gmail.com> Hi Paul, I think the MayHoldCloseableResource extends AutoClosable is correct and AutoClosable extends MayHoldCloseableResource would be wrong. And exactly because of "Liskov": MayHoldCloseableResource contract says: "If you know it holds a resource, call close(), otherwise you need not call close(), but it's not wrong to call it anyway - you know whether it holds resource by looking at @HoldsResource annotation" AutoClosable contract says: "It holds a resource, you should call close()" Now imagine code that was written for the AutoClosable contract. Would it work if you pass it an instance of MayHoldCloseableResource? Allways. Now imagine generic code that was written for MayHoldCloseableResource contract and which uses the lookup of @HoldsResource at runtime to decide whether to call close() or not. Would it work if you pass it an instance of AutoClosable? Never (since AutoClosable says nothing about any annotation). So I argue that MayHoldCloseableResource should be a subtype of AutoClosable and not the other way around. (I have not said anything about whether the MayHoldCloseableResource is actually needed or not.) Regards, Peter On 07/11/2013 10:22 PM, Paul Benedict wrote: > Paul S.'s said the "negative" of using AutoCloseable is "it is no longer > clear whether a stream should be closed or not" (6/20). That's true because > the semantics of AutoCloseable indicates you have a resource that requires > closing. > > However, the choice to make MayHoldCloseableResource a sub-interface of > AutoClosable should be resisted. It's an inverted design. The Liskov > *substitution > principle *says that sub-interfaces can't loosen the contracts of their > superinterface. If anything, AutoCloseable should be subclass of this new > interface, which MIGHT hold a resource that requires closing. The current > choice is just plainly backwards. > > For the above reason stated, and for the fact the interface adds no new > functionality, it's superfluous. If the interface relationship can't be > inverted, then chuck it -- it does nothing anyway. At the least, keep the > annotation. > > Paul > > > On Thu, Jul 11, 2013 at 3:01 PM, Henry Jen wrote: > >> On 07/11/2013 01:13 AM, Florian Weimer wrote: >>> On 07/10/2013 11:30 PM, Henry Jen wrote: >>> >>>> A new interface, java.util.MayHoldCloseableResource, indicates an >>>> implementation may or may not hold a resource need to be closed. >>> Why doesn't close() throw Exception? >> Because there is really much a developer can do on that situation. The >> API simply make it not throw a *checked* exception. >> >> See EG discussion on this topic, >> >> >> http://mail.openjdk.java.net/pipermail/lambda-libs-spec-experts/2013-June/002081.html >> >>>> Annotation {@link HoldsResource} may be used to guide users/static >>>> analysis tools that a MHCR instance that definitely hold a Closeable >>>> resource. >>> All this looks a bit odd to me. I suppose the idea is that you don't >>> want to give up the last reference to a closeable resource without >>> calling close()?and not leak references which out-live the call to >>> close(). This is definitely not a property of the type of the resource, >>> so I don't see why the MayHoldCloseableResource interface is needed (or >>> can confer relevant information). The HoldsResource annotation could be >>> useful, but based on the current documentation, it's not clear if it is >>> actually intended to express the data flow property. >>> >> I would suggest you look at EG discussion on this topic. The MHCR is >> different from AutoCloseable on the chances of holding critical resources. >> >> Perhaps that suggests the javadoc is not clear enough, I would like to >> know what is important and missing. >> >> Cheers, >> Henry >> >> >> From roger.riggs at oracle.com Thu Jul 11 21:17:41 2013 From: roger.riggs at oracle.com (roger riggs) Date: Thu, 11 Jul 2013 17:17:41 -0400 Subject: RFR: 8017513: Support for closeable streams In-Reply-To: <51DF1EDE.2040501@gmail.com> References: <51DDD261.5050406@oracle.com> <51DE6939.40202@redhat.com> <51DF0EFD.605@oracle.com> <51DF1EDE.2040501@gmail.com> Message-ID: <51DF20F5.3090700@oracle.com> Hi, Wouldn't the close() implementation be nil in most cases if there was no resource. That kind of method runs very quickly and I would expect the compiler to inline nothing. It would be quicker to just call close() than to engage reflection to determine if it really did and then decide to call it. Or am I missing some point about generating code or in some cases not needing/wanting to close it? Roger On 7/11/2013 5:08 PM, Peter Levart wrote: > Hi Paul, > > I think the MayHoldCloseableResource extends AutoClosable is correct > and AutoClosable extends MayHoldCloseableResource would be wrong. > > And exactly because of "Liskov": > > MayHoldCloseableResource contract says: "If you know it holds a > resource, call close(), otherwise you need not call close(), but it's > not wrong to call it anyway - you know whether it holds resource by > looking at @HoldsResource annotation" > > AutoClosable contract says: "It holds a resource, you should call > close()" > > > Now imagine code that was written for the AutoClosable contract. Would > it work if you pass it an instance of MayHoldCloseableResource? Allways. > > Now imagine generic code that was written for MayHoldCloseableResource > contract and which uses the lookup of @HoldsResource at runtime to > decide whether to call close() or not. Would it work if you pass it an > instance of AutoClosable? Never (since AutoClosable says nothing about > any annotation). > > So I argue that MayHoldCloseableResource should be a subtype of > AutoClosable and not the other way around. > > (I have not said anything about whether the MayHoldCloseableResource > is actually needed or not.) > > > Regards, Peter > > > On 07/11/2013 10:22 PM, Paul Benedict wrote: >> Paul S.'s said the "negative" of using AutoCloseable is "it is no longer >> clear whether a stream should be closed or not" (6/20). That's true >> because >> the semantics of AutoCloseable indicates you have a resource that >> requires >> closing. >> >> However, the choice to make MayHoldCloseableResource a sub-interface of >> AutoClosable should be resisted. It's an inverted design. The Liskov >> *substitution >> principle *says that sub-interfaces can't loosen the contracts of their >> superinterface. If anything, AutoCloseable should be subclass of this >> new >> interface, which MIGHT hold a resource that requires closing. The >> current >> choice is just plainly backwards. >> >> For the above reason stated, and for the fact the interface adds no new >> functionality, it's superfluous. If the interface relationship can't be >> inverted, then chuck it -- it does nothing anyway. At the least, keep >> the >> annotation. >> >> Paul >> >> >> On Thu, Jul 11, 2013 at 3:01 PM, Henry Jen wrote: >> >>> On 07/11/2013 01:13 AM, Florian Weimer wrote: >>>> On 07/10/2013 11:30 PM, Henry Jen wrote: >>>> >>>>> A new interface, java.util.MayHoldCloseableResource, indicates an >>>>> implementation may or may not hold a resource need to be closed. >>>> Why doesn't close() throw Exception? >>> Because there is really much a developer can do on that situation. The >>> API simply make it not throw a *checked* exception. >>> >>> See EG discussion on this topic, >>> >>> >>> http://mail.openjdk.java.net/pipermail/lambda-libs-spec-experts/2013-June/002081.html >>> >>> >>>>> Annotation {@link HoldsResource} may be used to guide users/static >>>>> analysis tools that a MHCR instance that definitely hold a Closeable >>>>> resource. >>>> All this looks a bit odd to me. I suppose the idea is that you don't >>>> want to give up the last reference to a closeable resource without >>>> calling close()?and not leak references which out-live the call to >>>> close(). This is definitely not a property of the type of the >>>> resource, >>>> so I don't see why the MayHoldCloseableResource interface is needed >>>> (or >>>> can confer relevant information). The HoldsResource annotation >>>> could be >>>> useful, but based on the current documentation, it's not clear if >>>> it is >>>> actually intended to express the data flow property. >>>> >>> I would suggest you look at EG discussion on this topic. The MHCR is >>> different from AutoCloseable on the chances of holding critical >>> resources. >>> >>> Perhaps that suggests the javadoc is not clear enough, I would like to >>> know what is important and missing. >>> >>> Cheers, >>> Henry >>> >>> >>> > From jeffhain at rocketmail.com Thu Jul 11 21:29:41 2013 From: jeffhain at rocketmail.com (Jeff Hain) Date: Thu, 11 Jul 2013 22:29:41 +0100 (BST) Subject: class SplittableRandom In-Reply-To: <51DF145A.1020506@cs.oswego.edu> References: <51DDB26D.8050506@cs.oswego.edu> <1373572212.76309.YahooMailNeo@web171701.mail.ir2.yahoo.com> <51DF145A.1020506@cs.oswego.edu> Message-ID: <1373578181.91584.YahooMailNeo@web171703.mail.ir2.yahoo.com> Doug Lea wrote: >>??? new Subtask(new MySequentialRandom(currentTaskRandom.nextLong())).fork() >One way to think of SplittableRandom is that it makes your idea >behind this code actually work. As it stands, if you were to do >this with java.util.Random, both would generate the same sequence. What I was worrying about is having a new API, for a behavior that could be obtained with an old one, but indeed this new API helps people not screw up as they would tend to if using the old one (and especially its default implementation), and it should be easy to make an adapter extending Random and have existing code use SplittableRandom through it. Also not extending Random saves memory and makes things faster (no method override). >Singling out a particular algorithm/method >for Gaussian stands mostly as an accident of history >in java.util.Random. Yes, that was just in case you were going to make SplittableRandom extend or at least imitate Random at some point, for convenience (like for nextDouble()). -Jeff From mike.duigou at oracle.com Thu Jul 11 23:04:49 2013 From: mike.duigou at oracle.com (Mike Duigou) Date: Thu, 11 Jul 2013 16:04:49 -0700 Subject: Point lambdaification of List/Set/Map In-Reply-To: References: Message-ID: <90FA03DA-CBE4-4EAD-9842-EB7C3D5CA48C@oracle.com> (Just getting back from vacation) This seems like a reasonable idea. There has been some concern about adding defaulted non-static methods to these core interfaces because of potential collisions with existing implementations abut that would not seem to be a concern with static methods. On Jun 26 2013, at 09:47 , Stephen Colebourne wrote: > Sending this on to core-libs-dev to try to get a response ;-) > Stephen > > On 24 June 2013 16:14, Stephen Colebourne wrote: >> One point lambdaification that I haven't seen mentioned is addition >> static factory methods for the main collection interfaces. (Strictly, >> this proposal is not point lambdaification as it does not involve >> lambdas, but it is very much in the same area). >> >> I propose adding these static methods: >> Collection.empty() >> Collection.of(T...) >> List.empty() >> List.of(T...) >> Set.empty() >> Set.of(T...) >> Map.empty() >> Map.of(Entry...) >> Map.Entry.of(K, V) >> >> Each of these methods would return immutable implementations. >> There is a case for extending the methods to Iterator and other >> collection types, however these are the most important. >> These follow the designs of Stream static methods IIRC. >> >> This library change would remove much of the requirement for the >> "collection literals" change discussed in Project Coin. >> >> Implementation would ideally be via new dedicated immutable classes, >> however space could be saved by simply reusing the existing classes. I would prefer to use existing Collections implementations. Primarily because they have already been thoroughly used. Any reason to use new dedicated classes? >> >> Is this something we could fit in? (Is resourcing the problem, or the idea?) Patches are *always* welcome and are usually more grease to make things happen than just a squeaky wheel. :-) Without a patch I wouldn't be willing to commit that this RFE would make it into Java 8. Mike >> >> thanks >> Stephen From dl at cs.oswego.edu Thu Jul 11 23:10:16 2013 From: dl at cs.oswego.edu (Doug Lea) Date: Thu, 11 Jul 2013 19:10:16 -0400 Subject: class SplittableRandom In-Reply-To: <1373572212.76309.YahooMailNeo@web171701.mail.ir2.yahoo.com> References: <51DDB26D.8050506@cs.oswego.edu> <1373572212.76309.YahooMailNeo@web171701.mail.ir2.yahoo.com> Message-ID: <51DF3B58.9040900@cs.oswego.edu> On 07/11/13 15:50, Jeff Hain wrote: > > One could use that instead, which doesn't have that problem, > and provides values in [0,1-1/2^53], with 1/2^53 granularity: > public double nextDouble() { > return (this.nextLong() & ((1L<<53)-1)) * (1.0/(1L<<53)); > } Thanks very much! We changed to use this approach, which does indeed seem like the best tradeoff. -Doug From zhong.j.yu at gmail.com Thu Jul 11 23:14:04 2013 From: zhong.j.yu at gmail.com (Zhong Yu) Date: Thu, 11 Jul 2013 18:14:04 -0500 Subject: RFR: 8017513: Support for closeable streams In-Reply-To: <51DF1EDE.2040501@gmail.com> References: <51DDD261.5050406@oracle.com> <51DE6939.40202@redhat.com> <51DF0EFD.605@oracle.com> <51DF1EDE.2040501@gmail.com> Message-ID: On Thu, Jul 11, 2013 at 4:08 PM, Peter Levart wrote: > Hi Paul, > > I think the MayHoldCloseableResource extends AutoClosable is correct and > AutoClosable extends MayHoldCloseableResource would be wrong. > > And exactly because of "Liskov": > > MayHoldCloseableResource contract says: "If you know it holds a resource, > call close(), otherwise you need not call close(), but it's not wrong to > call it anyway - you know whether it holds resource by looking at > @HoldsResource annotation" > > AutoClosable contract says: "It holds a resource, you should call close()" > > > Now imagine code that was written for the AutoClosable contract. Would it > work if you pass it an instance of MayHoldCloseableResource? Allways. > > Now imagine generic code that was written for MayHoldCloseableResource > contract and which uses the lookup of @HoldsResource at runtime to decide How do you lookup an annotation on an _instance_ at runtime? And why do we even care? Just call close() regardless. And we can revert the parent/child relation, because the "otherwise specified" clause is a panacea. Zhong Yu > whether to call close() or not. Would it work if you pass it an instance of > AutoClosable? Never (since AutoClosable says nothing about any annotation). > > So I argue that MayHoldCloseableResource should be a subtype of AutoClosable > and not the other way around. > > (I have not said anything about whether the MayHoldCloseableResource is > actually needed or not.) > > > Regards, Peter > > > > On 07/11/2013 10:22 PM, Paul Benedict wrote: >> >> Paul S.'s said the "negative" of using AutoCloseable is "it is no longer >> clear whether a stream should be closed or not" (6/20). That's true >> because >> the semantics of AutoCloseable indicates you have a resource that requires >> closing. >> >> However, the choice to make MayHoldCloseableResource a sub-interface of >> AutoClosable should be resisted. It's an inverted design. The Liskov >> *substitution >> principle *says that sub-interfaces can't loosen the contracts of their >> superinterface. If anything, AutoCloseable should be subclass of this new >> interface, which MIGHT hold a resource that requires closing. The current >> choice is just plainly backwards. >> >> For the above reason stated, and for the fact the interface adds no new >> functionality, it's superfluous. If the interface relationship can't be >> inverted, then chuck it -- it does nothing anyway. At the least, keep the >> annotation. >> >> Paul >> >> >> On Thu, Jul 11, 2013 at 3:01 PM, Henry Jen wrote: >> >>> On 07/11/2013 01:13 AM, Florian Weimer wrote: >>>> >>>> On 07/10/2013 11:30 PM, Henry Jen wrote: >>>> >>>>> A new interface, java.util.MayHoldCloseableResource, indicates an >>>>> implementation may or may not hold a resource need to be closed. >>>> >>>> Why doesn't close() throw Exception? >>> >>> Because there is really much a developer can do on that situation. The >>> API simply make it not throw a *checked* exception. >>> >>> See EG discussion on this topic, >>> >>> >>> >>> http://mail.openjdk.java.net/pipermail/lambda-libs-spec-experts/2013-June/002081.html >>> >>>>> Annotation {@link HoldsResource} may be used to guide users/static >>>>> analysis tools that a MHCR instance that definitely hold a Closeable >>>>> resource. >>>> >>>> All this looks a bit odd to me. I suppose the idea is that you don't >>>> want to give up the last reference to a closeable resource without >>>> calling close()?and not leak references which out-live the call to >>>> close(). This is definitely not a property of the type of the resource, >>>> so I don't see why the MayHoldCloseableResource interface is needed (or >>>> can confer relevant information). The HoldsResource annotation could be >>>> useful, but based on the current documentation, it's not clear if it is >>>> actually intended to express the data flow property. >>>> >>> I would suggest you look at EG discussion on this topic. The MHCR is >>> different from AutoCloseable on the chances of holding critical >>> resources. >>> >>> Perhaps that suggests the javadoc is not clear enough, I would like to >>> know what is important and missing. >>> >>> Cheers, >>> Henry >>> >>> >>> > From scolebourne at joda.org Thu Jul 11 23:49:07 2013 From: scolebourne at joda.org (Stephen Colebourne) Date: Fri, 12 Jul 2013 00:49:07 +0100 Subject: Point lambdaification of List/Set/Map In-Reply-To: <90FA03DA-CBE4-4EAD-9842-EB7C3D5CA48C@oracle.com> References: <90FA03DA-CBE4-4EAD-9842-EB7C3D5CA48C@oracle.com> Message-ID: On 12 July 2013 00:04, Mike Duigou wrote: >>> Implementation would ideally be via new dedicated immutable classes, >>> however space could be saved by simply reusing the existing classes. > > I would prefer to use existing Collections implementations. Primarily because they have already been thoroughly used. Any reason to use new dedicated classes? Google Guava is the model here. It has dedicated immutable classes that are more efficient because they don't have the overhead of an immutable wrapper. If it has to be existing classes, then so be it, but the implementation may suffer as a result. I don't believe it can be changed later, as users may see the implementation class as significant, perhaps via a serialization ID. If it is considered acceptable to change the implementation class in a later release, then I would be happy to accept reusing the existing classes to get this into 8. Is it possible to get an opinion on a later implementation class change? >>> Is this something we could fit in? (Is resourcing the problem, or the idea?) > > Patches are *always* welcome and are usually more grease to make things happen than just a squeaky wheel. :-) Without a patch I wouldn't be willing to commit that this RFE would make it into Java 8. I may be able to find time to do this. Or I may not. Other list readers might want to chime in here and volunteer. I certainly think it would be a popular addition. Stephen From nicholas+openjdk at nicholaswilliams.net Fri Jul 12 00:00:58 2013 From: nicholas+openjdk at nicholaswilliams.net (Nick Williams) Date: Thu, 11 Jul 2013 19:00:58 -0500 Subject: Point lambdaification of List/Set/Map In-Reply-To: References: Message-ID: <6CF88E78-71B2-4BB9-99D9-88B3F6423CC1@nicholaswilliams.net> On Jun 24, 2013, at 10:14 AM, Stephen Colebourne wrote: > One point lambdaification that I haven't seen mentioned is addition > static factory methods for the main collection interfaces. (Strictly, > this proposal is not point lambdaification as it does not involve > lambdas, but it is very much in the same area). > > I propose adding these static methods: > Collection.empty() > Collection.of(T...) > List.empty() > List.of(T...) > Set.empty() > Set.of(T...) > Map.empty() > Map.of(Entry...) > Map.Entry.of(K, V) > > Each of these methods would return immutable implementations. > There is a case for extending the methods to Iterator and other > collection types, however these are the most important. > These follow the designs of Stream static methods IIRC. > > This library change would remove much of the requirement for the > "collection literals" change discussed in Project Coin. In general I really like the idea of these methods and support them, but I wanted to make something clear. This: Map.of(Map.Entry.of("hello", value1), Map.Entry.of("world", value2), Map.Entry.of("foo", value3), Map.Entry.of("bar", value4)) Is NOT a replacement for this: { "hello" : value1, "world" : value2, "foo" : value3, "bar" : value4 } The former is incredibly more verbose than the latter, and that verbosity is wholly unnecessary. I still support the addition of these methods, and perhaps the future Collection Literals are syntactic sugar for them, but it most certainly does NOT "remove much of the requirement for the 'collection literals' change discussed in Project Coin." Collection literals are still very much desired and lacking, even with these new methods. Nick From valerie.peng at oracle.com Fri Jul 12 00:54:15 2013 From: valerie.peng at oracle.com (valerie.peng at oracle.com) Date: Fri, 12 Jul 2013 00:54:15 +0000 Subject: hg: jdk8/tl/jdk: 7 new changesets Message-ID: <20130712005547.CEC3448A0B@hg.openjdk.java.net> Changeset: f225da733291 Author: valeriep Date: 2013-07-05 13:53 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/f225da733291 8012637: Adjust CipherInputStream class to work in AEAD/GCM mode Summary: Ensure the Cipher.doFinal() is called only once Reviewed-by: xuelei ! src/share/classes/javax/crypto/CipherInputStream.java + test/com/sun/crypto/provider/Cipher/AES/TestCICOWithGCM.java Changeset: 6e2a5637b286 Author: valeriep Date: 2013-07-05 13:56 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/6e2a5637b286 7196805: DH Key interoperability testing between SunJCE and JsafeJCE not successful Summary: Check equality based on component values instead of encoding which may vary due to optional components Reviewed-by: weijun ! src/share/classes/com/sun/crypto/provider/DHKeyFactory.java ! src/share/classes/com/sun/crypto/provider/DHKeyPairGenerator.java ! src/share/classes/com/sun/crypto/provider/DHPrivateKey.java ! src/share/classes/com/sun/crypto/provider/DHPublicKey.java ! src/share/classes/sun/security/pkcs11/P11Key.java Changeset: f321b78c7009 Author: ascarpino Date: 2013-07-08 10:20 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/f321b78c7009 6755701: SunJCE DES/DESede SecretKeyFactory.generateSecret throws InvalidKeySpecExc if passed SecretKeySpec Reviewed-by: valeriep, wetmore, xuelei ! src/share/classes/com/sun/crypto/provider/DESKeyFactory.java ! src/share/classes/com/sun/crypto/provider/DESedeKeyFactory.java + test/com/sun/crypto/provider/Cipher/DES/DESSecretKeySpec.java Changeset: 869bfa39d923 Author: valeriep Date: 2013-07-08 11:11 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/869bfa39d923 Merge - src/share/classes/com/sun/org/apache/xml/internal/security/resource/log4j.properties - src/share/classes/com/sun/org/apache/xml/internal/security/transforms/implementations/FuncHereContext.java - src/share/classes/com/sun/org/apache/xml/internal/security/utils/CachedXPathAPIHolder.java - src/share/classes/com/sun/org/apache/xml/internal/security/utils/CachedXPathFuncHereAPI.java - src/share/classes/com/sun/org/apache/xml/internal/security/utils/XPathFuncHereAPI.java Changeset: 4fcac826628c Author: valeriep Date: 2013-07-09 15:26 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/4fcac826628c Merge Changeset: 7bd2993e03fa Author: valeriep Date: 2013-07-10 18:14 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/7bd2993e03fa 8020310: JDK-6356530 broke the old build Summary: Add serialVersionUID to AuthProvider and P11Key class. Reviewed-by: xuelei ! src/share/classes/java/security/AuthProvider.java ! src/share/classes/sun/security/pkcs11/P11Key.java Changeset: 4c95c032c395 Author: valeriep Date: 2013-07-11 17:52 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/4c95c032c395 Merge From mandy.chung at oracle.com Fri Jul 12 02:17:03 2013 From: mandy.chung at oracle.com (Mandy Chung) Date: Fri, 12 Jul 2013 10:17:03 +0800 Subject: Review request for 7187144: JavaDoc for ScriptEngineFactory.getProgram() contains an error In-Reply-To: <51DEA16B.4040002@oracle.com> References: <51DEA16B.4040002@oracle.com> Message-ID: <51DF671F.1030300@oracle.com> Looks good to me. Mandy On 7/11/2013 8:13 PM, A. Sundararajan wrote: > Bug: http://bugs.sun.com/view_bug.do?bug_id=7187144 > > Please review http://cr.openjdk.java.net/~sundar/7187144/ > > Thanks > -Sundar From huizhe.wang at oracle.com Fri Jul 12 08:59:19 2013 From: huizhe.wang at oracle.com (huizhe wang) Date: Fri, 12 Jul 2013 01:59:19 -0700 Subject: RFR: (JAXP) 8020430 : NullPointerException in xml sqe nightly result on 2013-07-12 Message-ID: <51DFC567.3070902@oracle.com> Hi, This is a quick fix on a regression caused by 8016648. The new property manager added to handle the new jaxp 1.5 properties is only created for the input and event factories. For the output factory therefore, there should have a null-check. I've run the tests used in the nightly build with a local build, all passed with this patch. webrev: http://cr.openjdk.java.net/~joehw/jdk8/8020430/webrev/ Thanks, Joe From peter.levart at gmail.com Fri Jul 12 09:30:47 2013 From: peter.levart at gmail.com (Peter Levart) Date: Fri, 12 Jul 2013 11:30:47 +0200 Subject: RFR: 8017513: Support for closeable streams In-Reply-To: References: <51DDD261.5050406@oracle.com> <51DE6939.40202@redhat.com> <51DF0EFD.605@oracle.com> <51DF1EDE.2040501@gmail.com> Message-ID: <51DFCCC7.8080502@gmail.com> On 07/12/2013 01:14 AM, Zhong Yu wrote: > On Thu, Jul 11, 2013 at 4:08 PM, Peter Levart wrote: >> Hi Paul, >> >> I think the MayHoldCloseableResource extends AutoClosable is correct and >> AutoClosable extends MayHoldCloseableResource would be wrong. >> >> And exactly because of "Liskov": >> >> MayHoldCloseableResource contract says: "If you know it holds a resource, >> call close(), otherwise you need not call close(), but it's not wrong to >> call it anyway - you know whether it holds resource by looking at >> @HoldsResource annotation" >> >> AutoClosable contract says: "It holds a resource, you should call close()" >> >> >> Now imagine code that was written for the AutoClosable contract. Would it >> work if you pass it an instance of MayHoldCloseableResource? Allways. >> >> Now imagine generic code that was written for MayHoldCloseableResource >> contract and which uses the lookup of @HoldsResource at runtime to decide > How do you lookup an annotation on an _instance_ at runtime? Hi Zhong (and Roger), Well, if @HoldsResource had RUNTIME retention, then by using: instance.getClass(), ... clazz.getSuperclass(), getInterfaces(), ... etc. > And why > do we even care? Just call close() regardless. I was just trying to illustrate a hypothetical code that works with MayHoldCloseableResource contract and breaks if AutoCloseable is passed to it. In case AutoCloseable was a subtype of MayHoldCloseableResource, considering Liskov substitution principle, it should work: /"if S is a //subtype //of T, then objects of //type //T may be replaced with objects of type S (i.e., objects of type S may be substituted for objects of type T) without altering any of the desirable properties of that program (correctness, task performed, etc.)"/. In reality the decision about calling or not calling the close() is hard-coded by the programmer, guided by static analysis tools, IDEs and so on, but that doesn't change the reasoning. > > And we can revert the parent/child relation, because the "otherwise > specified" clause is a panacea. Could you elaborate that? Regards, Peter > > > Zhong Yu > > >> whether to call close() or not. Would it work if you pass it an instance of >> AutoClosable? Never (since AutoClosable says nothing about any annotation). >> >> So I argue that MayHoldCloseableResource should be a subtype of AutoClosable >> and not the other way around. >> >> (I have not said anything about whether the MayHoldCloseableResource is >> actually needed or not.) >> >> >> Regards, Peter >> >> >> >> On 07/11/2013 10:22 PM, Paul Benedict wrote: >>> Paul S.'s said the "negative" of using AutoCloseable is "it is no longer >>> clear whether a stream should be closed or not" (6/20). That's true >>> because >>> the semantics of AutoCloseable indicates you have a resource that requires >>> closing. >>> >>> However, the choice to make MayHoldCloseableResource a sub-interface of >>> AutoClosable should be resisted. It's an inverted design. The Liskov >>> *substitution >>> principle *says that sub-interfaces can't loosen the contracts of their >>> superinterface. If anything, AutoCloseable should be subclass of this new >>> interface, which MIGHT hold a resource that requires closing. The current >>> choice is just plainly backwards. >>> >>> For the above reason stated, and for the fact the interface adds no new >>> functionality, it's superfluous. If the interface relationship can't be >>> inverted, then chuck it -- it does nothing anyway. At the least, keep the >>> annotation. >>> >>> Paul >>> >>> >>> On Thu, Jul 11, 2013 at 3:01 PM, Henry Jen wrote: >>> >>>> On 07/11/2013 01:13 AM, Florian Weimer wrote: >>>>> On 07/10/2013 11:30 PM, Henry Jen wrote: >>>>> >>>>>> A new interface, java.util.MayHoldCloseableResource, indicates an >>>>>> implementation may or may not hold a resource need to be closed. >>>>> Why doesn't close() throw Exception? >>>> Because there is really much a developer can do on that situation. The >>>> API simply make it not throw a *checked* exception. >>>> >>>> See EG discussion on this topic, >>>> >>>> >>>> >>>> http://mail.openjdk.java.net/pipermail/lambda-libs-spec-experts/2013-June/002081.html >>>> >>>>>> Annotation {@link HoldsResource} may be used to guide users/static >>>>>> analysis tools that a MHCR instance that definitely hold a Closeable >>>>>> resource. >>>>> All this looks a bit odd to me. I suppose the idea is that you don't >>>>> want to give up the last reference to a closeable resource without >>>>> calling close()?and not leak references which out-live the call to >>>>> close(). This is definitely not a property of the type of the resource, >>>>> so I don't see why the MayHoldCloseableResource interface is needed (or >>>>> can confer relevant information). The HoldsResource annotation could be >>>>> useful, but based on the current documentation, it's not clear if it is >>>>> actually intended to express the data flow property. >>>>> >>>> I would suggest you look at EG discussion on this topic. The MHCR is >>>> different from AutoCloseable on the chances of holding critical >>>> resources. >>>> >>>> Perhaps that suggests the javadoc is not clear enough, I would like to >>>> know what is important and missing. >>>> >>>> Cheers, >>>> Henry >>>> >>>> >>>> From chris.hegarty at oracle.com Fri Jul 12 09:44:38 2013 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Fri, 12 Jul 2013 10:44:38 +0100 Subject: RFR: (JAXP) 8020430 : NullPointerException in xml sqe nightly result on 2013-07-12 In-Reply-To: <51DFC567.3070902@oracle.com> References: <51DFC567.3070902@oracle.com> Message-ID: The source changes look fine to me. The tests should be located elsewhere, otherwise they will collide with an Oracle internal repo. Say jdk/test/jaxp? As an aside, I plan to move the jaxws tests to a similar holding area, jdk/test/jaxws. They can then follow the appropriate package structure. -Chris On 12 Jul 2013, at 09:59, huizhe wang wrote: > Hi, > > This is a quick fix on a regression caused by 8016648. The new property manager added to handle the new jaxp 1.5 properties is only created for the input and event factories. For the output factory therefore, there should have a null-check. I've run the tests used in the nightly build with a local build, all passed with this patch. > > webrev: > http://cr.openjdk.java.net/~joehw/jdk8/8020430/webrev/ > > Thanks, > Joe From Lance.Andersen at oracle.com Fri Jul 12 10:30:45 2013 From: Lance.Andersen at oracle.com (Lance Andersen - Oracle) Date: Fri, 12 Jul 2013 06:30:45 -0400 Subject: RFR: (JAXP) 8020430 : NullPointerException in xml sqe nightly result on 2013-07-12 In-Reply-To: References: <51DFC567.3070902@oracle.com> Message-ID: <88E5A207-A25D-48F3-AC68-941468821F1C@oracle.com> The fix looks fine to me Joe as does the test. I assume you will go with Chris's plan below for the test locations? Best Lance On Jul 12, 2013, at 5:44 AM, Chris Hegarty wrote: > The source changes look fine to me. > > The tests should be located elsewhere, otherwise they will collide with an Oracle internal repo. Say jdk/test/jaxp? > > As an aside, I plan to move the jaxws tests to a similar holding area, jdk/test/jaxws. They can then follow the appropriate package structure. > > -Chris > > On 12 Jul 2013, at 09:59, huizhe wang wrote: > >> Hi, >> >> This is a quick fix on a regression caused by 8016648. The new property manager added to handle the new jaxp 1.5 properties is only created for the input and event factories. For the output factory therefore, there should have a null-check. I've run the tests used in the nightly build with a local build, all passed with this patch. >> >> webrev: >> http://cr.openjdk.java.net/~joehw/jdk8/8020430/webrev/ >> >> Thanks, >> Joe -------------- next part -------------- Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 Oracle Java Engineering 1 Network Drive Burlington, MA 01803 Lance.Andersen at oracle.com From mandy.chung at oracle.com Fri Jul 12 11:21:17 2013 From: mandy.chung at oracle.com (mandy.chung at oracle.com) Date: Fri, 12 Jul 2013 11:21:17 +0000 Subject: hg: jdk8/tl/jdk: 8014890: (ref) Reference queues may return more entries than expected Message-ID: <20130712112200.49AF248A2E@hg.openjdk.java.net> Changeset: 858c75eb83b5 Author: mchung Date: 2013-07-08 14:05 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/858c75eb83b5 8014890: (ref) Reference queues may return more entries than expected Summary: When enqueuing references check whether the j.l.r.Reference has already been enqeued or removed in the lock. Do not enqueue them again. This occurs because multiple threads may try to enqueue the same j.l.r.Reference at the same time. Reviewed-by: mchung, dholmes, plevart, shade Contributed-by: thomas.schatzl at oracle.com ! src/share/classes/java/lang/ref/Reference.java ! src/share/classes/java/lang/ref/ReferenceQueue.java + test/java/lang/ref/EnqueuePollRace.java From mandy.chung at oracle.com Fri Jul 12 11:22:59 2013 From: mandy.chung at oracle.com (Mandy Chung) Date: Fri, 12 Jul 2013 19:22:59 +0800 Subject: RFR (XS): 8014890 : Reference queues may return more entries than expected In-Reply-To: <1372679479.2769.44.camel@cirrus> References: <1371589723.2524.43.camel@cirrus> <51D0D0A2.7030307@oracle.com> <51D134FF.2080802@oracle.com> <1372673139.2769.14.camel@cirrus> <51D15679.2080407@oracle.com> <51D169E8.70601@oracle.com> <51D16B98.5010506@oracle.com> <1372679479.2769.44.camel@cirrus> Message-ID: <51DFE713.6040008@oracle.com> Hi Thomas, On 7/1/2013 7:51 PM, Thomas Schatzl wrote: > I changed this in > http://cr.openjdk.java.net/~tschatzl/8014890/webrev.refactor to that > version now, using a temporary variable that stores r.queue before the > checks to avoid the double volatile reads. This looks good. I have pushed this for you. Sorry for the delay as I have been busy on other tasks. Mandy From david.holmes at oracle.com Fri Jul 12 11:22:39 2013 From: david.holmes at oracle.com (David Holmes) Date: Fri, 12 Jul 2013 21:22:39 +1000 Subject: RFR: 8017513: Support for closeable streams In-Reply-To: References: <51DDD261.5050406@oracle.com> <51DE6939.40202@redhat.com> <51DF0EFD.605@oracle.com> Message-ID: <51DFE6FF.60009@oracle.com> On 12/07/2013 6:22 AM, Paul Benedict wrote: > Paul S.'s said the "negative" of using AutoCloseable is "it is no longer > clear whether a stream should be closed or not" (6/20). That's true because > the semantics of AutoCloseable indicates you have a resource that requires > closing. > > However, the choice to make MayHoldCloseableResource a sub-interface of > AutoClosable should be resisted. It's an inverted design. The Liskov > *substitution principle *says that sub-interfaces can't loosen the contracts > of their superinterface. Not quite. It says: - Preconditions cannot be strengthened in a subtype. - Postconditions cannot be weakened in a subtype. - Invariants of the supertype must be preserved in a subtype. Question is: what kind of property is "closeability"? > If anything, AutoCloseable should be subclass of this new > interface, which MIGHT hold a resource that requires closing. The current > choice is just plainly backwards. No what you just said is "plainly backwards". If AutoCloseable is a subtype of MHCR then you should be able to use an AC instance anywhere you use a MHCR. But valid code doesn't have to close a MHCR, so if you replace it with an AC which requires closing then you have broken code. Hence not substitutable, hence invalid inheritance relationship. But if anything this is just another variation of the Square/Rectangle inheritance fallacy. While you can define either as a specialization of the other, you can always violate substitutability by doing something that relies on the property that gets specialized. David ----- > > For the above reason stated, and for the fact the interface adds no new > functionality, it's superfluous. If the interface relationship can't be > inverted, then chuck it -- it does nothing anyway. At the least, keep the > annotation. > > Paul > > > On Thu, Jul 11, 2013 at 3:01 PM, Henry Jen wrote: > >> On 07/11/2013 01:13 AM, Florian Weimer wrote: >>> On 07/10/2013 11:30 PM, Henry Jen wrote: >>> >>>> A new interface, java.util.MayHoldCloseableResource, indicates an >>>> implementation may or may not hold a resource need to be closed. >>> >>> Why doesn't close() throw Exception? >> >> Because there is really much a developer can do on that situation. The >> API simply make it not throw a *checked* exception. >> >> See EG discussion on this topic, >> >> >> http://mail.openjdk.java.net/pipermail/lambda-libs-spec-experts/2013-June/002081.html >> >>> >>>> Annotation {@link HoldsResource} may be used to guide users/static >>>> analysis tools that a MHCR instance that definitely hold a Closeable >>>> resource. >>> >>> All this looks a bit odd to me. I suppose the idea is that you don't >>> want to give up the last reference to a closeable resource without >>> calling close()?and not leak references which out-live the call to >>> close(). This is definitely not a property of the type of the resource, >>> so I don't see why the MayHoldCloseableResource interface is needed (or >>> can confer relevant information). The HoldsResource annotation could be >>> useful, but based on the current documentation, it's not clear if it is >>> actually intended to express the data flow property. >>> >> >> I would suggest you look at EG discussion on this topic. The MHCR is >> different from AutoCloseable on the chances of holding critical resources. >> >> Perhaps that suggests the javadoc is not clear enough, I would like to >> know what is important and missing. >> >> Cheers, >> Henry >> >> >> > > From thomas.schatzl at oracle.com Fri Jul 12 11:23:37 2013 From: thomas.schatzl at oracle.com (Thomas Schatzl) Date: Fri, 12 Jul 2013 13:23:37 +0200 Subject: RFR (XS): 8014890 : Reference queues may return more entries than expected In-Reply-To: <51DFE713.6040008@oracle.com> References: <1371589723.2524.43.camel@cirrus> <51D0D0A2.7030307@oracle.com> <51D134FF.2080802@oracle.com> <1372673139.2769.14.camel@cirrus> <51D15679.2080407@oracle.com> <51D169E8.70601@oracle.com> <51D16B98.5010506@oracle.com> <1372679479.2769.44.camel@cirrus> <51DFE713.6040008@oracle.com> Message-ID: <1373628217.2669.17.camel@cirrus> Hi, On Fri, 2013-07-12 at 19:22 +0800, Mandy Chung wrote: > Hi Thomas, > > On 7/1/2013 7:51 PM, Thomas Schatzl wrote: > > I changed this in > > http://cr.openjdk.java.net/~tschatzl/8014890/webrev.refactor to that > > version now, using a temporary variable that stores r.queue before the > > checks to avoid the double volatile reads. > > This looks good. I have pushed this for you. Sorry for the delay as I > have been busy on other tasks. Thanks a lot everyone. Thomas From sean.coffey at oracle.com Fri Jul 12 13:14:34 2013 From: sean.coffey at oracle.com (=?ISO-8859-1?Q?Se=E1n_Coffey?=) Date: Fri, 12 Jul 2013 14:14:34 +0100 Subject: RFR : 8017566 : Backout 8000450 - Cannot access to com.sun.corba.se.impl.orb.ORBImpl Message-ID: <51E0013A.4070301@oracle.com> The recent 8000450 has caused issue for JCK testing and some RMI/JMX testing also.The CORBA package interaction between org.omg, com.sun.corba.se.spi, javax.rmi and other packages into com.sun.corba.se.impl classes needs better analysis and won't be complete for 7u40. It's rare to have security manager installed with CORBA app but we need to cater for it. The JCK testsuite tests this scenario but it doesn't have sufficient privileges in the stack when launching the CORBA server during test setup phase. None the less, it's something the JDK code should handle. The structure of the CORBA packages and users of it needs to be better scoped out. For now, I propose reversing the change for both jdk8 and jdk7u40. webrev : http://cr.openjdk.java.net/~coffeys/webrev.8000450.7u40/webrev/ regards, Sean. From pbenedict at apache.org Fri Jul 12 13:57:28 2013 From: pbenedict at apache.org (Paul Benedict) Date: Fri, 12 Jul 2013 08:57:28 -0500 Subject: RFR: 8017513: Support for closeable streams In-Reply-To: <51DFE6FF.60009@oracle.com> References: <51DDD261.5050406@oracle.com> <51DE6939.40202@redhat.com> <51DF0EFD.605@oracle.com> <51DFE6FF.60009@oracle.com> Message-ID: I see closeability as a postcondition. A subtype can't weaken it. The contract of AutoCloseable says its a resource that "must" be closed. Now MHCR says it can/should/doesn't have to be closed -- so it is backwards. On Fri, Jul 12, 2013 at 6:22 AM, David Holmes wrote: > On 12/07/2013 6:22 AM, Paul Benedict wrote: > >> Paul S.'s said the "negative" of using AutoCloseable is "it is no longer >> clear whether a stream should be closed or not" (6/20). That's true >> because >> the semantics of AutoCloseable indicates you have a resource that requires >> closing. >> >> However, the choice to make MayHoldCloseableResource a sub-interface of >> AutoClosable should be resisted. It's an inverted design. The Liskov >> *substitution principle *says that sub-interfaces can't loosen the >> contracts >> > > of their superinterface. > > Not quite. It says: > > - Preconditions cannot be strengthened in a subtype. > - Postconditions cannot be weakened in a subtype. > - Invariants of the supertype must be preserved in a subtype. > > Question is: what kind of property is "closeability"? > > > If anything, AutoCloseable should be subclass of this new >> interface, which MIGHT hold a resource that requires closing. The current >> choice is just plainly backwards. >> > > No what you just said is "plainly backwards". If AutoCloseable is a > subtype of MHCR then you should be able to use an AC instance anywhere you > use a MHCR. But valid code doesn't have to close a MHCR, so if you replace > it with an AC which requires closing then you have broken code. Hence not > substitutable, hence invalid inheritance relationship. > > But if anything this is just another variation of the Square/Rectangle > inheritance fallacy. While you can define either as a specialization of the > other, you can always violate substitutability by doing something that > relies on the property that gets specialized. > > David > ----- > > > >> For the above reason stated, and for the fact the interface adds no new >> functionality, it's superfluous. If the interface relationship can't be >> inverted, then chuck it -- it does nothing anyway. At the least, keep the >> annotation. >> >> Paul >> >> >> On Thu, Jul 11, 2013 at 3:01 PM, Henry Jen wrote: >> >> On 07/11/2013 01:13 AM, Florian Weimer wrote: >>> >>>> On 07/10/2013 11:30 PM, Henry Jen wrote: >>>> >>>> A new interface, java.util.**MayHoldCloseableResource, indicates an >>>>> implementation may or may not hold a resource need to be closed. >>>>> >>>> >>>> Why doesn't close() throw Exception? >>>> >>> >>> Because there is really much a developer can do on that situation. The >>> API simply make it not throw a *checked* exception. >>> >>> See EG discussion on this topic, >>> >>> >>> http://mail.openjdk.java.net/**pipermail/lambda-libs-spec-** >>> experts/2013-June/002081.html >>> >>> >>>> Annotation {@link HoldsResource} may be used to guide users/static >>>>> analysis tools that a MHCR instance that definitely hold a Closeable >>>>> resource. >>>>> >>>> >>>> All this looks a bit odd to me. I suppose the idea is that you don't >>>> want to give up the last reference to a closeable resource without >>>> calling close()?and not leak references which out-live the call to >>>> close(). This is definitely not a property of the type of the resource, >>>> so I don't see why the MayHoldCloseableResource interface is needed (or >>>> can confer relevant information). The HoldsResource annotation could be >>>> useful, but based on the current documentation, it's not clear if it is >>>> actually intended to express the data flow property. >>>> >>>> >>> I would suggest you look at EG discussion on this topic. The MHCR is >>> different from AutoCloseable on the chances of holding critical >>> resources. >>> >>> Perhaps that suggests the javadoc is not clear enough, I would like to >>> know what is important and missing. >>> >>> Cheers, >>> Henry >>> >>> >>> >>> >> >> -- Cheers, Paul From sundararajan.athijegannathan at oracle.com Fri Jul 12 15:22:59 2013 From: sundararajan.athijegannathan at oracle.com (sundararajan.athijegannathan at oracle.com) Date: Fri, 12 Jul 2013 15:22:59 +0000 Subject: hg: jdk8/tl/nashorn: 18 new changesets Message-ID: <20130712152315.667E148A38@hg.openjdk.java.net> Changeset: 5106d43feed7 Author: hannesw Date: 2013-07-08 19:34 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/5106d43feed7 8019963: empty char range in regex Reviewed-by: jlaskey, sundar ! src/jdk/nashorn/internal/runtime/regexp/joni/CodeRangeBuffer.java ! src/jdk/nashorn/internal/runtime/regexp/joni/Parser.java + test/script/basic/JDK-8019963.js + test/script/basic/JDK-8019963.js.EXPECTED Changeset: d3f4e5dea634 Author: attila Date: 2013-07-09 13:57 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/d3f4e5dea634 8009758: reactivate the 8006529 test. Reviewed-by: jlaskey, sundar ! src/jdk/nashorn/internal/codegen/Attr.java ! src/jdk/nashorn/internal/codegen/CompilerConstants.java ! src/jdk/nashorn/internal/codegen/ObjectClassGenerator.java ! src/jdk/nashorn/internal/codegen/types/Type.java ! src/jdk/nashorn/internal/runtime/AccessorProperty.java ! src/jdk/nashorn/internal/runtime/FunctionScope.java - test/script/currently-failing/JDK-8006529.js + test/script/trusted/JDK-8006529.js Changeset: 7538a59ca241 Author: sundar Date: 2013-07-09 17:37 +0530 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/7538a59ca241 8014785: Ability to extend global instance by binding properties of another object Reviewed-by: attila, hannesw, jlaskey, lagergren ! src/jdk/nashorn/internal/objects/NativeObject.java ! src/jdk/nashorn/internal/runtime/AccessorProperty.java ! src/jdk/nashorn/internal/runtime/Context.java ! src/jdk/nashorn/internal/runtime/PropertyMap.java ! src/jdk/nashorn/internal/runtime/ScriptObject.java ! src/jdk/nashorn/internal/runtime/linker/InvokeByName.java + test/script/basic/JDK-8014785.js + test/script/basic/JDK-8014785.js.EXPECTED Changeset: d480015ab732 Author: lagergren Date: 2013-07-09 15:56 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/d480015ab732 8020124: In the case of an eval switch, we might need explicit conversions of the tag store, as it was not known in the surrounding environment. Reviewed-by: sundar, jlaskey ! src/jdk/nashorn/internal/codegen/CodeGenerator.java + test/script/basic/JDK-8020124.js Changeset: 997a3215744a Author: sundar Date: 2013-07-10 13:25 +0530 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/997a3215744a 8020224: LinkageError: attempted duplicate class definition when --loader-per-compiler=false Reviewed-by: hannesw ! src/jdk/nashorn/internal/codegen/Compiler.java ! src/jdk/nashorn/internal/runtime/CodeInstaller.java ! src/jdk/nashorn/internal/runtime/Context.java ! test/src/jdk/nashorn/internal/runtime/TrustedScriptEngineTest.java Changeset: a9b74daed4f9 Author: hannesw Date: 2013-07-10 10:54 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/a9b74daed4f9 8016681: regex capture behaves differently than on V8 Reviewed-by: lagergren, sundar ! src/jdk/nashorn/internal/runtime/regexp/RegExpScanner.java + test/script/basic/JDK-8016681.js + test/script/basic/JDK-8016681.js.EXPECTED Changeset: c501b1666bda Author: sundar Date: 2013-07-10 19:08 +0530 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/c501b1666bda 8020276: interface checks in Invocable.getInterface implementation Reviewed-by: jlaskey, hannesw, attila ! src/jdk/nashorn/api/scripting/NashornScriptEngine.java ! src/jdk/nashorn/internal/runtime/Context.java ! src/jdk/nashorn/internal/runtime/linker/JavaAdapterFactory.java ! test/src/jdk/nashorn/api/scripting/ScriptEngineTest.java Changeset: 798e3aa19718 Author: sundar Date: 2013-07-11 16:34 +0530 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/798e3aa19718 8020325: static property does not work on accessible, public classes Reviewed-by: attila, hannesw, lagergren ! make/build.xml ! src/jdk/nashorn/api/scripting/NashornScriptEngine.java ! src/jdk/nashorn/internal/codegen/CodeGenerator.java ! src/jdk/nashorn/internal/codegen/Compiler.java ! src/jdk/nashorn/internal/lookup/Lookup.java ! src/jdk/nashorn/internal/objects/NativeDebug.java ! src/jdk/nashorn/internal/objects/NativeNumber.java ! src/jdk/nashorn/internal/objects/ScriptFunctionImpl.java ! src/jdk/nashorn/internal/runtime/Context.java ! src/jdk/nashorn/internal/runtime/linker/JavaAdapterFactory.java ! src/jdk/nashorn/internal/runtime/linker/ReflectionCheckLinker.java + test/script/basic/JDK-8020325.js + test/script/basic/JDK-8020325.js.EXPECTED ! test/script/trusted/JDK-8006529.js ! test/src/jdk/nashorn/api/scripting/ScriptEngineTest.java Changeset: 58614b556a0d Author: sundar Date: 2013-07-11 18:23 +0530 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/58614b556a0d 8020380: __noSuchProperty__ defined in mozilla_compat.js script should be non-enumerable Reviewed-by: jlaskey, hannesw, attila ! src/jdk/nashorn/internal/runtime/resources/mozilla_compat.js + test/script/basic/JDK-8020380.js Changeset: 2c007a8bb0e7 Author: attila Date: 2013-07-11 18:33 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/2c007a8bb0e7 8013925: Remove symbol fields from nodes that don't need them Reviewed-by: jlaskey, lagergren ! src/jdk/nashorn/internal/codegen/Attr.java ! src/jdk/nashorn/internal/codegen/BranchOptimizer.java ! src/jdk/nashorn/internal/codegen/CodeGenerator.java ! src/jdk/nashorn/internal/codegen/CompilationPhase.java ! src/jdk/nashorn/internal/codegen/FinalizeTypes.java ! src/jdk/nashorn/internal/codegen/FoldConstants.java ! src/jdk/nashorn/internal/codegen/FunctionSignature.java ! src/jdk/nashorn/internal/codegen/Lower.java ! src/jdk/nashorn/internal/codegen/RangeAnalyzer.java ! src/jdk/nashorn/internal/codegen/SpillObjectCreator.java ! src/jdk/nashorn/internal/codegen/Splitter.java ! src/jdk/nashorn/internal/codegen/WeighNodes.java ! src/jdk/nashorn/internal/ir/AccessNode.java ! src/jdk/nashorn/internal/ir/Assignment.java ! src/jdk/nashorn/internal/ir/BaseNode.java ! src/jdk/nashorn/internal/ir/BinaryNode.java ! src/jdk/nashorn/internal/ir/Block.java + src/jdk/nashorn/internal/ir/BlockStatement.java ! src/jdk/nashorn/internal/ir/BreakableNode.java + src/jdk/nashorn/internal/ir/BreakableStatement.java ! src/jdk/nashorn/internal/ir/CallNode.java ! src/jdk/nashorn/internal/ir/CaseNode.java ! src/jdk/nashorn/internal/ir/CatchNode.java - src/jdk/nashorn/internal/ir/ExecuteNode.java + src/jdk/nashorn/internal/ir/Expression.java + src/jdk/nashorn/internal/ir/ExpressionStatement.java ! src/jdk/nashorn/internal/ir/ForNode.java ! src/jdk/nashorn/internal/ir/FunctionNode.java ! src/jdk/nashorn/internal/ir/IdentNode.java ! src/jdk/nashorn/internal/ir/IfNode.java ! src/jdk/nashorn/internal/ir/IndexNode.java ! src/jdk/nashorn/internal/ir/LabelNode.java ! src/jdk/nashorn/internal/ir/LexicalContext.java + src/jdk/nashorn/internal/ir/LexicalContextExpression.java ! src/jdk/nashorn/internal/ir/LexicalContextNode.java + src/jdk/nashorn/internal/ir/LexicalContextStatement.java ! src/jdk/nashorn/internal/ir/LiteralNode.java ! src/jdk/nashorn/internal/ir/LoopNode.java ! src/jdk/nashorn/internal/ir/Node.java ! src/jdk/nashorn/internal/ir/ObjectNode.java ! src/jdk/nashorn/internal/ir/PropertyNode.java ! src/jdk/nashorn/internal/ir/ReturnNode.java ! src/jdk/nashorn/internal/ir/RuntimeNode.java ! src/jdk/nashorn/internal/ir/SplitNode.java ! src/jdk/nashorn/internal/ir/SwitchNode.java ! src/jdk/nashorn/internal/ir/TemporarySymbols.java ! src/jdk/nashorn/internal/ir/TernaryNode.java ! src/jdk/nashorn/internal/ir/ThrowNode.java ! src/jdk/nashorn/internal/ir/UnaryNode.java ! src/jdk/nashorn/internal/ir/VarNode.java ! src/jdk/nashorn/internal/ir/WhileNode.java ! src/jdk/nashorn/internal/ir/WithNode.java ! src/jdk/nashorn/internal/ir/debug/ASTWriter.java ! src/jdk/nashorn/internal/ir/debug/JSONWriter.java ! src/jdk/nashorn/internal/ir/debug/PrintVisitor.java ! src/jdk/nashorn/internal/ir/visitor/NodeOperatorVisitor.java ! src/jdk/nashorn/internal/ir/visitor/NodeVisitor.java ! src/jdk/nashorn/internal/parser/JSONParser.java ! src/jdk/nashorn/internal/parser/Parser.java ! src/jdk/nashorn/internal/runtime/linker/NashornCallSiteDescriptor.java ! test/script/trusted/JDK-8006529.js Changeset: 9083af56bbcb Author: sundar Date: 2013-07-11 22:58 +0530 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/9083af56bbcb 8012191: noSuchProperty can't cope with vararg functions Reviewed-by: jlaskey, attila ! src/jdk/nashorn/internal/runtime/ScriptFunction.java + test/script/basic/JDK-8012191.js + test/script/basic/JDK-8012191.js.EXPECTED Changeset: 289923785ada Author: attila Date: 2013-07-11 22:01 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/289923785ada 8020125: PrintVisitor wasn't printing bodies of FunctionNode within UnaryNode Reviewed-by: jlaskey, lagergren ! src/jdk/nashorn/internal/ir/UnaryNode.java ! src/jdk/nashorn/internal/ir/debug/PrintVisitor.java Changeset: d763da247244 Author: sundar Date: 2013-07-12 15:01 +0530 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/d763da247244 8020437: Wrong handling of line numbers with multiline string literals Reviewed-by: attila, lagergren ! src/jdk/nashorn/internal/parser/Lexer.java ! src/jdk/nashorn/internal/parser/Parser.java + test/script/basic/JDK-8020437.js + test/script/basic/JDK-8020437.js.EXPECTED + test/script/error/JDK-8020437-2.js + test/script/error/JDK-8020437-2.js.EXPECTED + test/script/error/JDK-8020437.js + test/script/error/JDK-8020437.js.EXPECTED Changeset: 1a6b1799f533 Author: sundar Date: 2013-07-12 15:27 +0530 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/1a6b1799f533 8020223: ClassCastException: String can not be casted to ScriptFunction Reviewed-by: attila, lagergren ! src/jdk/nashorn/internal/objects/NativeJSAdapter.java ! src/jdk/nashorn/internal/runtime/ScriptObject.java + test/script/basic/JDK-8020223.js Changeset: e27ebcfed6fa Author: attila Date: 2013-07-12 11:58 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/e27ebcfed6fa 8019822: Duplicate name and signature in finally block Reviewed-by: jlaskey, sundar ! src/jdk/nashorn/internal/codegen/CodeGenerator.java + test/script/basic/JDK-8019822.js Changeset: 8108ba8366fd Author: sundar Date: 2013-07-12 20:12 +0530 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/8108ba8366fd Merge - src/jdk/nashorn/internal/ir/ExecuteNode.java - test/script/currently-failing/JDK-8006529.js Changeset: 5cdf4352ee0b Author: sundar Date: 2013-07-12 20:06 +0530 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/5cdf4352ee0b 8020463: Input argument array wrapping in loadWithNewGlobal is wrong Reviewed-by: attila, jlaskey ! src/jdk/nashorn/api/scripting/ScriptObjectMirror.java ! src/jdk/nashorn/internal/runtime/Context.java + test/script/basic/JDK-8020463.js ! test/src/jdk/nashorn/api/scripting/ScriptEngineSecurityTest.java ! test/src/jdk/nashorn/api/scripting/ScriptEngineTest.java Changeset: cbfeffbcd3f2 Author: sundar Date: 2013-07-12 20:13 +0530 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/cbfeffbcd3f2 Merge From zhong.j.yu at gmail.com Fri Jul 12 15:53:50 2013 From: zhong.j.yu at gmail.com (Zhong Yu) Date: Fri, 12 Jul 2013 10:53:50 -0500 Subject: RFR: 8017513: Support for closeable streams In-Reply-To: <51DFCCC7.8080502@gmail.com> References: <51DDD261.5050406@oracle.com> <51DE6939.40202@redhat.com> <51DF0EFD.605@oracle.com> <51DF1EDE.2040501@gmail.com> <51DFCCC7.8080502@gmail.com> Message-ID: On Fri, Jul 12, 2013 at 4:30 AM, Peter Levart wrote: > On 07/12/2013 01:14 AM, Zhong Yu wrote: > > On Thu, Jul 11, 2013 at 4:08 PM, Peter Levart > wrote: > > Hi Paul, > > I think the MayHoldCloseableResource extends AutoClosable is correct and > AutoClosable extends MayHoldCloseableResource would be wrong. > > And exactly because of "Liskov": > > MayHoldCloseableResource contract says: "If you know it holds a resource, > call close(), otherwise you need not call close(), but it's not wrong to > call it anyway - you know whether it holds resource by looking at > @HoldsResource annotation" > > AutoClosable contract says: "It holds a resource, you should call close()" > > > Now imagine code that was written for the AutoClosable contract. Would it > work if you pass it an instance of MayHoldCloseableResource? Allways. > > Now imagine generic code that was written for MayHoldCloseableResource > contract and which uses the lookup of @HoldsResource at runtime to decide > > How do you lookup an annotation on an _instance_ at runtime? > > > Hi Zhong (and Roger), > > Well, if @HoldsResource had RUNTIME retention, then by using: > > instance.getClass(), ... clazz.getSuperclass(), getInterfaces(), ... etc. > > > And why > do we even care? Just call close() regardless. > > > I was just trying to illustrate a hypothetical code that works with > MayHoldCloseableResource contract and breaks if AutoCloseable is passed to > it. In case AutoCloseable was a subtype of MayHoldCloseableResource, > considering Liskov substitution principle, it should work: "if S is a > subtype of T, then objects of type T may be replaced with objects of type S > (i.e., objects of type S may be substituted for objects of type T) without > altering any of the desirable properties of that program (correctness, task > performed, etc.)". In reality the decision about calling or not calling the > close() is hard-coded by the programmer, guided by static analysis tools, > IDEs and so on, but that doesn't change the reasoning. > > > > And we can revert the parent/child relation, because the "otherwise > specified" clause is a panacea. > > Could you elaborate that? A supertype can be very vague on its contract, making it possible that subtypes of vast different behaviors can all be compatible with the super type. Consider this design interface PseudoCloseable /** no need to call close(), * unless otherwise specified, then must call close(). * safe to call close() even if there's no need to call it. void close(); interface AutoCloseable extends PseudoCloseable /** must call close * unless otherwise specified, then no need to call close() * safe to call close() even if there's no need to call it. void close(); class ByteArrayInputStream extends Closeable /** has no effect void close(); It works as well/badly as the official design. Zhong Yu > > > Regards, Peter > > > > Zhong Yu > > > whether to call close() or not. Would it work if you pass it an instance of > AutoClosable? Never (since AutoClosable says nothing about any annotation). > > So I argue that MayHoldCloseableResource should be a subtype of AutoClosable > and not the other way around. > > (I have not said anything about whether the MayHoldCloseableResource is > actually needed or not.) > > > Regards, Peter > > > > On 07/11/2013 10:22 PM, Paul Benedict wrote: > > Paul S.'s said the "negative" of using AutoCloseable is "it is no longer > clear whether a stream should be closed or not" (6/20). That's true > because > the semantics of AutoCloseable indicates you have a resource that requires > closing. > > However, the choice to make MayHoldCloseableResource a sub-interface of > AutoClosable should be resisted. It's an inverted design. The Liskov > *substitution > principle *says that sub-interfaces can't loosen the contracts of their > superinterface. If anything, AutoCloseable should be subclass of this new > interface, which MIGHT hold a resource that requires closing. The current > choice is just plainly backwards. > > For the above reason stated, and for the fact the interface adds no new > functionality, it's superfluous. If the interface relationship can't be > inverted, then chuck it -- it does nothing anyway. At the least, keep the > annotation. > > Paul > > > On Thu, Jul 11, 2013 at 3:01 PM, Henry Jen wrote: > > On 07/11/2013 01:13 AM, Florian Weimer wrote: > > On 07/10/2013 11:30 PM, Henry Jen wrote: > > A new interface, java.util.MayHoldCloseableResource, indicates an > implementation may or may not hold a resource need to be closed. > > Why doesn't close() throw Exception? > > Because there is really much a developer can do on that situation. The > API simply make it not throw a *checked* exception. > > See EG discussion on this topic, > > > > http://mail.openjdk.java.net/pipermail/lambda-libs-spec-experts/2013-June/002081.html > > Annotation {@link HoldsResource} may be used to guide users/static > analysis tools that a MHCR instance that definitely hold a Closeable > resource. > > All this looks a bit odd to me. I suppose the idea is that you don't > want to give up the last reference to a closeable resource without > calling close()?and not leak references which out-live the call to > close(). This is definitely not a property of the type of the resource, > so I don't see why the MayHoldCloseableResource interface is needed (or > can confer relevant information). The HoldsResource annotation could be > useful, but based on the current documentation, it's not clear if it is > actually intended to express the data flow property. > > I would suggest you look at EG discussion on this topic. The MHCR is > different from AutoCloseable on the chances of holding critical > resources. > > Perhaps that suggests the javadoc is not clear enough, I would like to > know what is important and missing. > > Cheers, > Henry > > > > From zhong.j.yu at gmail.com Fri Jul 12 16:01:38 2013 From: zhong.j.yu at gmail.com (Zhong Yu) Date: Fri, 12 Jul 2013 11:01:38 -0500 Subject: RFR: 8017513: Support for closeable streams In-Reply-To: <51DFE6FF.60009@oracle.com> References: <51DDD261.5050406@oracle.com> <51DE6939.40202@redhat.com> <51DF0EFD.605@oracle.com> <51DFE6FF.60009@oracle.com> Message-ID: On Fri, Jul 12, 2013 at 6:22 AM, David Holmes wrote: > On 12/07/2013 6:22 AM, Paul Benedict wrote: >> >> Paul S.'s said the "negative" of using AutoCloseable is "it is no longer >> clear whether a stream should be closed or not" (6/20). That's true >> because >> the semantics of AutoCloseable indicates you have a resource that requires >> closing. >> >> However, the choice to make MayHoldCloseableResource a sub-interface of >> AutoClosable should be resisted. It's an inverted design. The Liskov >> *substitution principle *says that sub-interfaces can't loosen the >> contracts > >> of their superinterface. > > Not quite. It says: > > - Preconditions cannot be strengthened in a subtype. > - Postconditions cannot be weakened in a subtype. > - Invariants of the supertype must be preserved in a subtype. > > Question is: what kind of property is "closeability"? > > >> If anything, AutoCloseable should be subclass of this new >> interface, which MIGHT hold a resource that requires closing. The current >> choice is just plainly backwards. > > > No what you just said is "plainly backwards". If AutoCloseable is a subtype > of MHCR then you should be able to use an AC instance anywhere you use a > MHCR. But valid code doesn't have to close a MHCR, so if you replace it with If the only information we have is that the object is a MHCR, we must close it. If we have other information, e.g. it's a Stream is from an ArrayList, then we may omit the close() call. The annotation @HoldsResource is meant to add extra information; particularly, *lack* of the annotation is meant to be a definitive information that close() can be omitted ! That's incredibly brittle. Zhong Yu > an AC which requires closing then you have broken code. Hence not > substitutable, hence invalid inheritance relationship. > > But if anything this is just another variation of the Square/Rectangle > inheritance fallacy. While you can define either as a specialization of the > other, you can always violate substitutability by doing something that > relies on the property that gets specialized. > > David > ----- > > >> >> For the above reason stated, and for the fact the interface adds no new >> functionality, it's superfluous. If the interface relationship can't be >> inverted, then chuck it -- it does nothing anyway. At the least, keep the >> annotation. >> >> Paul >> >> >> On Thu, Jul 11, 2013 at 3:01 PM, Henry Jen wrote: >> >>> On 07/11/2013 01:13 AM, Florian Weimer wrote: >>>> >>>> On 07/10/2013 11:30 PM, Henry Jen wrote: >>>> >>>>> A new interface, java.util.MayHoldCloseableResource, indicates an >>>>> implementation may or may not hold a resource need to be closed. >>>> >>>> >>>> Why doesn't close() throw Exception? >>> >>> >>> Because there is really much a developer can do on that situation. The >>> API simply make it not throw a *checked* exception. >>> >>> See EG discussion on this topic, >>> >>> >>> >>> http://mail.openjdk.java.net/pipermail/lambda-libs-spec-experts/2013-June/002081.html >>> >>>> >>>>> Annotation {@link HoldsResource} may be used to guide users/static >>>>> analysis tools that a MHCR instance that definitely hold a Closeable >>>>> resource. >>>> >>>> >>>> All this looks a bit odd to me. I suppose the idea is that you don't >>>> want to give up the last reference to a closeable resource without >>>> calling close()?and not leak references which out-live the call to >>>> close(). This is definitely not a property of the type of the resource, >>>> so I don't see why the MayHoldCloseableResource interface is needed (or >>>> can confer relevant information). The HoldsResource annotation could be >>>> useful, but based on the current documentation, it's not clear if it is >>>> actually intended to express the data flow property. >>>> >>> >>> I would suggest you look at EG discussion on this topic. The MHCR is >>> different from AutoCloseable on the chances of holding critical >>> resources. >>> >>> Perhaps that suggests the javadoc is not clear enough, I would like to >>> know what is important and missing. >>> >>> Cheers, >>> Henry >>> >>> >>> >> >> > From huizhe.wang at oracle.com Fri Jul 12 17:06:55 2013 From: huizhe.wang at oracle.com (huizhe wang) Date: Fri, 12 Jul 2013 10:06:55 -0700 Subject: RFR: (JAXP) 8020430 : NullPointerException in xml sqe nightly result on 2013-07-12 In-Reply-To: References: <51DFC567.3070902@oracle.com> Message-ID: <51E037AF.7010100@oracle.com> On 7/12/2013 2:44 AM, Chris Hegarty wrote: > The source changes look fine to me. > > The tests should be located elsewhere, otherwise they will collide with an Oracle internal repo. Say jdk/test/jaxp? Ah, I accidentally placed them together with those original tests. There's a place holder for jaxp: jdk/test/javax/xml/jaxp. A longer term goal may be to migrate tests to the jaxp repo. -Joe > > As an aside, I plan to move the jaxws tests to a similar holding area, jdk/test/jaxws. They can then follow the appropriate package structure. > > -Chris > > On 12 Jul 2013, at 09:59, huizhe wang wrote: > >> Hi, >> >> This is a quick fix on a regression caused by 8016648. The new property manager added to handle the new jaxp 1.5 properties is only created for the input and event factories. For the output factory therefore, there should have a null-check. I've run the tests used in the nightly build with a local build, all passed with this patch. >> >> webrev: >> http://cr.openjdk.java.net/~joehw/jdk8/8020430/webrev/ >> >> Thanks, >> Joe From dl at cs.oswego.edu Fri Jul 12 17:07:35 2013 From: dl at cs.oswego.edu (Doug Lea) Date: Fri, 12 Jul 2013 13:07:35 -0400 Subject: class SplittableRandom In-Reply-To: <51DDB26D.8050506@cs.oswego.edu> References: <51DDB26D.8050506@cs.oswego.edu> Message-ID: <51E037D7.3040305@cs.oswego.edu> [Also posted on concurrency-interest.] Thanks to all those sending quick feedback, both on and off lists! We're increasingly confident about the value of adding SplittableRandom, so will proceed with integration request. I'm sure that we'll introduce incremental improvements during OpenJDK8 bake-in phase, and apply some of the lessons learned to other code. But we wanted to ensure that this is at least considered for inclusion along with last of the other jsr166-related updates (that are all currently in-process). Paul Sandoz will follow up on core-libs-dev with the CR details, on his way out to a well-deserved vacation. So I may request help from others for any Oracle process issues that might arise. The CR is far from the end of this process, so I also plan to post follow-ups as it progresses. -Doug From huizhe.wang at oracle.com Fri Jul 12 17:09:38 2013 From: huizhe.wang at oracle.com (huizhe wang) Date: Fri, 12 Jul 2013 10:09:38 -0700 Subject: RFR: (JAXP) 8020430 : NullPointerException in xml sqe nightly result on 2013-07-12 In-Reply-To: <88E5A207-A25D-48F3-AC68-941468821F1C@oracle.com> References: <51DFC567.3070902@oracle.com> <88E5A207-A25D-48F3-AC68-941468821F1C@oracle.com> Message-ID: <51E03852.2020004@oracle.com> On 7/12/2013 3:30 AM, Lance Andersen - Oracle wrote: > The fix looks fine to me Joe as does the test. I assume you will go with Chris's plan below for the test locations? It will be jdk/test/javax/xml/jaxp, that is the location for all jaxp tests for now. We will look into migrating jaxp tests to the jaxp repo. Thanks, Joe > > Best > Lance > On Jul 12, 2013, at 5:44 AM, Chris Hegarty wrote: > >> The source changes look fine to me. >> >> The tests should be located elsewhere, otherwise they will collide with an Oracle internal repo. Say jdk/test/jaxp? >> >> As an aside, I plan to move the jaxws tests to a similar holding area, jdk/test/jaxws. They can then follow the appropriate package structure. >> >> -Chris >> >> On 12 Jul 2013, at 09:59, huizhe wang wrote: >> >>> Hi, >>> >>> This is a quick fix on a regression caused by 8016648. The new property manager added to handle the new jaxp 1.5 properties is only created for the input and event factories. For the output factory therefore, there should have a null-check. I've run the tests used in the nightly build with a local build, all passed with this patch. >>> >>> webrev: >>> http://cr.openjdk.java.net/~joehw/jdk8/8020430/webrev/ >>> >>> Thanks, >>> Joe > > > Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 > Oracle Java Engineering > 1 Network Drive > Burlington, MA 01803 > Lance.Andersen at oracle.com > From brian.goetz at oracle.com Fri Jul 12 17:25:24 2013 From: brian.goetz at oracle.com (Brian Goetz) Date: Fri, 12 Jul 2013 13:25:24 -0400 Subject: RFR: 8017513: Support for closeable streams In-Reply-To: <51DF20F5.3090700@oracle.com> References: <51DDD261.5050406@oracle.com> <51DE6939.40202@redhat.com> <51DF0EFD.605@oracle.com> <51DF1EDE.2040501@gmail.com> <51DF20F5.3090700@oracle.com> Message-ID: <51E03C04.5090002@oracle.com> The whole reflection thing is a red herring. As is the performance thing. The reason not to call close() has nothing to do with the expensive of calling close; it is about not mucking up your code for no reason. Consider: list.stream() .filter(s -> s.startsWith("foo")) .map(String::toUpperCase) .collect(toList()); vs List Hi, > > Wouldn't the close() implementation be nil in most cases if there was no > resource. > That kind of method runs very quickly and I would expect the compiler to > inline nothing. > > It would be quicker to just call close() than to engage reflection to > determine > if it really did and then decide to call it. Or am I missing some point > about > generating code or in some cases not needing/wanting to close it? > > Roger > > > > On 7/11/2013 5:08 PM, Peter Levart wrote: >> Hi Paul, >> >> I think the MayHoldCloseableResource extends AutoClosable is correct >> and AutoClosable extends MayHoldCloseableResource would be wrong. >> >> And exactly because of "Liskov": >> >> MayHoldCloseableResource contract says: "If you know it holds a >> resource, call close(), otherwise you need not call close(), but it's >> not wrong to call it anyway - you know whether it holds resource by >> looking at @HoldsResource annotation" >> >> AutoClosable contract says: "It holds a resource, you should call >> close()" >> >> >> Now imagine code that was written for the AutoClosable contract. Would >> it work if you pass it an instance of MayHoldCloseableResource? Allways. >> >> Now imagine generic code that was written for MayHoldCloseableResource >> contract and which uses the lookup of @HoldsResource at runtime to >> decide whether to call close() or not. Would it work if you pass it an >> instance of AutoClosable? Never (since AutoClosable says nothing about >> any annotation). >> >> So I argue that MayHoldCloseableResource should be a subtype of >> AutoClosable and not the other way around. >> >> (I have not said anything about whether the MayHoldCloseableResource >> is actually needed or not.) >> >> >> Regards, Peter >> >> >> On 07/11/2013 10:22 PM, Paul Benedict wrote: >>> Paul S.'s said the "negative" of using AutoCloseable is "it is no longer >>> clear whether a stream should be closed or not" (6/20). That's true >>> because >>> the semantics of AutoCloseable indicates you have a resource that >>> requires >>> closing. >>> >>> However, the choice to make MayHoldCloseableResource a sub-interface of >>> AutoClosable should be resisted. It's an inverted design. The Liskov >>> *substitution >>> principle *says that sub-interfaces can't loosen the contracts of their >>> superinterface. If anything, AutoCloseable should be subclass of this >>> new >>> interface, which MIGHT hold a resource that requires closing. The >>> current >>> choice is just plainly backwards. >>> >>> For the above reason stated, and for the fact the interface adds no new >>> functionality, it's superfluous. If the interface relationship can't be >>> inverted, then chuck it -- it does nothing anyway. At the least, keep >>> the >>> annotation. >>> >>> Paul >>> >>> >>> On Thu, Jul 11, 2013 at 3:01 PM, Henry Jen wrote: >>> >>>> On 07/11/2013 01:13 AM, Florian Weimer wrote: >>>>> On 07/10/2013 11:30 PM, Henry Jen wrote: >>>>> >>>>>> A new interface, java.util.MayHoldCloseableResource, indicates an >>>>>> implementation may or may not hold a resource need to be closed. >>>>> Why doesn't close() throw Exception? >>>> Because there is really much a developer can do on that situation. The >>>> API simply make it not throw a *checked* exception. >>>> >>>> See EG discussion on this topic, >>>> >>>> >>>> http://mail.openjdk.java.net/pipermail/lambda-libs-spec-experts/2013-June/002081.html >>>> >>>> >>>>>> Annotation {@link HoldsResource} may be used to guide users/static >>>>>> analysis tools that a MHCR instance that definitely hold a Closeable >>>>>> resource. >>>>> All this looks a bit odd to me. I suppose the idea is that you don't >>>>> want to give up the last reference to a closeable resource without >>>>> calling close()?and not leak references which out-live the call to >>>>> close(). This is definitely not a property of the type of the >>>>> resource, >>>>> so I don't see why the MayHoldCloseableResource interface is needed >>>>> (or >>>>> can confer relevant information). The HoldsResource annotation >>>>> could be >>>>> useful, but based on the current documentation, it's not clear if >>>>> it is >>>>> actually intended to express the data flow property. >>>>> >>>> I would suggest you look at EG discussion on this topic. The MHCR is >>>> different from AutoCloseable on the chances of holding critical >>>> resources. >>>> >>>> Perhaps that suggests the javadoc is not clear enough, I would like to >>>> know what is important and missing. >>>> >>>> Cheers, >>>> Henry >>>> >>>> >>>> >> > From paul.sandoz at oracle.com Fri Jul 12 17:26:08 2013 From: paul.sandoz at oracle.com (Paul Sandoz) Date: Fri, 12 Jul 2013 19:26:08 +0200 Subject: RFR 8020292 :Re: class SplittableRandom In-Reply-To: <51E037D7.3040305@cs.oswego.edu> References: <51DDB26D.8050506@cs.oswego.edu> <51E037D7.3040305@cs.oswego.edu> Message-ID: <7B80D649-A0D5-426D-A341-41ED818126C3@oracle.com> Hi, Thanks Doug. Here is the webrev: http://cr.openjdk.java.net/~psandoz/tl/JDK-8020292-splittable-random/webrev/ Paul. On Jul 12, 2013, at 7:07 PM, Doug Lea
wrote: > [Also posted on concurrency-interest.] > > Thanks to all those sending quick feedback, both on and off lists! > We're increasingly confident about the value of adding > SplittableRandom, so will proceed with integration request. I'm sure > that we'll introduce incremental improvements during OpenJDK8 bake-in > phase, and apply some of the lessons learned to other code. But we > wanted to ensure that this is at least considered for inclusion along > with last of the other jsr166-related updates (that are all currently > in-process). > > Paul Sandoz will follow up on core-libs-dev with the CR details, on > his way out to a well-deserved vacation. So I may request help from > others for any Oracle process issues that might arise. The CR is far > from the end of this process, so I also plan to post follow-ups as it > progresses. > > -Doug > From xueming.shen at oracle.com Fri Jul 12 17:40:00 2013 From: xueming.shen at oracle.com (Xueming Shen) Date: Fri, 12 Jul 2013 10:40:00 -0700 Subject: RFR: 8016025 JSR 310: DateTime API Updates IV Message-ID: <51E03F70.2040701@oracle.com> Hi Please help review the update for the JSR310 DateTime API updates IV http://cr.openjdk.java.net/~sherman/8016025/webrev/ Here is the summary of the updates included in this round of API update: - Remove type parameter from ChronoLocalDate as unnecessary to simplify API and usage - Rename Temporal.periodUntil to until() and in all implementations - Added Temporal.isSupported(TemporalUnit) as a complement to TemporalAccessor.isSupported(TemporalField) - Add support for lenient parsing mechanism with Chronology.resolveDate, in subclasses and in TemporalField. - Add parsing support in Period for ISO week strings - Remove Temporal/getName and ChronoField.getName (redundant with toString and ChronoField.name method) - ChronoField.DAY_OF_YEAR clarified in case of Calendars and Eras whose start day varies from year to year as in Japanese eras. - TemporalUnit and ChronoUnit.isDateUnit and isTimeUnit methods renamed to isDateBased and isTimeBased. - Move static methods in java.time.temporal.Adjusters to Adjuster interface and remove class Adjusters - Move static methods in java.time.temporal.Queries to TemporalQuery and remove class Queries - Changed OffsetDateTime.INSTANT_COMPARATOR froma field to a method - WeekFields updated to specific the lenient resolution modes - DateTimeFormatterBuilder cleanup of parsing of ZoneIds to match ZoneId.of syntax. - HijrahChronology updated the syntax for the BCP 47 based locale string to use "-u-ca-islamic-umalqura" - IsoChronology - narrowed the return type of getEra to IsoEra - JapaneseChronology/Date/Era - Japanese calendar starts with Meiji 6 to avoid ill defined early years of Meiji calendar. - Remove editorial error "(1865-04-07 - 1868-09-07)" as the Meiji range in the JapaneseChronology API doc. - Remove JapaneseEra.SEIREKI as ill defined and unnecessary; - Update the signature of ChronoLocalDate.atTime The webrev also includes the proposed change for JDK-8020418: Cleanup of -Xlint warnings in java.time Thanks, -Sherman From paul.sandoz at oracle.com Fri Jul 12 17:44:45 2013 From: paul.sandoz at oracle.com (Paul Sandoz) Date: Fri, 12 Jul 2013 19:44:45 +0200 Subject: RFR 8020292 :Re: class SplittableRandom In-Reply-To: <7B80D649-A0D5-426D-A341-41ED818126C3@oracle.com> References: <51DDB26D.8050506@cs.oswego.edu> <51E037D7.3040305@cs.oswego.edu> <7B80D649-A0D5-426D-A341-41ED818126C3@oracle.com> Message-ID: On Jul 12, 2013, at 7:26 PM, Paul Sandoz wrote: > Hi, > > Thanks Doug. > > Here is the webrev: > > http://cr.openjdk.java.net/~psandoz/tl/JDK-8020292-splittable-random/webrev/ > In my haste i forgot to mention this patch is based off: http://cr.openjdk.java.net/~psandoz/tl/JDK-8019395-StreamSupport/webrev/ Which stands a good chance of being pushed to tl today. Paul. From chris.hegarty at oracle.com Fri Jul 12 17:59:06 2013 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Fri, 12 Jul 2013 18:59:06 +0100 Subject: RFR: (JAXP) 8020430 : NullPointerException in xml sqe nightly result on 2013-07-12 In-Reply-To: <51E03852.2020004@oracle.com> References: <51DFC567.3070902@oracle.com> <88E5A207-A25D-48F3-AC68-941468821F1C@oracle.com> <51E03852.2020004@oracle.com> Message-ID: <675B6DCB-7ACE-4D68-90B8-FC49595AC440@oracle.com> On 12 Jul 2013, at 18:09, huizhe wang wrote: > > On 7/12/2013 3:30 AM, Lance Andersen - Oracle wrote: >> The fix looks fine to me Joe as does the test. I assume you will go with Chris's plan below for the test locations? > > It will be jdk/test/javax/xml/jaxp, that is the location for all jaxp tests for now. We will look into migrating jaxp tests to the jaxp repo. > Sounds good to me. -Chris > Thanks, > Joe > >> >> Best >> Lance >> On Jul 12, 2013, at 5:44 AM, Chris Hegarty wrote: >> >>> The source changes look fine to me. >>> >>> The tests should be located elsewhere, otherwise they will collide with an Oracle internal repo. Say jdk/test/jaxp? >>> >>> As an aside, I plan to move the jaxws tests to a similar holding area, jdk/test/jaxws. They can then follow the appropriate package structure. >>> >>> -Chris >>> >>> On 12 Jul 2013, at 09:59, huizhe wang wrote: >>> >>>> Hi, >>>> >>>> This is a quick fix on a regression caused by 8016648. The new property manager added to handle the new jaxp 1.5 properties is only created for the input and event factories. For the output factory therefore, there should have a null-check. I've run the tests used in the nightly build with a local build, all passed with this patch. >>>> >>>> webrev: >>>> http://cr.openjdk.java.net/~joehw/jdk8/8020430/webrev/ >>>> >>>> Thanks, >>>> Joe >> >> >> Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 >> Oracle Java Engineering >> 1 Network Drive >> Burlington, MA 01803 >> Lance.Andersen at oracle.com > From huizhe.wang at oracle.com Fri Jul 12 18:08:54 2013 From: huizhe.wang at oracle.com (huizhe wang) Date: Fri, 12 Jul 2013 11:08:54 -0700 Subject: RFR: (JAXP) 8020430 : NullPointerException in xml sqe nightly result on 2013-07-12 In-Reply-To: <675B6DCB-7ACE-4D68-90B8-FC49595AC440@oracle.com> References: <51DFC567.3070902@oracle.com> <88E5A207-A25D-48F3-AC68-941468821F1C@oracle.com> <51E03852.2020004@oracle.com> <675B6DCB-7ACE-4D68-90B8-FC49595AC440@oracle.com> Message-ID: <51E04636.2010304@oracle.com> Thanks Chris! On 7/12/2013 10:59 AM, Chris Hegarty wrote: > On 12 Jul 2013, at 18:09, huizhe wang wrote: > >> On 7/12/2013 3:30 AM, Lance Andersen - Oracle wrote: >>> The fix looks fine to me Joe as does the test. I assume you will go with Chris's plan below for the test locations? >> It will be jdk/test/javax/xml/jaxp, that is the location for all jaxp tests for now. We will look into migrating jaxp tests to the jaxp repo. >> > Sounds good to me. > > -Chris > >> Thanks, >> Joe >> >>> Best >>> Lance >>> On Jul 12, 2013, at 5:44 AM, Chris Hegarty wrote: >>> >>>> The source changes look fine to me. >>>> >>>> The tests should be located elsewhere, otherwise they will collide with an Oracle internal repo. Say jdk/test/jaxp? >>>> >>>> As an aside, I plan to move the jaxws tests to a similar holding area, jdk/test/jaxws. They can then follow the appropriate package structure. >>>> >>>> -Chris >>>> >>>> On 12 Jul 2013, at 09:59, huizhe wang wrote: >>>> >>>>> Hi, >>>>> >>>>> This is a quick fix on a regression caused by 8016648. The new property manager added to handle the new jaxp 1.5 properties is only created for the input and event factories. For the output factory therefore, there should have a null-check. I've run the tests used in the nightly build with a local build, all passed with this patch. >>>>> >>>>> webrev: >>>>> http://cr.openjdk.java.net/~joehw/jdk8/8020430/webrev/ >>>>> >>>>> Thanks, >>>>> Joe >>> >>> Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 >>> Oracle Java Engineering >>> 1 Network Drive >>> Burlington, MA 01803 >>> Lance.Andersen at oracle.com From huizhe.wang at oracle.com Fri Jul 12 18:13:44 2013 From: huizhe.wang at oracle.com (huizhe.wang at oracle.com) Date: Fri, 12 Jul 2013 18:13:44 +0000 Subject: hg: jdk8/tl/jaxp: 8020430: NullPointerException in xml sqe nightly result on 2013-07-12 Message-ID: <20130712181348.5E00248A3F@hg.openjdk.java.net> Changeset: aabe15fc346f Author: joehw Date: 2013-07-12 11:12 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jaxp/rev/aabe15fc346f 8020430: NullPointerException in xml sqe nightly result on 2013-07-12 Reviewed-by: chegar, lancea ! src/com/sun/org/apache/xerces/internal/impl/PropertyManager.java From mike.duigou at oracle.com Fri Jul 12 18:15:32 2013 From: mike.duigou at oracle.com (Mike Duigou) Date: Fri, 12 Jul 2013 11:15:32 -0700 Subject: RFR: 8015317: Optional.filter, map, and flatMap In-Reply-To: <51D73CA5.50005@oracle.com> References: <51D73CA5.50005@oracle.com> Message-ID: The ? extends Optional is unnecessary in flatMap as Optional is final. Otherwise this looks good. Mike On Jul 5 2013, at 14:37 , Henry Jen wrote: > Hi, > > Please review the webrev at > > http://cr.openjdk.java.net/~henryjen/ccc/8015317.0/webrev/ > > Which adds following method to Optional, > > public static Optional ofNullable(T value) {} > public Optional filter(Predicate predicate) {} > public Optional map(Function mapper) {} > public Optional flatMap(Function> > mapper) {} > > Also included is some cleanup on javadoc. > > Cheers, > Henry From huizhe.wang at oracle.com Fri Jul 12 18:20:30 2013 From: huizhe.wang at oracle.com (huizhe.wang at oracle.com) Date: Fri, 12 Jul 2013 18:20:30 +0000 Subject: hg: jdk8/tl/jdk: 8020430: NullPointerException in xml sqe nightly result on 2013-07-12 Message-ID: <20130712182052.C7B9648A40@hg.openjdk.java.net> Changeset: 2504f01bc83f Author: joehw Date: 2013-07-12 11:14 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/2504f01bc83f 8020430: NullPointerException in xml sqe nightly result on 2013-07-12 Reviewed-by: chegar, lancea + test/javax/xml/jaxp/common/8020430/JAXP15RegTest.java + test/javax/xml/jaxp/common/8020430/TestBase.java From mike.duigou at oracle.com Fri Jul 12 18:29:07 2013 From: mike.duigou at oracle.com (Mike Duigou) Date: Fri, 12 Jul 2013 11:29:07 -0700 Subject: class SplittableRandom In-Reply-To: <51E037D7.3040305@cs.oswego.edu> References: <51DDB26D.8050506@cs.oswego.edu> <51E037D7.3040305@cs.oswego.edu> Message-ID: <6A988B5A-50F8-493D-B0F6-BA545CDD377B@oracle.com> On Jul 12 2013, at 10:07 , Doug Lea wrote: > [Also posted on concurrency-interest.] > > Thanks to all those sending quick feedback, both on and off lists! > We're increasingly confident about the value of adding > SplittableRandom, so will proceed with integration request. I'm sure > that we'll introduce incremental improvements during OpenJDK8 bake-in > phase, and apply some of the lessons learned to other code. I have some comments along those lines from my experiences with murmur3... Most specifically, do we want to commit to a seeded version promising a deterministic sequence that would preclude future changes (including total replacement) to the generation algorithm? This constructor is certainly common for PRNG but seems at odds with the other goals. > But we > wanted to ensure that this is at least considered for inclusion along > with last of the other jsr166-related updates (that are all currently > in-process). > > Paul Sandoz will follow up on core-libs-dev with the CR details, on > his way out to a well-deserved vacation. So I may request help from > others for any Oracle process issues that might arise. Available and willing to help out on any process issues. > The CR is far > from the end of this process, so I also plan to post follow-ups as it > progresses. Do you foresee additional API changes or just implementation and performance changes? > -Doug > From mike.duigou at oracle.com Fri Jul 12 18:41:19 2013 From: mike.duigou at oracle.com (Mike Duigou) Date: Fri, 12 Jul 2013 11:41:19 -0700 Subject: RFR (2nd): 8015315: Stream.concat methods In-Reply-To: <51D524D5.4030404@oracle.com> References: <51D524D5.4030404@oracle.com> Message-ID: <7B206F3F-A592-4291-BD9A-7D2982449129@oracle.com> Looks good and I agree that the issues mentioned in Paul's response can be addressed in follow-on issues. Mike On Jul 4 2013, at 00:31 , Henry Jen wrote: > Hi, > > I updated the test, and split the ConcatTest.java so we don't encounter > the ClassNotFoundException issue on test-ng. > > Please review the webrev at > > http://cr.openjdk.java.net/~henryjen/ccc/8015315.1/webrev/ > > Cheers, > Henry > From joe.darcy at oracle.com Fri Jul 12 18:48:40 2013 From: joe.darcy at oracle.com (joe.darcy at oracle.com) Date: Fri, 12 Jul 2013 18:48:40 +0000 Subject: hg: jdk8/tl/jdk: 8010679: Clarify "present" and annotation ordering in Core Reflection for Annotations Message-ID: <20130712184852.8A73348A41@hg.openjdk.java.net> Changeset: af62c6175f92 Author: darcy Date: 2013-07-12 11:48 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/af62c6175f92 8010679: Clarify "present" and annotation ordering in Core Reflection for Annotations Reviewed-by: abuckley, jfranck ! src/share/classes/java/lang/reflect/AnnotatedElement.java From brian.burkhalter at oracle.com Fri Jul 12 18:59:07 2013 From: brian.burkhalter at oracle.com (Brian Burkhalter) Date: Fri, 12 Jul 2013 11:59:07 -0700 Subject: Java 8 RFR 8014319: Faster division of large integers Message-ID: <4BC6E06A-DA95-4669-B3AD-82897C7B4AF8@oracle.com> Math Reviewers: This review request encompasses the incorporation of the Burnikel-Ziegler recursive division algorithm into BigInteger. As presented, it applies when the large integers involved are each represented by at least 50 ints. This algorithm crossover threshold is subject to change pending further experimentation. This patch is identical to the original contribution from Tim Buktu http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-July/018784.html aside from some minor cosmetic javadoc updates in MutableBigInteger and the addition of the divideLarge() method and some other minor changes in BigIntegerTest. Issue: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8014319 Webrev: http://cr.openjdk.java.net/~bpb/8014319/ Thanks, Brian [1] http://cr.yp.to/bib/1998/burnikel.ps [2] http://bioinfo.ict.ac.cn/%7Edbu/AlgorithmCourses/Lectures/Hasselstrom2003.pdf From paul.sandoz at oracle.com Fri Jul 12 19:32:38 2013 From: paul.sandoz at oracle.com (paul.sandoz at oracle.com) Date: Fri, 12 Jul 2013 19:32:38 +0000 Subject: hg: jdk8/tl/jdk: 8019395: Consolidate StreamSupport.{stream, parallelStream} into a single method Message-ID: <20130712193250.978A848A46@hg.openjdk.java.net> Changeset: be096613bfb5 Author: psandoz Date: 2013-07-03 21:43 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/be096613bfb5 8019395: Consolidate StreamSupport.{stream,parallelStream} into a single method Reviewed-by: henryjen, briangoetz ! src/share/classes/java/io/BufferedReader.java ! src/share/classes/java/lang/CharSequence.java ! src/share/classes/java/nio/X-Buffer.java.template ! src/share/classes/java/nio/file/Files.java ! src/share/classes/java/util/Arrays.java ! src/share/classes/java/util/BitSet.java ! src/share/classes/java/util/Collection.java ! src/share/classes/java/util/Collections.java ! src/share/classes/java/util/jar/JarFile.java ! src/share/classes/java/util/regex/Pattern.java ! src/share/classes/java/util/stream/DoubleStream.java ! src/share/classes/java/util/stream/IntStream.java ! src/share/classes/java/util/stream/LongStream.java ! src/share/classes/java/util/stream/Stream.java ! src/share/classes/java/util/stream/StreamSupport.java ! src/share/classes/java/util/stream/Streams.java ! src/share/classes/java/util/zip/ZipFile.java ! test/java/util/stream/bootlib/java/util/stream/DoubleStreamTestScenario.java ! test/java/util/stream/bootlib/java/util/stream/IntStreamTestScenario.java ! test/java/util/stream/bootlib/java/util/stream/LongStreamTestScenario.java ! test/java/util/stream/bootlib/java/util/stream/StreamTestScenario.java ! test/java/util/stream/bootlib/java/util/stream/TestData.java ! test/java/util/stream/test/org/openjdk/tests/java/util/stream/DistinctOpTest.java ! test/java/util/stream/test/org/openjdk/tests/java/util/stream/InfiniteStreamWithLimitOpTest.java ! test/java/util/stream/test/org/openjdk/tests/java/util/stream/MatchOpTest.java ! test/java/util/stream/test/org/openjdk/tests/java/util/stream/SliceOpTest.java ! test/java/util/stream/test/org/openjdk/tests/java/util/stream/SortedOpTest.java ! test/java/util/stream/test/org/openjdk/tests/java/util/stream/StreamSpliteratorTest.java From vincent.x.ryan at oracle.com Fri Jul 12 19:45:49 2013 From: vincent.x.ryan at oracle.com (vincent.x.ryan at oracle.com) Date: Fri, 12 Jul 2013 19:45:49 +0000 Subject: hg: jdk8/tl/jdk: 8019627: RuntimeException gets obscured during OCSP cert revocation checking Message-ID: <20130712194602.3A5D648A47@hg.openjdk.java.net> Changeset: b3ca5fb77e2c Author: vinnie Date: 2013-07-12 20:44 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/b3ca5fb77e2c 8019627: RuntimeException gets obscured during OCSP cert revocation checking Reviewed-by: mullan ! src/share/classes/sun/security/provider/certpath/RevocationChecker.java ! test/java/security/cert/CertPathValidator/OCSP/FailoverToCRL.java From mike.duigou at oracle.com Fri Jul 12 19:16:52 2013 From: mike.duigou at oracle.com (mike.duigou at oracle.com) Date: Fri, 12 Jul 2013 19:16:52 +0000 Subject: hg: jdk8/tl/jdk: 4 new changesets Message-ID: <20130712191742.313E348A42@hg.openjdk.java.net> Changeset: fe6e4e2c367d Author: mduigou Date: 2013-07-12 11:11 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/fe6e4e2c367d 7129185: Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set} Reviewed-by: dmocek, martin, smarks ! src/share/classes/java/util/AbstractMap.java ! src/share/classes/java/util/Collections.java ! src/share/classes/java/util/NavigableSet.java ! test/java/util/Collection/MOAT.java ! test/java/util/Collections/CheckedIdentityMap.java ! test/java/util/Collections/CheckedMapBash.java ! test/java/util/Collections/CheckedSetBash.java ! test/java/util/Collections/EmptyCollectionSerialization.java + test/java/util/Collections/EmptyNavigableMap.java + test/java/util/Collections/EmptyNavigableSet.java - test/java/util/Collections/EmptySortedSet.java ! test/java/util/Map/LockStep.java ! test/java/util/NavigableMap/LockStep.java Changeset: 623a10b23ed8 Author: mduigou Date: 2013-07-12 11:12 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/623a10b23ed8 8015317: Optional.filter, map, and flatMap Reviewed-by: psandoz, mduigou Contributed-by: brian.goetz at oracle.com, henry.jen at oracle.com ! src/share/classes/java/util/Optional.java ! src/share/classes/java/util/OptionalDouble.java ! src/share/classes/java/util/OptionalInt.java ! src/share/classes/java/util/OptionalLong.java ! test/java/util/Optional/Basic.java Changeset: 06749efce430 Author: mduigou Date: 2013-07-12 12:15 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/06749efce430 8015315: Stream.concat methods Reviewed-by: psandoz, mduigou Contributed-by: brian.goetz at oracle.com, henry.jen at oracle.com ! src/share/classes/java/util/stream/DoubleStream.java ! src/share/classes/java/util/stream/IntStream.java ! src/share/classes/java/util/stream/LongStream.java ! src/share/classes/java/util/stream/Stream.java ! src/share/classes/java/util/stream/Streams.java ! test/java/util/stream/bootlib/java/util/stream/LambdaTestHelpers.java + test/java/util/stream/test/org/openjdk/tests/java/util/stream/ConcatOpTest.java + test/java/util/stream/test/org/openjdk/tests/java/util/stream/ConcatTest.java ! test/java/util/stream/test/org/openjdk/tests/java/util/stream/RangeTest.java Changeset: 5b6f94559589 Author: mduigou Date: 2013-07-12 12:15 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/5b6f94559589 Merge - test/java/util/Collections/EmptySortedSet.java From jonathan.gibbons at oracle.com Fri Jul 12 20:11:17 2013 From: jonathan.gibbons at oracle.com (jonathan.gibbons at oracle.com) Date: Fri, 12 Jul 2013 20:11:17 +0000 Subject: hg: jdk8/tl/langtools: 8020278: NPE in javadoc Message-ID: <20130712201123.E123248A48@hg.openjdk.java.net> Changeset: 37031963493e Author: jjg Date: 2013-07-12 13:11 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/37031963493e 8020278: NPE in javadoc Reviewed-by: mcimadamore, vromero ! src/share/classes/com/sun/tools/doclint/DocLint.java ! src/share/classes/com/sun/tools/doclint/Env.java + test/tools/doclint/BadPackageCommentTest.java + test/tools/doclint/BadPackageCommentTest.out From dl at cs.oswego.edu Fri Jul 12 20:16:14 2013 From: dl at cs.oswego.edu (Doug Lea) Date: Fri, 12 Jul 2013 16:16:14 -0400 Subject: class SplittableRandom In-Reply-To: <6A988B5A-50F8-493D-B0F6-BA545CDD377B@oracle.com> References: <51DDB26D.8050506@cs.oswego.edu> <51E037D7.3040305@cs.oswego.edu> <6A988B5A-50F8-493D-B0F6-BA545CDD377B@oracle.com> Message-ID: <51E0640E.6050707@cs.oswego.edu> On 07/12/13 14:29, Mike Duigou wrote: > Most specifically, do we want to commit to a seeded version promising a > deterministic sequence that would preclude future changes Thanks, this a good spec clarification question, about the scope of: * Creates a new SplittableRandom instance using the specified * initial seed. SplittableRandom instances created with the same * seed generate identical sequences of values. We should clarify to say: * initial seed. SplittableRandom instances created with the same * seed in the same program generate identical sequences of values. >> Paul Sandoz will follow up on core-libs-dev with the CR details, on his way >> out to a well-deserved vacation. So I may request help from others for any >> Oracle process issues that might arise. > > Available and willing to help out on any process issues. Thanks! > >> The CR is far from the end of this process, so I also plan to post >> follow-ups as it progresses. > > Do you foresee additional API changes or just implementation and performance > changes? > At this point, I'm hoping people accept that the API is what we will have in JDK8, modulo little things like the above. -Doug From mandy.chung at oracle.com Fri Jul 12 21:37:04 2013 From: mandy.chung at oracle.com (Mandy Chung) Date: Sat, 13 Jul 2013 05:37:04 +0800 Subject: RFR : 8017566 : Backout 8000450 - Cannot access to com.sun.corba.se.impl.orb.ORBImpl In-Reply-To: <51E0013A.4070301@oracle.com> References: <51E0013A.4070301@oracle.com> Message-ID: <51E07700.1080103@oracle.com> On 7/12/2013 9:14 PM, Se?n Coffey wrote: > The recent 8000450 has caused issue for JCK testing and some RMI/JMX > testing also.The CORBA package interaction between org.omg, > com.sun.corba.se.spi, javax.rmi and other packages into > com.sun.corba.se.impl classes needs better analysis and won't be > complete for 7u40. > > It's rare to have security manager installed with CORBA app but we > need to cater for it. The JCK testsuite tests this scenario but it > doesn't have sufficient privileges in the stack when launching the > CORBA server during test setup phase. None the less, it's something > the JDK code should handle. The structure of the CORBA packages and > users of it needs to be better scoped out. For now, I propose > reversing the change for both jdk8 and jdk7u40. > > webrev : http://cr.openjdk.java.net/~coffeys/webrev.8000450.7u40/webrev/ > Looks fine to me. I agree that we should back it out for 7u40. I would think we want to leave the change in jdk8 and continue the investigation and resolving the JCK failures for jdk8. Is that what you are thinking? If so, we don't need to back it out from jdk8. Mandy > regards, > Sean. From mike.duigou at oracle.com Fri Jul 12 22:10:10 2013 From: mike.duigou at oracle.com (Mike Duigou) Date: Fri, 12 Jul 2013 15:10:10 -0700 Subject: RFR: 8015320: Pull spliterator() up from Collection to Iterable In-Reply-To: <51DC9436.6010000@oracle.com> References: <51DC9436.6010000@oracle.com> Message-ID: <504C7CCD-FCFC-409E-8D44-042FFEA2373E@oracle.com> Looks good (with Paul's @implNote change). Mike On Jul 9 2013, at 15:52 , Henry Jen wrote: > Hi, > > Please review the webrev at > > http://cr.openjdk.java.net/~henryjen/ccc/8015320.0/webrev/ > > This allows turning an Iterable into a stream with spliterator() methods > if the implementation provides one(like many Collection implementations) > rather than be forced to use less-efficient iterator(). > > Two small changes are not directly related, > - cleanup on SpliteratorCollisions.java test > - add a @see Spliterator for ConcurrentModificationException > > Cheers, > Henry From mike.duigou at oracle.com Fri Jul 12 22:14:44 2013 From: mike.duigou at oracle.com (Mike Duigou) Date: Fri, 12 Jul 2013 15:14:44 -0700 Subject: RFR: 8020062: Nest StreamBuilder interfaces inside relevant Stream interfaces In-Reply-To: <51DCA781.9010609@oracle.com> References: <51DCA781.9010609@oracle.com> Message-ID: <8145FF5C-D04D-4220-9B4C-517E70C661C6@oracle.com> Looks good to me as well. Mike On Jul 9 2013, at 17:14 , Henry Jen wrote: > Hi, > > Please review the webrev at > > http://cr.openjdk.java.net/~henryjen/ccc/8020062/0/webrev/index.html > > This webrev does as the bug suggested, is a refactoring that moves > StreamBuilder interfaces implementations into relevant Stream interfaces. > > The patch is created against the version after applying two earlier RFR > of 8015315+8019395, which we hope will be pushed before this one. That > said, there is no hard dependency on those two changesets. > > Cheers, > Henry > From jeremymanson at google.com Fri Jul 12 22:21:46 2013 From: jeremymanson at google.com (Jeremy Manson) Date: Fri, 12 Jul 2013 15:21:46 -0700 Subject: RFR - Changes to address CCC 8014135: Support for statically linked agents In-Reply-To: <51DDB632.4050805@oracle.com> References: <51D494E9.2020200@oracle.com> <51DDB632.4050805@oracle.com> Message-ID: Okay. I'd be happy to talk about what we did, if you think it would be of interest. All invocations of the JVM at Google use the same JVMTI agent. We're moving to a model where everyone builds their own launcher [1], so the obvious thing for us to do was combine the launcher and the agent statically, which simplifies our deployment and matches better with other parts of the Google workflow. However, we weren't too worried about people statically linking in multiple agents, so we didn't put in support for that. We will certainly use what you are doing, since that gives us said support for free (plus, it will be more work not to use it when we move to HS25). In that model, having a VM flag to grab an agent out of the launcher makes some sense, but it's also useful for people like me in debugging scenarios to build a separate agent, pass it with -agentlib and/or -agentpath, and override the one in the launcher. Arguably, I'm not your use case. Although, having said that, perhaps I am - I'm the only one I know who is already statically linking JNI and JVMTI in a production context! [1] Actually, they will build a single static self-executing JAR file containing their own launcher, which statically links in all of their JNI and our JVMTI agent, and all the classes their application needs. There is lots of overlap with JEP178, as you can see. Jeremy On Wed, Jul 10, 2013 at 12:29 PM, BILL PITTORE wrote: > On 7/3/2013 6:32 PM, Jeremy Manson wrote: > > I know that this is mentioned in the JEP, but does it really make sense to > have -agentpath work here, rather than just -agentlib? I would think that > specifying a full pathname and getting the library loaded out of the > launcher would be a little surprising to people who are basically saying > "please load this agent from the given path". > > Also, in practice, we do something very similar at Google, and, when > testing, I find it occasionally useful to be able to say "please load this > agent on the command line via the agentpath I gave you, rather than loading > the one with the same name I baked into the launcher". > > (FWIW, when we did this internally at Google, we added a special -XX > flag for when the agent is in the launcher. I know that you don't want to > go that way, though.) > > Thanks for the comments. I would say the thinking here is that we want > this to be as transparent as possible to the end user. In our view of the > end user is someone perhaps using an IDE and the actual execution of the VM > with agent arguments is hidden. In your case it sounds like you are > actually developing agents which is a whole different ball game. I could > certainly see adding a -XX argument that forces agentpath to load the > external library which would be good for agent development and debugging. > No need to relink the entire VM with the new agent. Our tech lead is out on > vacation this week so I'll bring this up when he's back. > > bill > > > > On Wed, Jul 3, 2013 at 2:17 PM, BILL PITTORE wrote: > >> These changes address bug 8014135 which adds support for statically >> linked agents in the VM. This is a followup to the recent JNI spec changes >> that addressed statically linked JNI libraries( 8005716). >> The JEP for this change is the same JEP as the JNI changes: >> http://openjdk.java.net/jeps/178 >> >> Webrevs are here: >> >> http://cr.openjdk.java.net/~bpittore/8014135/jdk/webrev.00/ >> http://cr.openjdk.java.net/~bpittore/8014135/hotspot/webrev.00/ >> >> The changes to jvmti.xml can also be seen in the output file that I >> placed here: >> http://cr.openjdk.java.net/~bpittore/8014135/hotspot/webrev.00/jvmti.html >> >> Thanks, >> bill >> >> >> > > From mike.duigou at oracle.com Fri Jul 12 22:45:01 2013 From: mike.duigou at oracle.com (mike.duigou at oracle.com) Date: Fri, 12 Jul 2013 22:45:01 +0000 Subject: hg: jdk8/tl/jdk: 2 new changesets Message-ID: <20130712224538.1056A48A4C@hg.openjdk.java.net> Changeset: 9b17939958e7 Author: henryjen Date: 2013-07-12 15:01 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/9b17939958e7 8015320: Pull spliterator() up from Collection to Iterable Reviewed-by: psandoz, mduigou Contributed-by: brian.goetz at oracle.com ! src/share/classes/java/lang/Iterable.java ! src/share/classes/java/util/Collection.java ! src/share/classes/java/util/ConcurrentModificationException.java ! test/java/util/Spliterator/SpliteratorCollisions.java ! test/java/util/Spliterator/SpliteratorTraversingAndSplittingTest.java Changeset: 37c37361a7ad Author: henryjen Date: 2013-07-08 15:46 -0400 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/37c37361a7ad 8020062: Nest StreamBuilder interfaces inside relevant Stream interfaces Reviewed-by: psandoz, mduigou Contributed-by: brian goetz ! src/share/classes/java/util/stream/DoubleStream.java ! src/share/classes/java/util/stream/IntStream.java ! src/share/classes/java/util/stream/LongStream.java ! src/share/classes/java/util/stream/Stream.java - src/share/classes/java/util/stream/StreamBuilder.java ! src/share/classes/java/util/stream/Streams.java ! test/java/util/stream/test/org/openjdk/tests/java/util/stream/StreamBuilderTest.java From iris.clark at oracle.com Fri Jul 12 23:57:11 2013 From: iris.clark at oracle.com (Iris Clark) Date: Fri, 12 Jul 2013 16:57:11 -0700 (PDT) Subject: RFR: (JAXP) 8020430 : NullPointerException in xml sqe nightly result on 2013-07-12 In-Reply-To: <51E03852.2020004@oracle.com> References: <51DFC567.3070902@oracle.com> <88E5A207-A25D-48F3-AC68-941468821F1C@oracle.com> <51E03852.2020004@oracle.com> Message-ID: <0cbe7317-6647-46ca-aa69-14d23f634e42@default> FWIW, I really like the idea of migrating the jaxp tests to the jaxp repo. I've always thought it odd that the code change and the test for it aren't in the same changeset. Thanks, iris -----Original Message----- From: huizhe wang Sent: Friday, July 12, 2013 10:10 AM To: Lance Andersen - Oracle Cc: Core-Libs-Dev Subject: Re: RFR: (JAXP) 8020430 : NullPointerException in xml sqe nightly result on 2013-07-12 On 7/12/2013 3:30 AM, Lance Andersen - Oracle wrote: > The fix looks fine to me Joe as does the test. I assume you will go with Chris's plan below for the test locations? It will be jdk/test/javax/xml/jaxp, that is the location for all jaxp tests for now. We will look into migrating jaxp tests to the jaxp repo. Thanks, Joe > > Best > Lance > On Jul 12, 2013, at 5:44 AM, Chris Hegarty wrote: > >> The source changes look fine to me. >> >> The tests should be located elsewhere, otherwise they will collide with an Oracle internal repo. Say jdk/test/jaxp? >> >> As an aside, I plan to move the jaxws tests to a similar holding area, jdk/test/jaxws. They can then follow the appropriate package structure. >> >> -Chris >> >> On 12 Jul 2013, at 09:59, huizhe wang wrote: >> >>> Hi, >>> >>> This is a quick fix on a regression caused by 8016648. The new property manager added to handle the new jaxp 1.5 properties is only created for the input and event factories. For the output factory therefore, there should have a null-check. I've run the tests used in the nightly build with a local build, all passed with this patch. >>> >>> webrev: >>> http://cr.openjdk.java.net/~joehw/jdk8/8020430/webrev/ >>> >>> Thanks, >>> Joe > > > Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 > Oracle Java Engineering > 1 Network Drive > Burlington, MA 01803 > Lance.Andersen at oracle.com > From weijun.wang at oracle.com Sat Jul 13 00:48:23 2013 From: weijun.wang at oracle.com (weijun.wang at oracle.com) Date: Sat, 13 Jul 2013 00:48:23 +0000 Subject: hg: jdk8/tl/jdk: 8019410: sun/security/krb5/auto/ReplayCacheTestProc.java Message-ID: <20130713004834.DA19248A54@hg.openjdk.java.net> Changeset: 5f2a8db78aca Author: weijun Date: 2013-07-13 08:47 +0800 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/5f2a8db78aca 8019410: sun/security/krb5/auto/ReplayCacheTestProc.java Reviewed-by: mullan ! test/sun/security/krb5/auto/ReplayCacheTestProc.java From dl at cs.oswego.edu Sat Jul 13 13:22:37 2013 From: dl at cs.oswego.edu (Doug Lea) Date: Sat, 13 Jul 2013 09:22:37 -0400 Subject: class SplittableRandom In-Reply-To: <51DEA3D5.5000509@oracle.com> References: <51DDB26D.8050506@cs.oswego.edu> <51DE6069.2060308@gmail.com> <51DEA230.2060504@cs.oswego.edu> <51DEA3D5.5000509@oracle.com> Message-ID: <51E1549D.4060403@cs.oswego.edu> (Sorry to postpone answering this one while tied up in logistics...) On 07/11/13 08:23, Aleksey Shipilev wrote: > On 07/11/2013 04:16 PM, Doug Lea wrote: >> (I've been contemplating re-exploring alternatives in TLR, >> but the options are more limited because it is a subclass >> of Random. Which made sense at the time I did it, but ...) > > What exactly limits us to adopt the PRNG from SR into TLR, thus gaining > the same good statistical properties? Does extending Random actually > forces us to match the PRNG j.u.Random has? It does not seem likely if > we don't control the seed for TLR anyway. > There are two different questions here: 1. Why a new API / class? SplittableRandom takes a form that we are likely to see more of as we improve support for structured parallelism: pseudo-interface SplittableGenerator { T generate(); SplittableGenerator split(); } As opposed to ThreadLocalRandom's form: pseudo-interface PerThreadGenerator { T generate() { // lazily construct and use a thread-local instance } } As I've mentioned, each form is useful, but there's little overlap in the contexts in which they are useful. While you can emulate the effects of one with the other, it's not at all pretty or efficient. Without an explicit call to split(), the thread-local form would need some side-channel to construct an instance of known form (rather than default-initialize). Conversely, without automated thread-local-ness, you'd need some other means of sharing use of the same instance in different parts of a program running in the same thread, and may encounter variants of memory locality/contention we've seen. One underlying motivation for introducing SplittableRandom in JDK8 is to establish and get some usage experience with generators of this form, while at the same time addressing a known gap in java.util.stream support for using random streams. 2. Can/should we improve ThreadLocalRandom? Probably yes. The ThreadLocalRandom javadocs/specs don't themselves promise that they use the same base generator algorithm as java.util.Random. When TLR was introduced in JDK7, it was a judgement call to make it identical to java.util.Random except for the the thread-local-ness, maintaining the same speed/quality tradeoffs. java.util.Random's algorithm does have known weaknesses, but it is far from the worst choice. So it is not all that terrible that java.util.Random specs mandate use of this algorithm. But for TLR, we should re-explore options. The algorithm underlying SplittableRandom (minus everything surrounding splits) is one possible candidate. Since nothing else depends on these internals, so long as they don't lose RNG quality or noticeably impact performance, we can look into this during the performance/functionality improvement phase of OpenJDK8. -Doug From henry.jen at oracle.com Sun Jul 14 05:02:26 2013 From: henry.jen at oracle.com (Henry Jen) Date: Sat, 13 Jul 2013 22:02:26 -0700 Subject: RFR: 8015317: Optional.filter, map, and flatMap In-Reply-To: References: <51D73CA5.50005@oracle.com> <01A36604-8E66-49E8-A89B-4FF8FC1367FA@oracle.com> Message-ID: <51E230E2.2060305@oracle.com> I think I understand what you are saying. However, unless we make Optional not final, the extends part just doesn't matter. You probably know that the example provided is not completed ported to work with our Optional implementation, and fugue works around the type system with Option as abstract class. Cheers, Henry On Jul 13, 2013, at 4:35 PM, Jed Wesley-Smith wrote: > I did supply a test that you can use to try it. > > What we are talking about is whether type Box is substitutable > by Box in the contravariant position. Intuitively we think we > only need Box because we only care about the type > parameter, but the type ? as you point out ? is actually different. > Box is not "inherited by" Box. > > Specifically, if we have a consuming Box, and we replace it with a Box > of a more specific type parameter, we could attempt feed the more > general type into it, ie. a Box isn't going to appreciate > having Parent fed to it. This is why covariance and mutable containers > don't mix well, and why Java's covariant arrays are problematic. > > In this situation we have an immutable container, and we can > substitute the type of our container with one of a more specific type, > as it will only ever supply a value ? and a value of Child will > suffice as a Parent. So, for this case we need a Box that is > substitutable, and therefore we need to add the covariance to our box. > > is simply adding covariance to our Box type. > > For a much better explanation than I can give about this, see this > excellent post describing generics in Scala, which ? apart from have > declaration-site variance and using [A] in place of ? generally > follow the same pattern: > > http://termsandtruthconditions.herokuapp.com/blog/2012/12/29/covariance-and-contravariance-in-scala/ > > cheers, > jed. > > > On 14 July 2013 04:49, Henry Jen > wrote: > > I think the type you talking about here is Optional > instead of ? extends Optional. > > IIRC, Optional is not a subtype of Optional, just > like any other Collection class. List is not a List. > > Cheers, > Henry > > > On Jul 13, 2013, at 3:15 AM, Jed Wesley-Smith > wrote: > >> > The ? extends Optional is unnecessary in flatMap as Optional is >> final. >> >> interestingly enough, it actually is. >> >> try the following test: >> >> class OptionalTest { >> class Parent {}; >> >> class Child extends Parent {}; >> >> @Test public void covariantReturn() { >> Optional some = some(new Parent()); >> Function> f = new Function> Optional>() { >> @Override public Optional apply(Parent p) { >> return some(new Child()); >> } >> }; >> Optional mapped = some. flatMap(f); >> assertThat(mapped.get(), notNullValue()); >> } >> } >> >> adapted from the fugue test suite: >> >> https://bitbucket.org/atlassian/fugue/src/96a65067fb7aaf1edae1bffa07167a5865cbebec/src/test/java/com/atlassian/fugue/OptionTest.java#cl-155 >> >> The point to remember is that Optional is a type and as >> such is actually a subtype of Optional ? and therefore >> requires a covariant return. >> >> cheers, >> jed. >> >> >> >> >> On 13 July 2013 04:15, Mike Duigou > > wrote: >> >> The ? extends Optional is unnecessary in flatMap as Optional >> is final. Otherwise this looks good. >> >> Mike >> >> On Jul 5 2013, at 14:37 , Henry Jen wrote: >> >> > Hi, >> > >> > Please review the webrev at >> > >> > http://cr.openjdk.java.net/~henryjen/ccc/8015317.0/webrev/ >> >> > >> > Which adds following method to Optional, >> > >> > public static Optional ofNullable(T value) {} >> > public Optional filter(Predicate predicate) {} >> > public Optional map(Function >> mapper) {} >> > public Optional flatMap(Function> Optional> >> > mapper) {} >> > >> > Also included is some cleanup on javadoc. >> > >> > Cheers, >> > Henry >> >> >> > > From henry.jen at oracle.com Sat Jul 13 18:49:35 2013 From: henry.jen at oracle.com (Henry Jen) Date: Sat, 13 Jul 2013 11:49:35 -0700 Subject: RFR: 8015317: Optional.filter, map, and flatMap In-Reply-To: References: <51D73CA5.50005@oracle.com> Message-ID: <01A36604-8E66-49E8-A89B-4FF8FC1367FA@oracle.com> I think the type you talking about here is Optional instead of ? extends Optional. IIRC, Optional is not a subtype of Optional, just like any other Collection class. List is not a List. Cheers, Henry On Jul 13, 2013, at 3:15 AM, Jed Wesley-Smith wrote: > > The ? extends Optional is unnecessary in flatMap as Optional is final. > > interestingly enough, it actually is. > > try the following test: > > class OptionalTest { > class Parent {}; > > class Child extends Parent {}; > > @Test public void covariantReturn() { > Optional some = some(new Parent()); > Function> f = new Function>() { > @Override public Optional apply(Parent p) { > return some(new Child()); > } > }; > Optional mapped = some. flatMap(f); > assertThat(mapped.get(), notNullValue()); > } > } > > adapted from the fugue test suite: > > https://bitbucket.org/atlassian/fugue/src/96a65067fb7aaf1edae1bffa07167a5865cbebec/src/test/java/com/atlassian/fugue/OptionTest.java#cl-155 > > The point to remember is that Optional is a type and as such is actually a subtype of Optional ? and therefore requires a covariant return. > > cheers, > jed. > > > > > On 13 July 2013 04:15, Mike Duigou wrote: > The ? extends Optional is unnecessary in flatMap as Optional is final. Otherwise this looks good. > > Mike > > On Jul 5 2013, at 14:37 , Henry Jen wrote: > > > Hi, > > > > Please review the webrev at > > > > http://cr.openjdk.java.net/~henryjen/ccc/8015317.0/webrev/ > > > > Which adds following method to Optional, > > > > public static Optional ofNullable(T value) {} > > public Optional filter(Predicate predicate) {} > > public Optional map(Function mapper) {} > > public Optional flatMap(Function> > > mapper) {} > > > > Also included is some cleanup on javadoc. > > > > Cheers, > > Henry > > > From zhong.j.yu at gmail.com Mon Jul 15 02:24:46 2013 From: zhong.j.yu at gmail.com (Zhong Yu) Date: Sun, 14 Jul 2013 21:24:46 -0500 Subject: RFR: 8015317: Optional.filter, map, and flatMap In-Reply-To: References: <51D73CA5.50005@oracle.com> <01A36604-8E66-49E8-A89B-4FF8FC1367FA@oracle.com> <51E230E2.2060305@oracle.com> Message-ID: X> is not a subtype of X>. We have to go wildcard all the way - X>. The subtyping rules don't care about final-ness of types. For example, X is a distinct type from X, even though String has only one subtype (itself). Zhong Yu On Sun, Jul 14, 2013 at 8:04 AM, Jed Wesley-Smith wrote: > (accidentally didn't post to the list) > >> You probably know that the example provided is not completed ported to > work with our Optional implementation, > > It should be, for the example I wrote an Optional that is final and should > be otherwise identical. It should certainly be fairly easy for any > committer to try. If you can make it work without the ? extends Optional > I'd love an explanation of how. > >> and fugue works around the type system with Option as abstract class. > > As I've tried to explain, this isn't about the implementation of the > container class, but how covariance works with a parameterised class. > > We originally had the non-, but in a discussion with Brian he alerted us to > the fact that the signature was wrong. We hastily fixed it: > > https://bitbucket.org/atlassian/fugue/commits/9eca663326a5baeb8f23974732ec585d5627a05c > > To further demonstrate, I give you a minimal example of a final Optional > implementation that does not compile for this test: > > https://gist.github.com/jedws/5993596#file-gistfile1-java-L57 > > cheers, > jed. > > > > On 14 July 2013 15:02, Henry Jen wrote: > >> I think I understand what you are saying. However, unless we make >> Optional not final, the extends part just doesn't matter. >> >> You probably know that the example provided is not completed ported to >> work with our Optional implementation, and fugue works around the type >> system with Option as abstract class. >> >> Cheers, >> Henry >> >> On Jul 13, 2013, at 4:35 PM, Jed Wesley-Smith wrote: >> >> I did supply a test that you can use to try it. >> >> What we are talking about is whether type Box is substitutable >> by Box in the contravariant position. Intuitively we think we only >> need Box because we only care about the type parameter, >> but the type ? as you point out ? is actually different. Box is not >> "inherited by" Box. >> >> Specifically, if we have a consuming Box, and we replace it with a Box >> of a more specific type parameter, we could attempt feed the more general >> type into it, ie. a Box isn't going to appreciate having Parent fed >> to it. This is why covariance and mutable containers don't mix well, and >> why Java's covariant arrays are problematic. >> >> In this situation we have an immutable container, and we can substitute >> the type of our container with one of a more specific type, as it will only >> ever supply a value ? and a value of Child will suffice as a Parent. So, >> for this case we need a Box that is substitutable, and therefore we need to >> add the covariance to our box. >> >> is simply adding covariance to our Box type. >> >> For a much better explanation than I can give about this, see this >> excellent post describing generics in Scala, which ? apart from have >> declaration-site variance and using [A] in place of ? generally follow >> the same pattern: >> >> >> http://termsandtruthconditions.herokuapp.com/blog/2012/12/29/covariance-and-contravariance-in-scala/ >> >> cheers, >> jed. >> >> >> On 14 July 2013 04:49, Henry Jen wrote: >> >>> I think the type you talking about here is Optional instead >>> of ? extends Optional. >>> >>> IIRC, Optional is not a subtype of Optional, just like >>> any other Collection class. List is not a List. >>> >>> Cheers, >>> Henry >>> >>> >>> On Jul 13, 2013, at 3:15 AM, Jed Wesley-Smith >>> wrote: >>> >>> > The ? extends Optional is unnecessary in flatMap as Optional is final. >>> >>> interestingly enough, it actually is. >>> >>> try the following test: >>> >>> class OptionalTest { >>> class Parent {}; >>> >>> class Child extends Parent {}; >>> >>> @Test public void covariantReturn() { >>> Optional some = some(new Parent()); >>> Function> f = new Function>> Optional>() { >>> @Override public Optional apply(Parent p) { >>> return some(new Child()); >>> } >>> }; >>> Optional mapped = some. flatMap(f); >>> assertThat(mapped.get(), notNullValue()); >>> } >>> } >>> >>> adapted from the fugue test suite: >>> >>> >>> https://bitbucket.org/atlassian/fugue/src/96a65067fb7aaf1edae1bffa07167a5865cbebec/src/test/java/com/atlassian/fugue/OptionTest.java#cl-155 >>> >>> The point to remember is that Optional is a type and as such is >>> actually a subtype of Optional ? and therefore requires a >>> covariant return. >>> >>> cheers, >>> jed. >>> >>> >>> >>> >>> On 13 July 2013 04:15, Mike Duigou wrote: >>> >>>> The ? extends Optional is unnecessary in flatMap as Optional is final. >>>> Otherwise this looks good. >>>> >>>> Mike >>>> >>>> On Jul 5 2013, at 14:37 , Henry Jen wrote: >>>> >>>> > Hi, >>>> > >>>> > Please review the webrev at >>>> > >>>> > http://cr.openjdk.java.net/~henryjen/ccc/8015317.0/webrev/ >>>> > >>>> > Which adds following method to Optional, >>>> > >>>> > public static Optional ofNullable(T value) {} >>>> > public Optional filter(Predicate predicate) {} >>>> > public Optional map(Function mapper) {} >>>> > public Optional flatMap(Function>>> Optional> >>>> > mapper) {} >>>> > >>>> > Also included is some cleanup on javadoc. >>>> > >>>> > Cheers, >>>> > Henry >>>> >>>> >>>> >>> >>> >> >> > From zhong.j.yu at gmail.com Mon Jul 15 02:52:56 2013 From: zhong.j.yu at gmail.com (Zhong Yu) Date: Sun, 14 Jul 2013 21:52:56 -0500 Subject: RFR: 8015317: Optional.filter, map, and flatMap In-Reply-To: References: <51D73CA5.50005@oracle.com> <01A36604-8E66-49E8-A89B-4FF8FC1367FA@oracle.com> <51E230E2.2060305@oracle.com> Message-ID: Another example of possible missing a wildcard http://gee.cs.oswego.edu/dl/jsr166/dist/docs/java/util/concurrent/CompletionStage.html#thenCompose%28java.util.function.Function%29 thenCompose(Function> fn) should be thenCompose(Function> fn) The problem is probably wide spread, and we need a tool to find these mistakes. Zhong Yu On Sun, Jul 14, 2013 at 8:04 AM, Jed Wesley-Smith wrote: > (accidentally didn't post to the list) > >> You probably know that the example provided is not completed ported to > work with our Optional implementation, > > It should be, for the example I wrote an Optional that is final and should > be otherwise identical. It should certainly be fairly easy for any > committer to try. If you can make it work without the ? extends Optional > I'd love an explanation of how. > >> and fugue works around the type system with Option as abstract class. > > As I've tried to explain, this isn't about the implementation of the > container class, but how covariance works with a parameterised class. > > We originally had the non-, but in a discussion with Brian he alerted us to > the fact that the signature was wrong. We hastily fixed it: > > https://bitbucket.org/atlassian/fugue/commits/9eca663326a5baeb8f23974732ec585d5627a05c > > To further demonstrate, I give you a minimal example of a final Optional > implementation that does not compile for this test: > > https://gist.github.com/jedws/5993596#file-gistfile1-java-L57 > > cheers, > jed. > > > > On 14 July 2013 15:02, Henry Jen wrote: > >> I think I understand what you are saying. However, unless we make >> Optional not final, the extends part just doesn't matter. >> >> You probably know that the example provided is not completed ported to >> work with our Optional implementation, and fugue works around the type >> system with Option as abstract class. >> >> Cheers, >> Henry >> >> On Jul 13, 2013, at 4:35 PM, Jed Wesley-Smith wrote: >> >> I did supply a test that you can use to try it. >> >> What we are talking about is whether type Box is substitutable >> by Box in the contravariant position. Intuitively we think we only >> need Box because we only care about the type parameter, >> but the type ? as you point out ? is actually different. Box is not >> "inherited by" Box. >> >> Specifically, if we have a consuming Box, and we replace it with a Box >> of a more specific type parameter, we could attempt feed the more general >> type into it, ie. a Box isn't going to appreciate having Parent fed >> to it. This is why covariance and mutable containers don't mix well, and >> why Java's covariant arrays are problematic. >> >> In this situation we have an immutable container, and we can substitute >> the type of our container with one of a more specific type, as it will only >> ever supply a value ? and a value of Child will suffice as a Parent. So, >> for this case we need a Box that is substitutable, and therefore we need to >> add the covariance to our box. >> >> is simply adding covariance to our Box type. >> >> For a much better explanation than I can give about this, see this >> excellent post describing generics in Scala, which ? apart from have >> declaration-site variance and using [A] in place of ? generally follow >> the same pattern: >> >> >> http://termsandtruthconditions.herokuapp.com/blog/2012/12/29/covariance-and-contravariance-in-scala/ >> >> cheers, >> jed. >> >> >> On 14 July 2013 04:49, Henry Jen wrote: >> >>> I think the type you talking about here is Optional instead >>> of ? extends Optional. >>> >>> IIRC, Optional is not a subtype of Optional, just like >>> any other Collection class. List is not a List. >>> >>> Cheers, >>> Henry >>> >>> >>> On Jul 13, 2013, at 3:15 AM, Jed Wesley-Smith >>> wrote: >>> >>> > The ? extends Optional is unnecessary in flatMap as Optional is final. >>> >>> interestingly enough, it actually is. >>> >>> try the following test: >>> >>> class OptionalTest { >>> class Parent {}; >>> >>> class Child extends Parent {}; >>> >>> @Test public void covariantReturn() { >>> Optional some = some(new Parent()); >>> Function> f = new Function>> Optional>() { >>> @Override public Optional apply(Parent p) { >>> return some(new Child()); >>> } >>> }; >>> Optional mapped = some. flatMap(f); >>> assertThat(mapped.get(), notNullValue()); >>> } >>> } >>> >>> adapted from the fugue test suite: >>> >>> >>> https://bitbucket.org/atlassian/fugue/src/96a65067fb7aaf1edae1bffa07167a5865cbebec/src/test/java/com/atlassian/fugue/OptionTest.java#cl-155 >>> >>> The point to remember is that Optional is a type and as such is >>> actually a subtype of Optional ? and therefore requires a >>> covariant return. >>> >>> cheers, >>> jed. >>> >>> >>> >>> >>> On 13 July 2013 04:15, Mike Duigou wrote: >>> >>>> The ? extends Optional is unnecessary in flatMap as Optional is final. >>>> Otherwise this looks good. >>>> >>>> Mike >>>> >>>> On Jul 5 2013, at 14:37 , Henry Jen wrote: >>>> >>>> > Hi, >>>> > >>>> > Please review the webrev at >>>> > >>>> > http://cr.openjdk.java.net/~henryjen/ccc/8015317.0/webrev/ >>>> > >>>> > Which adds following method to Optional, >>>> > >>>> > public static Optional ofNullable(T value) {} >>>> > public Optional filter(Predicate predicate) {} >>>> > public Optional map(Function mapper) {} >>>> > public Optional flatMap(Function>>> Optional> >>>> > mapper) {} >>>> > >>>> > Also included is some cleanup on javadoc. >>>> > >>>> > Cheers, >>>> > Henry >>>> >>>> >>>> >>> >>> >> >> > From david.holmes at oracle.com Mon Jul 15 03:53:06 2013 From: david.holmes at oracle.com (David Holmes) Date: Mon, 15 Jul 2013 13:53:06 +1000 Subject: RFR: 8017513: Support for closeable streams In-Reply-To: References: <51DDD261.5050406@oracle.com> <51DE6939.40202@redhat.com> <51DF0EFD.605@oracle.com> <51DFE6FF.60009@oracle.com> Message-ID: <51E37222.8080505@oracle.com> On 12/07/2013 11:57 PM, Paul Benedict wrote: > I see closeability as a postcondition. A subtype can't weaken it. The > contract of AutoCloseable says its a resource that "must" be closed. Now > MHCR says it can/should/doesn't have to be closed -- so it is backwards. A "postcondition" of what? pre- and post-conditions go with methods. "closeability" is an invariant as far as I can see. Hence must be maintained in a substitutable subtype - which it is not no matter which way you try the inheritance. David > > On Fri, Jul 12, 2013 at 6:22 AM, David Holmes > wrote: > > On 12/07/2013 6:22 AM, Paul Benedict wrote: > > Paul S.'s said the "negative" of using AutoCloseable is "it is > no longer > clear whether a stream should be closed or not" (6/20). That's > true because > the semantics of AutoCloseable indicates you have a resource > that requires > closing. > > However, the choice to make MayHoldCloseableResource a > sub-interface of > AutoClosable should be resisted. It's an inverted design. The Liskov > *substitution principle *says that sub-interfaces can't loosen > the contracts > > > of their superinterface. > > Not quite. It says: > > - Preconditions cannot be strengthened in a subtype. > - Postconditions cannot be weakened in a subtype. > - Invariants of the supertype must be preserved in a subtype. > > Question is: what kind of property is "closeability"? > > > If anything, AutoCloseable should be subclass of this new > interface, which MIGHT hold a resource that requires closing. > The current > choice is just plainly backwards. > > > No what you just said is "plainly backwards". If AutoCloseable is a > subtype of MHCR then you should be able to use an AC instance > anywhere you use a MHCR. But valid code doesn't have to close a > MHCR, so if you replace it with an AC which requires closing then > you have broken code. Hence not substitutable, hence invalid > inheritance relationship. > > But if anything this is just another variation of the > Square/Rectangle inheritance fallacy. While you can define either as > a specialization of the other, you can always violate > substitutability by doing something that relies on the property that > gets specialized. > > David > ----- > > > > For the above reason stated, and for the fact the interface adds > no new > functionality, it's superfluous. If the interface relationship > can't be > inverted, then chuck it -- it does nothing anyway. At the least, > keep the > annotation. > > Paul > > > On Thu, Jul 11, 2013 at 3:01 PM, Henry Jen > wrote: > > On 07/11/2013 01:13 AM, Florian Weimer wrote: > > On 07/10/2013 11:30 PM, Henry Jen wrote: > > A new interface, > java.util.__MayHoldCloseableResource, indicates an > implementation may or may not hold a resource need > to be closed. > > > Why doesn't close() throw Exception? > > > Because there is really much a developer can do on that > situation. The > API simply make it not throw a *checked* exception. > > See EG discussion on this topic, > > > http://mail.openjdk.java.net/__pipermail/lambda-libs-spec-__experts/2013-June/002081.html > > > > Annotation {@link HoldsResource} may be used to > guide users/static > analysis tools that a MHCR instance that definitely > hold a Closeable > resource. > > > All this looks a bit odd to me. I suppose the idea is > that you don't > want to give up the last reference to a closeable > resource without > calling close()?and not leak references which out-live > the call to > close(). This is definitely not a property of the type > of the resource, > so I don't see why the MayHoldCloseableResource > interface is needed (or > can confer relevant information). The HoldsResource > annotation could be > useful, but based on the current documentation, it's not > clear if it is > actually intended to express the data flow property. > > > I would suggest you look at EG discussion on this topic. The > MHCR is > different from AutoCloseable on the chances of holding > critical resources. > > Perhaps that suggests the javadoc is not clear enough, I > would like to > know what is important and missing. > > Cheers, > Henry > > > > > > > > > -- > Cheers, > Paul From martinrb at google.com Mon Jul 15 04:24:29 2013 From: martinrb at google.com (Martin Buchholz) Date: Sun, 14 Jul 2013 21:24:29 -0700 Subject: class SplittableRandom In-Reply-To: <51E1549D.4060403@cs.oswego.edu> References: <51DDB26D.8050506@cs.oswego.edu> <51DE6069.2060308@gmail.com> <51DEA230.2060504@cs.oswego.edu> <51DEA3D5.5000509@oracle.com> <51E1549D.4060403@cs.oswego.edu> Message-ID: Thoughts: I was sad when ThreadLocalRandom reused the lousy pseudorandom implementation from Random. I continue to think we can do better. The algorithm in SplittableRandom is much better, although even here I'm not sure we have enough bits of state to satisfy all non-cryptographic uses. SplittableRandom has 64 bits of state for each generator, and a period of 2^64, and that is hinted at by the API because the constructor takes only a single long seed. Although I suppose we could add some other constructor in the future that provided more seed bits. One way that users might care is that currently nextLong cannot possibly return the same value twice in a row. It would be nice if we could guarantee a minimum period of 2^64. Doug, you say "SplittableRandoms will tend to be short-lived." but I'm not sure why. I imagine the Monte Carlo folks will want to run simulations that use a single SplittableRandoms to generate events for hours. Random provides the useful "nextBoolean" and I think SplittableRandom should too. On Sat, Jul 13, 2013 at 6:22 AM, Doug Lea
wrote: > (Sorry to postpone answering this one while tied up in logistics...) > > > On 07/11/13 08:23, Aleksey Shipilev wrote: > >> On 07/11/2013 04:16 PM, Doug Lea wrote: >> >>> (I've been contemplating re-exploring alternatives in TLR, >>> but the options are more limited because it is a subclass >>> of Random. Which made sense at the time I did it, but ...) >>> >> >> What exactly limits us to adopt the PRNG from SR into TLR, thus gaining >> the same good statistical properties? Does extending Random actually >> forces us to match the PRNG j.u.Random has? It does not seem likely if >> we don't control the seed for TLR anyway. >> >> > There are two different questions here: > > 1. Why a new API / class? > > SplittableRandom takes a form that we are likely to see more > of as we improve support for structured parallelism: > > pseudo-interface SplittableGenerator { > T generate(); > SplittableGenerator split(); > } > > As opposed to ThreadLocalRandom's form: > > pseudo-interface PerThreadGenerator { > T generate() { > // lazily construct and use a thread-local instance > } > } > > As I've mentioned, each form is useful, but there's > little overlap in the contexts in which they are useful. > While you can emulate the effects of one with the other, > it's not at all pretty or efficient. Without an explicit call > to split(), the thread-local form would need some side-channel to > construct an instance of known form (rather than default-initialize). > Conversely, without automated thread-local-ness, you'd need > some other means of sharing use of the same instance > in different parts of a program running in the same thread, > and may encounter variants of memory locality/contention > we've seen. > > One underlying motivation for introducing SplittableRandom > in JDK8 is to establish and get some usage experience with > generators of this form, while at the same time addressing a > known gap in java.util.stream support for using random streams. > > 2. Can/should we improve ThreadLocalRandom? > > Probably yes. The ThreadLocalRandom javadocs/specs don't > themselves promise that they use the same base generator > algorithm as java.util.Random. When TLR was introduced > in JDK7, it was a judgement call to make it identical > to java.util.Random except for the the thread-local-ness, > maintaining the same speed/quality tradeoffs. > java.util.Random's algorithm does have known weaknesses, > but it is far from the worst choice. So it is not all > that terrible that java.util.Random specs mandate use > of this algorithm. But for TLR, we should re-explore > options. The algorithm underlying SplittableRandom > (minus everything surrounding splits) is one possible > candidate. > > Since nothing else depends on these internals, so long as > they don't lose RNG quality or noticeably impact > performance, we can look into this during the > performance/functionality improvement phase of OpenJDK8. > > -Doug > > > From pbenedict at apache.org Mon Jul 15 04:47:32 2013 From: pbenedict at apache.org (Paul Benedict) Date: Sun, 14 Jul 2013 23:47:32 -0500 Subject: RFR: 8017513: Support for closeable streams In-Reply-To: <51E37222.8080505@oracle.com> References: <51DDD261.5050406@oracle.com> <51DE6939.40202@redhat.com> <51DF0EFD.605@oracle.com> <51DFE6FF.60009@oracle.com> <51E37222.8080505@oracle.com> Message-ID: It's a post-condition to using the object. I've emphasized the "must" part of the contract but the full contract is: "must be closed when it is no longer needed". That's a pretty clear post-condition language that must be true. So when you're done with the AutoCloseable type, as in the post-condition, it must be closed. That's the expected behavior when using this type. On Sun, Jul 14, 2013 at 10:53 PM, David Holmes wrote: > On 12/07/2013 11:57 PM, Paul Benedict wrote: > >> I see closeability as a postcondition. A subtype can't weaken it. The >> contract of AutoCloseable says its a resource that "must" be closed. Now >> MHCR says it can/should/doesn't have to be closed -- so it is backwards. >> > > A "postcondition" of what? pre- and post-conditions go with methods. > "closeability" is an invariant as far as I can see. Hence must be > maintained in a substitutable subtype - which it is not no matter which way > you try the inheritance. > > David > > >> On Fri, Jul 12, 2013 at 6:22 AM, David Holmes > >> wrote: >> >> On 12/07/2013 6:22 AM, Paul Benedict wrote: >> >> Paul S.'s said the "negative" of using AutoCloseable is "it is >> no longer >> clear whether a stream should be closed or not" (6/20). That's >> true because >> the semantics of AutoCloseable indicates you have a resource >> that requires >> closing. >> >> However, the choice to make MayHoldCloseableResource a >> sub-interface of >> AutoClosable should be resisted. It's an inverted design. The >> Liskov >> *substitution principle *says that sub-interfaces can't loosen >> the contracts >> >> > of their superinterface. >> >> Not quite. It says: >> >> - Preconditions cannot be strengthened in a subtype. >> - Postconditions cannot be weakened in a subtype. >> - Invariants of the supertype must be preserved in a subtype. >> >> Question is: what kind of property is "closeability"? >> >> >> If anything, AutoCloseable should be subclass of this new >> interface, which MIGHT hold a resource that requires closing. >> The current >> choice is just plainly backwards. >> >> >> No what you just said is "plainly backwards". If AutoCloseable is a >> subtype of MHCR then you should be able to use an AC instance >> anywhere you use a MHCR. But valid code doesn't have to close a >> MHCR, so if you replace it with an AC which requires closing then >> you have broken code. Hence not substitutable, hence invalid >> inheritance relationship. >> >> But if anything this is just another variation of the >> Square/Rectangle inheritance fallacy. While you can define either as >> a specialization of the other, you can always violate >> substitutability by doing something that relies on the property that >> gets specialized. >> >> David >> ----- >> >> >> >> For the above reason stated, and for the fact the interface adds >> no new >> functionality, it's superfluous. If the interface relationship >> can't be >> inverted, then chuck it -- it does nothing anyway. At the least, >> keep the >> annotation. >> >> Paul >> >> >> On Thu, Jul 11, 2013 at 3:01 PM, Henry Jen > > wrote: >> >> On 07/11/2013 01:13 AM, Florian Weimer wrote: >> >> On 07/10/2013 11:30 PM, Henry Jen wrote: >> >> A new interface, >> java.util.__**MayHoldCloseableResource, indicates an >> implementation may or may not hold a resource need >> to be closed. >> >> >> Why doesn't close() throw Exception? >> >> >> Because there is really much a developer can do on that >> situation. The >> API simply make it not throw a *checked* exception. >> >> See EG discussion on this topic, >> >> >> http://mail.openjdk.java.net/_** >> _pipermail/lambda-libs-spec-__**experts/2013-June/002081.html >> > experts/2013-June/002081.html >> > >> >> >> Annotation {@link HoldsResource} may be used to >> guide users/static >> analysis tools that a MHCR instance that definitely >> hold a Closeable >> resource. >> >> >> All this looks a bit odd to me. I suppose the idea is >> that you don't >> want to give up the last reference to a closeable >> resource without >> calling close()?and not leak references which out-live >> the call to >> close(). This is definitely not a property of the type >> of the resource, >> so I don't see why the MayHoldCloseableResource >> interface is needed (or >> can confer relevant information). The HoldsResource >> annotation could be >> useful, but based on the current documentation, it's not >> clear if it is >> actually intended to express the data flow property. >> >> >> I would suggest you look at EG discussion on this topic. The >> MHCR is >> different from AutoCloseable on the chances of holding >> critical resources. >> >> Perhaps that suggests the javadoc is not clear enough, I >> would like to >> know what is important and missing. >> >> Cheers, >> Henry >> >> >> >> >> >> >> >> >> -- >> Cheers, >> Paul >> > -- Cheers, Paul From david.holmes at oracle.com Mon Jul 15 05:12:23 2013 From: david.holmes at oracle.com (David Holmes) Date: Mon, 15 Jul 2013 15:12:23 +1000 Subject: RFR: 8017513: Support for closeable streams In-Reply-To: References: <51DDD261.5050406@oracle.com> <51DE6939.40202@redhat.com> <51DF0EFD.605@oracle.com> <51DFE6FF.60009@oracle.com> <51E37222.8080505@oracle.com> Message-ID: <51E384B7.10804@oracle.com> On 15/07/2013 2:47 PM, Paul Benedict wrote: > It's a post-condition to using the object. I've emphasized the "must" > part of the contract but the full contract is: "must be closed when it > is no longer needed". That's a pretty clear post-condition language that > must be true. So when you're done with the AutoCloseable type, as in the > post-condition, it must be closed. That's the expected behavior when > using this type. That's not a post-condition in a type substitutability sense, it is an invariant property of the object. David > > > On Sun, Jul 14, 2013 at 10:53 PM, David Holmes > wrote: > > On 12/07/2013 11:57 PM, Paul Benedict wrote: > > I see closeability as a postcondition. A subtype can't weaken > it. The > contract of AutoCloseable says its a resource that "must" be > closed. Now > MHCR says it can/should/doesn't have to be closed -- so it is > backwards. > > > A "postcondition" of what? pre- and post-conditions go with methods. > "closeability" is an invariant as far as I can see. Hence must be > maintained in a substitutable subtype - which it is not no matter > which way you try the inheritance. > > David > > > On Fri, Jul 12, 2013 at 6:22 AM, David Holmes > > >> wrote: > > On 12/07/2013 6:22 AM, Paul Benedict wrote: > > Paul S.'s said the "negative" of using AutoCloseable is > "it is > no longer > clear whether a stream should be closed or not" (6/20). > That's > true because > the semantics of AutoCloseable indicates you have a > resource > that requires > closing. > > However, the choice to make MayHoldCloseableResource a > sub-interface of > AutoClosable should be resisted. It's an inverted > design. The Liskov > *substitution principle *says that sub-interfaces can't > loosen > the contracts > > > of their superinterface. > > Not quite. It says: > > - Preconditions cannot be strengthened in a subtype. > - Postconditions cannot be weakened in a subtype. > - Invariants of the supertype must be preserved in a subtype. > > Question is: what kind of property is "closeability"? > > > If anything, AutoCloseable should be subclass of this new > interface, which MIGHT hold a resource that requires > closing. > The current > choice is just plainly backwards. > > > No what you just said is "plainly backwards". If > AutoCloseable is a > subtype of MHCR then you should be able to use an AC instance > anywhere you use a MHCR. But valid code doesn't have to close a > MHCR, so if you replace it with an AC which requires > closing then > you have broken code. Hence not substitutable, hence invalid > inheritance relationship. > > But if anything this is just another variation of the > Square/Rectangle inheritance fallacy. While you can define > either as > a specialization of the other, you can always violate > substitutability by doing something that relies on the > property that > gets specialized. > > David > ----- > > > > For the above reason stated, and for the fact the > interface adds > no new > functionality, it's superfluous. If the interface > relationship > can't be > inverted, then chuck it -- it does nothing anyway. At > the least, > keep the > annotation. > > Paul > > > On Thu, Jul 11, 2013 at 3:01 PM, Henry Jen > > >> wrote: > > On 07/11/2013 01:13 AM, Florian Weimer wrote: > > On 07/10/2013 11:30 PM, Henry Jen wrote: > > A new interface, > java.util.____MayHoldCloseableResource, > indicates an > implementation may or may not hold a > resource need > to be closed. > > > Why doesn't close() throw Exception? > > > Because there is really much a developer can do on that > situation. The > API simply make it not throw a *checked* exception. > > See EG discussion on this topic, > > > http://mail.openjdk.java.net/____pipermail/lambda-libs-spec-____experts/2013-June/002081.html > > > > > > > Annotation {@link HoldsResource} may be used to > guide users/static > analysis tools that a MHCR instance that > definitely > hold a Closeable > resource. > > > All this looks a bit odd to me. I suppose the > idea is > that you don't > want to give up the last reference to a closeable > resource without > calling close()?and not leak references which > out-live > the call to > close(). This is definitely not a property of > the type > of the resource, > so I don't see why the MayHoldCloseableResource > interface is needed (or > can confer relevant information). The > HoldsResource > annotation could be > useful, but based on the current documentation, > it's not > clear if it is > actually intended to express the data flow > property. > > > I would suggest you look at EG discussion on this > topic. The > MHCR is > different from AutoCloseable on the chances of holding > critical resources. > > Perhaps that suggests the javadoc is not clear > enough, I > would like to > know what is important and missing. > > Cheers, > Henry > > > > > > > > > -- > Cheers, > Paul > > > > > -- > Cheers, > Paul From david.holmes at oracle.com Mon Jul 15 05:45:02 2013 From: david.holmes at oracle.com (David Holmes) Date: Mon, 15 Jul 2013 15:45:02 +1000 Subject: RFR 7122142 : (ann) Race condition between isAnnotationPresent and getAnnotations In-Reply-To: <7E97F444-388C-4F77-B078-E49388F86908@oracle.com> References: <51DB26F4.8060305@gmail.com> <7E97F444-388C-4F77-B078-E49388F86908@oracle.com> Message-ID: <51E38C5E.50706@oracle.com> Joel, Peter, I've looked at the synchronization changes and the use of CAS and it seems sound. The only performance-related concern is the wasted effort when multiple threads each call "new AnnotationType(annotationClass)". But if that turns out to be an issue we can address it (using memoization pattern that installs a Future for the AnnotationType). Thanks, David >> *From: *Peter Levart > > >> *Subject: **RFR 7122142 : (ann) Race condition between >> isAnnotationPresent and getAnnotations* >> *Date: *8 juli 2013 22:54:12 CEST >> *To: *Joel Borggr?n-Franck > > >> *Cc: *Alan Bateman > >, "core-libs-dev at openjdk.java.net >> core-libs-dev" >> > >> >> Helo, >> >> I need a Reviewer for the following patch: >> >> http://cr.openjdk.java.net/~plevart/jdk8-tl/AnnotationType/webrev.05/ >> >> This fixes deadlock situation described in bug: >> >> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7122142 >> >> The in-depth evaluation of the patch is described in the introductory >> message of this thread: >> >> http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-June/018226.html >> >> The above is the 5th revision of the patch that also makes sure a >> single AnnotationType instance is ever returned for the same Class >> object even when multiple threads concurrently request one. >> >> >> Regards, Peter >> >> On 07/05/2013 04:04 PM, Joel Borggr?n-Franck wrote: >>> Hi Peter, >>> >>> Thanks for the quick update! >>> >>> While I have looked over the changes to j.l.Class and the cas in AnnotationType I don't think I'm qualified to review that. (FWIW it looked fine to me but my jmm isn't swapped in at the moment so I won't pretend to know the interactions between volatile and Unsafe cas). Thinking out loud I suppose we can assume a stable offset of fields in Class, and I realize that part has been under review before. >>> >>> The rest of AnnotationType, AnnotationParser and the tests look fine though. I also ran the tests before and after the change and results were as expected. >>> >>> Since I'm not a Reviewer kind of reviewer you need to get one those to sign off but after that I think you are good to go. I can sponsor this as well if Alan is busy. >>> >>> cheers >>> /Joel >>> >>> On 5 jul 2013, at 11:12, Peter Levart wrote: >>> >>>> Hi Again, >>>> >>>> Sorry, the 4th revision I posted is not rebased to the current tip of jdk8-tl so it contained some diffs that reverted some things. >>>> >>>> Here's the correct patch: >>>> >>>> http://cr.openjdk.java.net/~plevart/jdk8-tl/AnnotationType/webrev.05/ >>>> >>>> >>>> Regards, Peter >>>> >>>> >>>> On 07/05/2013 10:32 AM, Peter Levart wrote: >>>>> Hi Joel, >>>>> >>>>> Here's the 4th revision of the patch: >>>>> >>>>> http://cr.openjdk.java.net/~plevart/jdk8-tl/AnnotationType/webrev.04/ >>>>> >>>>> This one introduces CAS-ing of the AnnotationType instance into the Class.annotationType field so that there's only a single instance ever returned for a single Class. I also introduced new private static Class.Atomic nested class that is used to lazily initialize Unsafe machinery and to provide a safe wrapper for internal j.l.Class use. Previously this was part of ReflectionData nested class because it was only used for it's purpose. In anticipation to have a need for more atomic operations in the future, I moved this code to a separate class. ReflectionData is now just a record. >>>>> >>>>> Regards, Peter >> > From zhong.j.yu at gmail.com Mon Jul 15 07:21:31 2013 From: zhong.j.yu at gmail.com (Zhong Yu) Date: Mon, 15 Jul 2013 02:21:31 -0500 Subject: RFR: 8015317: Optional.filter, map, and flatMap In-Reply-To: References: <51D73CA5.50005@oracle.com> <01A36604-8E66-49E8-A89B-4FF8FC1367FA@oracle.com> <51E230E2.2060305@oracle.com> Message-ID: I guess your methods should return Box to be comparable to Stream/Optional/CompletionStage cases. On Mon, Jul 15, 2013 at 2:17 AM, Jed Wesley-Smith wrote: > ignore me, you do actually need both ? extends on the type constructor and > the inner type ? dunno what I was thinking. > > > On 15 July 2013 13:02, Jed Wesley-Smith wrote: >> >> I'm not entirely sure that is a problem, have a look at the following: >> >> https://gist.github.com/jedws/5993596#file-variancetest-java >> >> it is only the one with a covariance annotation on the parameter that >> fails? >> >> >> On 15 July 2013 12:52, Zhong Yu wrote: >>> >>> Another example of possible missing a wildcard >>> >>> >>> http://gee.cs.oswego.edu/dl/jsr166/dist/docs/java/util/concurrent/CompletionStage.html#thenCompose%28java.util.function.Function%29 >>> >>> thenCompose(Function> fn) >>> >>> should be >>> >>> thenCompose(Function> >>> fn) >>> >>> The problem is probably wide spread, and we need a tool to find these >>> mistakes. >>> >>> Zhong Yu >>> >>> >>> On Sun, Jul 14, 2013 at 8:04 AM, Jed Wesley-Smith >>> wrote: >>> > (accidentally didn't post to the list) >>> > >>> >> You probably know that the example provided is not completed ported to >>> > work with our Optional implementation, >>> > >>> > It should be, for the example I wrote an Optional that is final and >>> > should >>> > be otherwise identical. It should certainly be fairly easy for any >>> > committer to try. If you can make it work without the ? extends >>> > Optional >>> > I'd love an explanation of how. >>> > >>> >> and fugue works around the type system with Option as abstract class. >>> > >>> > As I've tried to explain, this isn't about the implementation of the >>> > container class, but how covariance works with a parameterised class. >>> > >>> > We originally had the non-, but in a discussion with Brian he alerted >>> > us to >>> > the fact that the signature was wrong. We hastily fixed it: >>> > >>> > >>> > https://bitbucket.org/atlassian/fugue/commits/9eca663326a5baeb8f23974732ec585d5627a05c >>> > >>> > To further demonstrate, I give you a minimal example of a final >>> > Optional >>> > implementation that does not compile for this test: >>> > >>> > https://gist.github.com/jedws/5993596#file-gistfile1-java-L57 >>> > >>> > cheers, >>> > jed. >>> > >>> > >>> > >>> > On 14 July 2013 15:02, Henry Jen wrote: >>> > >>> >> I think I understand what you are saying. However, unless we make >>> >> Optional not final, the extends part just doesn't matter. >>> >> >>> >> You probably know that the example provided is not completed ported to >>> >> work with our Optional implementation, and fugue works around the type >>> >> system with Option as abstract class. >>> >> >>> >> Cheers, >>> >> Henry >>> >> >>> >> On Jul 13, 2013, at 4:35 PM, Jed Wesley-Smith >>> >> wrote: >>> >> >>> >> I did supply a test that you can use to try it. >>> >> >>> >> What we are talking about is whether type Box is >>> >> substitutable >>> >> by Box in the contravariant position. Intuitively we think we >>> >> only >>> >> need Box because we only care about the type >>> >> parameter, >>> >> but the type ? as you point out ? is actually different. Box >>> >> is not >>> >> "inherited by" Box. >>> >> >>> >> Specifically, if we have a consuming Box, and we replace it with a >>> >> Box >>> >> of a more specific type parameter, we could attempt feed the more >>> >> general >>> >> type into it, ie. a Box isn't going to appreciate having Parent >>> >> fed >>> >> to it. This is why covariance and mutable containers don't mix well, >>> >> and >>> >> why Java's covariant arrays are problematic. >>> >> >>> >> In this situation we have an immutable container, and we can >>> >> substitute >>> >> the type of our container with one of a more specific type, as it will >>> >> only >>> >> ever supply a value ? and a value of Child will suffice as a Parent. >>> >> So, >>> >> for this case we need a Box that is substitutable, and therefore we >>> >> need to >>> >> add the covariance to our box. >>> >> >>> >> is simply adding covariance to our Box type. >>> >> >>> >> For a much better explanation than I can give about this, see this >>> >> excellent post describing generics in Scala, which ? apart from have >>> >> declaration-site variance and using [A] in place of ? generally >>> >> follow >>> >> the same pattern: >>> >> >>> >> >>> >> >>> >> http://termsandtruthconditions.herokuapp.com/blog/2012/12/29/covariance-and-contravariance-in-scala/ >>> >> >>> >> cheers, >>> >> jed. >>> >> >>> >> >>> >> On 14 July 2013 04:49, Henry Jen wrote: >>> >> >>> >>> I think the type you talking about here is Optional >>> >>> instead >>> >>> of ? extends Optional. >>> >>> >>> >>> IIRC, Optional is not a subtype of Optional, just >>> >>> like >>> >>> any other Collection class. List is not a List. >>> >>> >>> >>> Cheers, >>> >>> Henry >>> >>> >>> >>> >>> >>> On Jul 13, 2013, at 3:15 AM, Jed Wesley-Smith >>> >>> wrote: >>> >>> >>> >>> > The ? extends Optional is unnecessary in flatMap as Optional is >>> >>> final. >>> >>> >>> >>> interestingly enough, it actually is. >>> >>> >>> >>> try the following test: >>> >>> >>> >>> class OptionalTest { >>> >>> class Parent {}; >>> >>> >>> >>> class Child extends Parent {}; >>> >>> >>> >>> @Test public void covariantReturn() { >>> >>> Optional some = some(new Parent()); >>> >>> Function> f = new Function>> >>> Optional>() { >>> >>> @Override public Optional apply(Parent p) { >>> >>> return some(new Child()); >>> >>> } >>> >>> }; >>> >>> Optional mapped = some. flatMap(f); >>> >>> assertThat(mapped.get(), notNullValue()); >>> >>> } >>> >>> } >>> >>> >>> >>> adapted from the fugue test suite: >>> >>> >>> >>> >>> >>> >>> >>> https://bitbucket.org/atlassian/fugue/src/96a65067fb7aaf1edae1bffa07167a5865cbebec/src/test/java/com/atlassian/fugue/OptionTest.java#cl-155 >>> >>> >>> >>> The point to remember is that Optional is a type and as such >>> >>> is >>> >>> actually a subtype of Optional ? and therefore requires a >>> >>> covariant return. >>> >>> >>> >>> cheers, >>> >>> jed. >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> On 13 July 2013 04:15, Mike Duigou wrote: >>> >>> >>> >>>> The ? extends Optional is unnecessary in flatMap as Optional is >>> >>>> final. >>> >>>> Otherwise this looks good. >>> >>>> >>> >>>> Mike >>> >>>> >>> >>>> On Jul 5 2013, at 14:37 , Henry Jen wrote: >>> >>>> >>> >>>> > Hi, >>> >>>> > >>> >>>> > Please review the webrev at >>> >>>> > >>> >>>> > http://cr.openjdk.java.net/~henryjen/ccc/8015317.0/webrev/ >>> >>>> > >>> >>>> > Which adds following method to Optional, >>> >>>> > >>> >>>> > public static Optional ofNullable(T value) {} >>> >>>> > public Optional filter(Predicate predicate) {} >>> >>>> > public Optional map(Function mapper) >>> >>>> > {} >>> >>>> > public Optional flatMap(Function>> >>>> Optional> >>> >>>> > mapper) {} >>> >>>> > >>> >>>> > Also included is some cleanup on javadoc. >>> >>>> > >>> >>>> > Cheers, >>> >>>> > Henry >>> >>>> >>> >>>> >>> >>>> >>> >>> >>> >>> >>> >> >>> >> >>> > >> >> > From fweimer at redhat.com Mon Jul 15 07:54:13 2013 From: fweimer at redhat.com (Florian Weimer) Date: Mon, 15 Jul 2013 09:54:13 +0200 Subject: RFR: 8017513: Support for closeable streams In-Reply-To: <51DFE6FF.60009@oracle.com> References: <51DDD261.5050406@oracle.com> <51DE6939.40202@redhat.com> <51DF0EFD.605@oracle.com> <51DFE6FF.60009@oracle.com> Message-ID: <51E3AAA5.6030901@redhat.com> On 07/12/2013 01:22 PM, David Holmes wrote: > On 12/07/2013 6:22 AM, Paul Benedict wrote: >> Paul S.'s said the "negative" of using AutoCloseable is "it is no longer >> clear whether a stream should be closed or not" (6/20). That's true >> because >> the semantics of AutoCloseable indicates you have a resource that >> requires >> closing. >> >> However, the choice to make MayHoldCloseableResource a sub-interface of >> AutoClosable should be resisted. It's an inverted design. The Liskov >> *substitution principle *says that sub-interfaces can't loosen the >> contracts > > of their superinterface. > > Not quite. It says: > > - Preconditions cannot be strengthened in a subtype. > - Postconditions cannot be weakened in a subtype. > - Invariants of the supertype must be preserved in a subtype. > > Question is: what kind of property is "closeability"? In the Java type system, it's not a property of the type at all. You should call close() on an AutoCloseable reference iff this is the last reference to the object *and* if the close operation does not propagate to some underlying object that outlives the reference (which can happen with FilterInputStream, for example). Is there really a risk that IDEs would warn about missing close() calls in the streams framework? That seems unlikely because without method- and object-specific annotations (which aren't available in other parts of the platform), those diagnostics would be full of false positives. -- Florian Weimer / Red Hat Product Security Team From sean.coffey at oracle.com Mon Jul 15 08:14:26 2013 From: sean.coffey at oracle.com (=?ISO-8859-1?Q?Se=E1n_Coffey?=) Date: Mon, 15 Jul 2013 09:14:26 +0100 Subject: RFR : 8017566 : Backout 8000450 - Cannot access to com.sun.corba.se.impl.orb.ORBImpl In-Reply-To: <51E07700.1080103@oracle.com> References: <51E0013A.4070301@oracle.com> <51E07700.1080103@oracle.com> Message-ID: <51E3AF62.8030209@oracle.com> Mandy, > > Looks fine to me. I agree that we should back it out for 7u40. I > would think we want to leave the change in jdk8 and continue the > investigation and resolving the JCK failures for jdk8. Is that what > you are thinking? If so, we don't need to back it out from jdk8. I was hoping to back out the fix for both jdk7u40 and jdk8. The setup to reproduce is quite simple (modify package list in java.security) and I think it's not necessary to have JCK failures in jdk8 for the short to medium term as a result. regards, Sean. On 12/07/2013 22:37, Mandy Chung wrote: > > On 7/12/2013 9:14 PM, Se?n Coffey wrote: >> The recent 8000450 has caused issue for JCK testing and some RMI/JMX >> testing also.The CORBA package interaction between org.omg, >> com.sun.corba.se.spi, javax.rmi and other packages into >> com.sun.corba.se.impl classes needs better analysis and won't be >> complete for 7u40. >> >> It's rare to have security manager installed with CORBA app but we >> need to cater for it. The JCK testsuite tests this scenario but it >> doesn't have sufficient privileges in the stack when launching the >> CORBA server during test setup phase. None the less, it's something >> the JDK code should handle. The structure of the CORBA packages and >> users of it needs to be better scoped out. For now, I propose >> reversing the change for both jdk8 and jdk7u40. >> >> webrev : http://cr.openjdk.java.net/~coffeys/webrev.8000450.7u40/webrev/ >> > Looks fine to me. I agree that we should back it out for 7u40. I > would think we want to leave the change in jdk8 and continue the > investigation and resolving the JCK failures for jdk8. Is that what > you are thinking? If so, we don't need to back it out from jdk8. > > Mandy > >> regards, >> Sean. > From aleksey.shipilev at oracle.com Mon Jul 15 09:04:14 2013 From: aleksey.shipilev at oracle.com (Aleksey Shipilev) Date: Mon, 15 Jul 2013 13:04:14 +0400 Subject: RFR 7122142 : (ann) Race condition between isAnnotationPresent and getAnnotations In-Reply-To: <51DB26F4.8060305@gmail.com> References: <51C1BEC6.1080308@gmail.com> <51C1FE64.3020000@oracle.com> <51C88EBF.9020704@gmail.com> <51D43A72.8090508@oracle.com> <51D5895B.5020006@gmail.com> <51D68489.2020000@gmail.com> <51D68DED.2030308@gmail.com> <51DB26F4.8060305@gmail.com> Message-ID: <51E3BB0E.8000705@oracle.com> Hi, Peter, Not a reviewer, and have barely any time to have the careful review, so just a few nitpicks below: On 07/09/2013 12:54 AM, Peter Levart wrote: > http://cr.openjdk.java.net/~plevart/jdk8-tl/AnnotationType/webrev.05/ AnnotationParser.java: - Do you want make contains() generic? static boolean contains(T[] array, T element); - Also, you might probably put the null-check in contains(), and simplify the usage - parseAnnotation2 seems a bad name; it seems just overloading parseAnnotation is good. -Aleksey. From joel.franck at oracle.com Mon Jul 15 09:27:10 2013 From: joel.franck at oracle.com (joel.franck at oracle.com) Date: Mon, 15 Jul 2013 09:27:10 +0000 Subject: hg: jdk8/tl/jdk: 7122142: (ann) Race condition between isAnnotationPresent and getAnnotations Message-ID: <20130715092739.9D7D8480AA@hg.openjdk.java.net> Changeset: e4ce6502eac0 Author: plevart Date: 2013-07-15 10:55 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/e4ce6502eac0 7122142: (ann) Race condition between isAnnotationPresent and getAnnotations Reviewed-by: dholmes, jfranck ! src/share/classes/java/lang/Class.java ! src/share/classes/java/lang/System.java ! src/share/classes/sun/misc/JavaLangAccess.java ! src/share/classes/sun/reflect/annotation/AnnotationParser.java ! src/share/classes/sun/reflect/annotation/AnnotationType.java + test/java/lang/annotation/AnnotationType/AnnotationTypeDeadlockTest.java + test/java/lang/annotation/AnnotationType/AnnotationTypeRuntimeAssumptionTest.java From alexey.utkin at oracle.com Mon Jul 15 09:41:02 2013 From: alexey.utkin at oracle.com (Alexey Utkin) Date: Mon, 15 Jul 2013 13:41:02 +0400 Subject: Review request: JDK-8016579 (process) IOException thrown by ProcessBuilder.start() method is incorrectly encoded Message-ID: <51E3C3AE.1020406@oracle.com> Bug description: https://jbs.oracle.com/bugs/browse/JDK-8016579 http://bugs.sun.com/view_bug.do?bug_id=8016579 Here is the suggested fix: http://cr.openjdk.java.net/~uta/openjdk-webrevs/JDK-8016579/webrev.00/ Summary: We have THREE locales in action: 1. Thread default locale - dictates UNICODE-to-8bit conversion 2. OS locale that defines the message localization 3. The file name locale Each locale could be an extended locale, that means that text cannot be mapped to 8bit sequence without multibyte encoding. VM is ready for that, if text is UTF-8. The suggested fix does the work right from the beginning. Unicode version of JVM call: hotspot/src/os/windows/vm/os_windows.cpp: size_t os::lasterror(char* buf, size_t len) was used as prototype for Unicode error message getter. It has to be fixed accordingly as well as jdk/src/windows/native/java/io/io_util_md.c size_t getLastErrorString(char *buf, size_t len) The bug contains the attachment https://jbs.oracle.com/bugs/secure/attachment/14581/JDK-8016579.txt that summarize the fix result in comparison with original implementation. Regards, -uta From peter.levart at gmail.com Mon Jul 15 11:41:22 2013 From: peter.levart at gmail.com (Peter Levart) Date: Mon, 15 Jul 2013 13:41:22 +0200 Subject: RFR 7122142 : (ann) Race condition between isAnnotationPresent and getAnnotations In-Reply-To: <51E38C5E.50706@oracle.com> References: <51DB26F4.8060305@gmail.com> <7E97F444-388C-4F77-B078-E49388F86908@oracle.com> <51E38C5E.50706@oracle.com> Message-ID: <51E3DFE2.10003@gmail.com> Hi David, I think now that recursion is broken by special-purpose parsing code-path and, depending on how we solve the other contention point in j.l.Class.initAnnotationsIfNecessary(), there might be no danger of dead-lock even if we used double-checked locking idiom in AnnotationType.getInstance(). We could re-introduce a singleton lock, which would mean contention when a lot of distinct annotation types need to be constructed at the same time by multiple threads. Or the synchronization could be performed on the 'annotationClass' instance, which is prone to deadlock interaction with user code that synchronizes on the j.l.Class objects while obtaining annotations. So you're right: there would either have to be some private lock object referenced from j.l.Class or an indirection via some kind of Future which memoizes the result for further invocations and which (the Future) has to be installed atomically into the j.l.Class field. But as parsing 2 small annotations and skipping the rest out from a byte[] of raw annotations is a relatively fast operation (I measured about 6...8 ?s on my i7 PC depending on whether there were lots of other meta-annotations present on the annotation or not), I think there will be no problem in wasted CPU cycles even If we keep optimistic construction. But we'll see. Regards, Peter On 07/15/2013 07:45 AM, David Holmes wrote: > Joel, Peter, > > I've looked at the synchronization changes and the use of CAS and it > seems sound. > > The only performance-related concern is the wasted effort when > multiple threads each call "new AnnotationType(annotationClass)". But > if that turns out to be an issue we can address it (using memoization > pattern that installs a Future for the AnnotationType). > > Thanks, > David > >>> *From: *Peter Levart >> > >>> *Subject: **RFR 7122142 : (ann) Race condition between >>> isAnnotationPresent and getAnnotations* >>> *Date: *8 juli 2013 22:54:12 CEST >>> *To: *Joel Borggr?n-Franck >> > >>> *Cc: *Alan Bateman >> >, "core-libs-dev at openjdk.java.net >>> core-libs-dev" >>> >> > >>> >>> Helo, >>> >>> I need a Reviewer for the following patch: >>> >>> http://cr.openjdk.java.net/~plevart/jdk8-tl/AnnotationType/webrev.05/ >>> >>> This fixes deadlock situation described in bug: >>> >>> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7122142 >>> >>> The in-depth evaluation of the patch is described in the introductory >>> message of this thread: >>> >>> http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-June/018226.html >>> >>> >>> The above is the 5th revision of the patch that also makes sure a >>> single AnnotationType instance is ever returned for the same Class >>> object even when multiple threads concurrently request one. >>> >>> >>> Regards, Peter >>> >>> On 07/05/2013 04:04 PM, Joel Borggr?n-Franck wrote: >>>> Hi Peter, >>>> >>>> Thanks for the quick update! >>>> >>>> While I have looked over the changes to j.l.Class and the cas in >>>> AnnotationType I don't think I'm qualified to review that. (FWIW it >>>> looked fine to me but my jmm isn't swapped in at the moment so I >>>> won't pretend to know the interactions between volatile and Unsafe >>>> cas). Thinking out loud I suppose we can assume a stable offset of >>>> fields in Class, and I realize that part has been under review before. >>>> >>>> The rest of AnnotationType, AnnotationParser and the tests look >>>> fine though. I also ran the tests before and after the change and >>>> results were as expected. >>>> >>>> Since I'm not a Reviewer kind of reviewer you need to get one those >>>> to sign off but after that I think you are good to go. I can >>>> sponsor this as well if Alan is busy. >>>> >>>> cheers >>>> /Joel >>>> >>>> On 5 jul 2013, at 11:12, Peter Levart wrote: >>>> >>>>> Hi Again, >>>>> >>>>> Sorry, the 4th revision I posted is not rebased to the current tip >>>>> of jdk8-tl so it contained some diffs that reverted some things. >>>>> >>>>> Here's the correct patch: >>>>> >>>>> http://cr.openjdk.java.net/~plevart/jdk8-tl/AnnotationType/webrev.05/ >>>>> >>>>> >>>>> Regards, Peter >>>>> >>>>> >>>>> On 07/05/2013 10:32 AM, Peter Levart wrote: >>>>>> Hi Joel, >>>>>> >>>>>> Here's the 4th revision of the patch: >>>>>> >>>>>> http://cr.openjdk.java.net/~plevart/jdk8-tl/AnnotationType/webrev.04/ >>>>>> >>>>>> >>>>>> This one introduces CAS-ing of the AnnotationType instance into >>>>>> the Class.annotationType field so that there's only a single >>>>>> instance ever returned for a single Class. I also introduced new >>>>>> private static Class.Atomic nested class that is used to lazily >>>>>> initialize Unsafe machinery and to provide a safe wrapper for >>>>>> internal j.l.Class use. Previously this was part of >>>>>> ReflectionData nested class because it was only used for it's >>>>>> purpose. In anticipation to have a need for more atomic >>>>>> operations in the future, I moved this code to a separate class. >>>>>> ReflectionData is now just a record. >>>>>> >>>>>> Regards, Peter >>> >> From mandy.chung at oracle.com Mon Jul 15 12:30:40 2013 From: mandy.chung at oracle.com (Mandy Chung) Date: Mon, 15 Jul 2013 20:30:40 +0800 Subject: RFR : 8017566 : Backout 8000450 - Cannot access to com.sun.corba.se.impl.orb.ORBImpl In-Reply-To: <51E3AF62.8030209@oracle.com> References: <51E0013A.4070301@oracle.com> <51E07700.1080103@oracle.com> <51E3AF62.8030209@oracle.com> Message-ID: <51E3EB70.6070707@oracle.com> On 7/15/2013 4:14 PM, Se?n Coffey wrote: > Mandy, > >> >> Looks fine to me. I agree that we should back it out for 7u40. I >> would think we want to leave the change in jdk8 and continue the >> investigation and resolving the JCK failures for jdk8. Is that what >> you are thinking? If so, we don't need to back it out from jdk8. > I was hoping to back out the fix for both jdk7u40 and jdk8. The setup > to reproduce is quite simple (modify package list in java.security) > and I think it's not necessary to have JCK failures in jdk8 for the > short to medium term as a result. That's fine. Thanks. I see our concern of fixing 8000450 might take longer time. Mandy From joel.franck at oracle.com Mon Jul 15 12:30:07 2013 From: joel.franck at oracle.com (Joel =?utf-8?Q?Borggr=C3=A9n-Franck?=) Date: Mon, 15 Jul 2013 14:30:07 +0200 Subject: RFR 7122142 : (ann) Race condition between isAnnotationPresent and getAnnotations In-Reply-To: <51E38C5E.50706@oracle.com> References: <51DB26F4.8060305@gmail.com> <7E97F444-388C-4F77-B078-E49388F86908@oracle.com> <51E38C5E.50706@oracle.com> Message-ID: <20130715123007.GA6716@jfranck-desktop.jrpg.bea.com> Thanks for the review David, I have pushed version 5 of the patch. cheers /Joel On 2013-07-15, David Holmes wrote: > Joel, Peter, > > I've looked at the synchronization changes and the use of CAS and it > seems sound. > > The only performance-related concern is the wasted effort when > multiple threads each call "new AnnotationType(annotationClass)". > But if that turns out to be an issue we can address it (using > memoization pattern that installs a Future for the AnnotationType). > > Thanks, > David > > >>*From: *Peter Levart >>> > >>*Subject: **RFR 7122142 : (ann) Race condition between > >>isAnnotationPresent and getAnnotations* > >>*Date: *8 juli 2013 22:54:12 CEST > >>*To: *Joel Borggr?n-Franck >>> > >>*Cc: *Alan Bateman >>>, "core-libs-dev at openjdk.java.net > >> core-libs-dev" > >>> > >> > >>Helo, > >> > >>I need a Reviewer for the following patch: > >> > >>http://cr.openjdk.java.net/~plevart/jdk8-tl/AnnotationType/webrev.05/ > >> > >>This fixes deadlock situation described in bug: > >> > >>http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7122142 > >> > >>The in-depth evaluation of the patch is described in the introductory > >>message of this thread: > >> > >>http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-June/018226.html > >> > >>The above is the 5th revision of the patch that also makes sure a > >>single AnnotationType instance is ever returned for the same Class > >>object even when multiple threads concurrently request one. > >> > >> > >>Regards, Peter > >> > >>On 07/05/2013 04:04 PM, Joel Borggr?n-Franck wrote: > >>>Hi Peter, > >>> > >>>Thanks for the quick update! > >>> > >>>While I have looked over the changes to j.l.Class and the cas in AnnotationType I don't think I'm qualified to review that. (FWIW it looked fine to me but my jmm isn't swapped in at the moment so I won't pretend to know the interactions between volatile and Unsafe cas). Thinking out loud I suppose we can assume a stable offset of fields in Class, and I realize that part has been under review before. > >>> > >>>The rest of AnnotationType, AnnotationParser and the tests look fine though. I also ran the tests before and after the change and results were as expected. > >>> > >>>Since I'm not a Reviewer kind of reviewer you need to get one those to sign off but after that I think you are good to go. I can sponsor this as well if Alan is busy. > >>> > >>>cheers > >>>/Joel > >>> > >>>On 5 jul 2013, at 11:12, Peter Levart wrote: > >>> > >>>>Hi Again, > >>>> > >>>>Sorry, the 4th revision I posted is not rebased to the current tip of jdk8-tl so it contained some diffs that reverted some things. > >>>> > >>>>Here's the correct patch: > >>>> > >>>>http://cr.openjdk.java.net/~plevart/jdk8-tl/AnnotationType/webrev.05/ > >>>> > >>>> > >>>>Regards, Peter > >>>> > >>>> > >>>>On 07/05/2013 10:32 AM, Peter Levart wrote: > >>>>>Hi Joel, > >>>>> > >>>>>Here's the 4th revision of the patch: > >>>>> > >>>>>http://cr.openjdk.java.net/~plevart/jdk8-tl/AnnotationType/webrev.04/ > >>>>> > >>>>>This one introduces CAS-ing of the AnnotationType instance into the Class.annotationType field so that there's only a single instance ever returned for a single Class. I also introduced new private static Class.Atomic nested class that is used to lazily initialize Unsafe machinery and to provide a safe wrapper for internal j.l.Class use. Previously this was part of ReflectionData nested class because it was only used for it's purpose. In anticipation to have a need for more atomic operations in the future, I moved this code to a separate class. ReflectionData is now just a record. > >>>>> > >>>>>Regards, Peter > >> > > From peter.levart at gmail.com Mon Jul 15 12:36:05 2013 From: peter.levart at gmail.com (Peter Levart) Date: Mon, 15 Jul 2013 14:36:05 +0200 Subject: RFR 7122142 : (ann) Race condition between isAnnotationPresent and getAnnotations In-Reply-To: <51E3BB0E.8000705@oracle.com> References: <51C1BEC6.1080308@gmail.com> <51C1FE64.3020000@oracle.com> <51C88EBF.9020704@gmail.com> <51D43A72.8090508@oracle.com> <51D5895B.5020006@gmail.com> <51D68489.2020000@gmail.com> <51D68DED.2030308@gmail.com> <51DB26F4.8060305@gmail.com> <51E3BB0E.8000705@oracle.com> Message-ID: <51E3ECB5.8070406@gmail.com> On 07/15/2013 11:04 AM, Aleksey Shipilev wrote: > Hi, Peter, > > Not a reviewer, and have barely any time to have the careful review, so > just a few nitpicks below: > > On 07/09/2013 12:54 AM, Peter Levart wrote: >> http://cr.openjdk.java.net/~plevart/jdk8-tl/AnnotationType/webrev.05/ > AnnotationParser.java: > - Do you want make contains() generic? > static boolean contains(T[] array, T element); Hi Aleksey, I was guided by the Collection.contains() signature: Collection { boolean contains(Object o); Now I could do this: static boolean contains(T[] array, Object element); But 'T' then looses it's purpose. I think the method is good as is. It's type-safe for any input. > - Also, you might probably put the null-check in contains(), and > simplify the usage I know it's a matter of style mostly, but when I see the following code: if (selectAnnotationClasses != null && !contains(selectAnnotationClasses, annotationClass)) { I don't have to go an check what contains() method does. It's obvious. If there was only the following: if (!contains(selectAnnotationClasses, annotationClass)) { I would immediately jump up with questions: What about when selectAnnotationClasses is null? Will there be NPE, false or true answer? Let's check what contains() does... The usage might seem simplified, but it would be too simplified in my opinion. Now if there were 2 such usages or more, it would be enough to grant creating such method and naming it 'isNullOrContains()' or similar, but for a single usage I think this strikes the right balance between explicit and concise coding. > - parseAnnotation2 seems a bad name; it seems just overloading > parseAnnotation is good. Even here I followed the prior art. Since public parseAnnotations() (and now also package-private parseSelectAnnotations()) delegates to private parseAnnotations2() to do most of the work, I inherited the style and made package-private parseAnnotation() delegate to private parseAnnotation2() to do the parsing. While I agree using '2' suffix (or '0' as in j.l.Class and friends or '_' prefix somewhere else) could be replaced with overloading the same name, I also think that using distinct names makes code easier to follow mentally. But I don't like '2' or '0' or '_' either. So what do you suggest? Maybe privateParseAnnotation(s), or parseAnnotation(s)Impl? It makes sense to overload names in public API but for internal private usage I think it's best to use distinct names (if not for other things, because it's easier to refer to a specific method in texts like messages on mailing list, bug reports, stack-traces, etc...). So should we change '2' to some prefix/suffix word then? Regards, Peter > > -Aleksey. > From sean.coffey at oracle.com Mon Jul 15 12:45:53 2013 From: sean.coffey at oracle.com (sean.coffey at oracle.com) Date: Mon, 15 Jul 2013 12:45:53 +0000 Subject: hg: jdk8/tl/jdk: 8017566: Backout 8000450 - Cannot access to com.sun.corba.se.impl.orb.ORBImpl Message-ID: <20130715124606.E31EC480AE@hg.openjdk.java.net> Changeset: 7cc35dd1885d Author: coffeys Date: 2013-07-15 13:42 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/7cc35dd1885d 8017566: Backout 8000450 - Cannot access to com.sun.corba.se.impl.orb.ORBImpl Reviewed-by: mchung ! src/share/lib/security/java.security-linux ! src/share/lib/security/java.security-macosx ! src/share/lib/security/java.security-solaris ! src/share/lib/security/java.security-windows ! test/java/lang/SecurityManager/CheckPackageAccess.java From aleksey.shipilev at oracle.com Mon Jul 15 13:02:31 2013 From: aleksey.shipilev at oracle.com (Aleksey Shipilev) Date: Mon, 15 Jul 2013 17:02:31 +0400 Subject: RFR 8020292 :Re: class SplittableRandom In-Reply-To: <7B80D649-A0D5-426D-A341-41ED818126C3@oracle.com> References: <51DDB26D.8050506@cs.oswego.edu> <51E037D7.3040305@cs.oswego.edu> <7B80D649-A0D5-426D-A341-41ED818126C3@oracle.com> Message-ID: <51E3F2E7.2080107@oracle.com> On 07/12/2013 09:26 PM, Paul Sandoz wrote: > Here is the webrev: > http://cr.openjdk.java.net/~psandoz/tl/JDK-8020292-splittable-random/webrev/ OK, early performance data follows. I've used a simple benchmark [1] to estimate the standalone costs for getting int/long/double, as well as the usage in trivial recursive FJP processing. Runs were with JDK 8b97, Solaris 10, 2x8x2 SandyBridge running RHEL 5.5. We test: "SR": SplittableRandom.next* "TLR_1": ThreadLocalRandom.current().next* "TLR_2": r.next* // field r = ThreadLocalRandom.current() The results are here [2]. Notable results follow. Standalone: - 64 bit: on moderately saturated machine (1, 16 threads), SR double is marginally faster than TLR, and SR int/long is significantly faster than TLR - 64 bit: on fully-subscribed machine (32 threads), SR int/long/double starts to suffer. Since this is not affected run-to-run, I don't think this is the memory sharing effects, but most likely the execution unit sharing - 32 bit: TLR is vastly faster in int/long standalone scenarios Recursive FJP (average): - average times are notoriously bad for FJP tests, since outliers skew the mean significantly; the results are inconclusive if SR is the performance benefit over TLR (which makes sense) Recursive FJP (sample, 95 percentile): - 64 bit double case: TLR_2 wins over SR, SR wins over TLR_1 - 64 bit int case: SR wins over TLR_1 and TLR_2 - 64 bit long case: SR tied with TLR_2 - 32 bit double case: SR wins big time - 32 bit int case: SR wins over TLR_2, but loses to TLR_1 - 32 bit long case: TLR_2 wins over SR The conclusion is: SR is a reasonable alternative with no obvious performance show-stoppers. That said, TLR is also reasonably fast at this point, and further improvements to TLR will probably beat the SR or tie it on most scenarios. -Aleksey. [1] http://cr.openjdk.java.net/~shade/8020292/splitrandom.tar.gz [2] http://cr.openjdk.java.net/~shade/8020292/data/ From aleksey.shipilev at oracle.com Mon Jul 15 13:11:52 2013 From: aleksey.shipilev at oracle.com (Aleksey Shipilev) Date: Mon, 15 Jul 2013 17:11:52 +0400 Subject: RFR 7122142 : (ann) Race condition between isAnnotationPresent and getAnnotations In-Reply-To: <51E3ECB5.8070406@gmail.com> References: <51C1BEC6.1080308@gmail.com> <51C1FE64.3020000@oracle.com> <51C88EBF.9020704@gmail.com> <51D43A72.8090508@oracle.com> <51D5895B.5020006@gmail.com> <51D68489.2020000@gmail.com> <51D68DED.2030308@gmail.com> <51DB26F4.8060305@gmail.com> <51E3BB0E.8000705@oracle.com> <51E3ECB5.8070406@gmail.com> Message-ID: <51E3F518.6020602@oracle.com> On 07/15/2013 04:36 PM, Peter Levart wrote: > I was guided by the Collection.contains() signature: > > Collection { > boolean contains(Object o); Dunno. This was done for compatibility with non-generic code. In your code, you seem always know the type of the argument, it does not bother me to check to have the "T element" in parameter. >> - Also, you might probably put the null-check in contains(), and >> simplify the usage > if (!contains(selectAnnotationClasses, annotationClass)) { > > I would immediately jump up with questions: What about when > selectAnnotationClasses is null? Will there be NPE, false or true > answer? Let's check what contains() does... Set-theoretically speaking, I would expect it returning false for either "empty" or "null" array. But then again, I can relate to the need to cross-check that in contains() once I spot this in the code. >> - parseAnnotation2 seems a bad name; it seems just overloading >> parseAnnotation is good. > > Even here I followed the prior art. Sounds fair. > So should we change '2' to some prefix/suffix word then? I always thought the numberry suffixes are there to segregate the vastly different implementations. E.g. multiple methods the pure Java method calling the native method with doing the it's bidding. Or, multiple public methods delegating to the same internal one, reshuffling the arguments. I think the "0" suffix is the good style to follow in these cases. -Aleksey. From peter.levart at gmail.com Mon Jul 15 13:38:02 2013 From: peter.levart at gmail.com (Peter Levart) Date: Mon, 15 Jul 2013 15:38:02 +0200 Subject: RFR 7122142 : (ann) Race condition between isAnnotationPresent and getAnnotations In-Reply-To: <20130715123007.GA6716@jfranck-desktop.jrpg.bea.com> References: <51DB26F4.8060305@gmail.com> <7E97F444-388C-4F77-B078-E49388F86908@oracle.com> <51E38C5E.50706@oracle.com> <20130715123007.GA6716@jfranck-desktop.jrpg.bea.com> Message-ID: <51E3FB3A.3060601@gmail.com> Thank you Joel, Alan, David and Aleksey for reviews. Regards, Peter On 07/15/2013 02:30 PM, Joel Borggr?n-Franck wrote: > Thanks for the review David, > > I have pushed version 5 of the patch. > > cheers > /Joel > > On 2013-07-15, David Holmes wrote: >> Joel, Peter, >> >> I've looked at the synchronization changes and the use of CAS and it >> seems sound. >> >> The only performance-related concern is the wasted effort when >> multiple threads each call "new AnnotationType(annotationClass)". >> But if that turns out to be an issue we can address it (using >> memoization pattern that installs a Future for the AnnotationType). >> >> Thanks, >> David >> >>>> *From: *Peter Levart >>> > >>>> *Subject: **RFR 7122142 : (ann) Race condition between >>>> isAnnotationPresent and getAnnotations* >>>> *Date: *8 juli 2013 22:54:12 CEST >>>> *To: *Joel Borggr?n-Franck >>> > >>>> *Cc: *Alan Bateman >>> >, "core-libs-dev at openjdk.java.net >>>> core-libs-dev" >>>> > >>>> >>>> Helo, >>>> >>>> I need a Reviewer for the following patch: >>>> >>>> http://cr.openjdk.java.net/~plevart/jdk8-tl/AnnotationType/webrev.05/ >>>> >>>> This fixes deadlock situation described in bug: >>>> >>>> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7122142 >>>> >>>> The in-depth evaluation of the patch is described in the introductory >>>> message of this thread: >>>> >>>> http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-June/018226.html >>>> >>>> The above is the 5th revision of the patch that also makes sure a >>>> single AnnotationType instance is ever returned for the same Class >>>> object even when multiple threads concurrently request one. >>>> >>>> >>>> Regards, Peter >>>> >>>> On 07/05/2013 04:04 PM, Joel Borggr?n-Franck wrote: >>>>> Hi Peter, >>>>> >>>>> Thanks for the quick update! >>>>> >>>>> While I have looked over the changes to j.l.Class and the cas in AnnotationType I don't think I'm qualified to review that. (FWIW it looked fine to me but my jmm isn't swapped in at the moment so I won't pretend to know the interactions between volatile and Unsafe cas). Thinking out loud I suppose we can assume a stable offset of fields in Class, and I realize that part has been under review before. >>>>> >>>>> The rest of AnnotationType, AnnotationParser and the tests look fine though. I also ran the tests before and after the change and results were as expected. >>>>> >>>>> Since I'm not a Reviewer kind of reviewer you need to get one those to sign off but after that I think you are good to go. I can sponsor this as well if Alan is busy. >>>>> >>>>> cheers >>>>> /Joel >>>>> >>>>> On 5 jul 2013, at 11:12, Peter Levart wrote: >>>>> >>>>>> Hi Again, >>>>>> >>>>>> Sorry, the 4th revision I posted is not rebased to the current tip of jdk8-tl so it contained some diffs that reverted some things. >>>>>> >>>>>> Here's the correct patch: >>>>>> >>>>>> http://cr.openjdk.java.net/~plevart/jdk8-tl/AnnotationType/webrev.05/ >>>>>> >>>>>> >>>>>> Regards, Peter >>>>>> >>>>>> >>>>>> On 07/05/2013 10:32 AM, Peter Levart wrote: >>>>>>> Hi Joel, >>>>>>> >>>>>>> Here's the 4th revision of the patch: >>>>>>> >>>>>>> http://cr.openjdk.java.net/~plevart/jdk8-tl/AnnotationType/webrev.04/ >>>>>>> >>>>>>> This one introduces CAS-ing of the AnnotationType instance into the Class.annotationType field so that there's only a single instance ever returned for a single Class. I also introduced new private static Class.Atomic nested class that is used to lazily initialize Unsafe machinery and to provide a safe wrapper for internal j.l.Class use. Previously this was part of ReflectionData nested class because it was only used for it's purpose. In anticipation to have a need for more atomic operations in the future, I moved this code to a separate class. ReflectionData is now just a record. >>>>>>> >>>>>>> Regards, Peter From peter.levart at gmail.com Mon Jul 15 13:43:48 2013 From: peter.levart at gmail.com (Peter Levart) Date: Mon, 15 Jul 2013 15:43:48 +0200 Subject: RFR 8020292 :Re: class SplittableRandom In-Reply-To: <51E3F2E7.2080107@oracle.com> References: <51DDB26D.8050506@cs.oswego.edu> <51E037D7.3040305@cs.oswego.edu> <7B80D649-A0D5-426D-A341-41ED818126C3@oracle.com> <51E3F2E7.2080107@oracle.com> Message-ID: <51E3FC94.8060901@gmail.com> On 07/15/2013 03:02 PM, Aleksey Shipilev wrote: > The results are here [2]. Notable results follow. Hi Aleksey, Somehow the files in the directories under: http://cr.openjdk.java.net/~shade/8020292/data/ ... are not accessible (403 - Forbidden), although the sub-directories are browsable... Peter From aleksey.shipilev at oracle.com Mon Jul 15 13:47:39 2013 From: aleksey.shipilev at oracle.com (Aleksey Shipilev) Date: Mon, 15 Jul 2013 17:47:39 +0400 Subject: RFR 8020292 :Re: class SplittableRandom In-Reply-To: <51E3FC94.8060901@gmail.com> References: <51DDB26D.8050506@cs.oswego.edu> <51E037D7.3040305@cs.oswego.edu> <7B80D649-A0D5-426D-A341-41ED818126C3@oracle.com> <51E3F2E7.2080107@oracle.com> <51E3FC94.8060901@gmail.com> Message-ID: <51E3FD7B.7070903@oracle.com> On 07/15/2013 05:43 PM, Peter Levart wrote: > On 07/15/2013 03:02 PM, Aleksey Shipilev wrote: >> The results are here [2]. Notable results follow. > Somehow the files in the directories under: > > http://cr.openjdk.java.net/~shade/8020292/data/ > > ... are not accessible (403 - Forbidden), although the sub-directories > are browsable... Thanks, should be fixed now. -Aleksey. From dl at cs.oswego.edu Mon Jul 15 15:27:02 2013 From: dl at cs.oswego.edu (Doug Lea) Date: Mon, 15 Jul 2013 11:27:02 -0400 Subject: class SplittableRandom In-Reply-To: References: <51DDB26D.8050506@cs.oswego.edu> <51DE6069.2060308@gmail.com> <51DEA230.2060504@cs.oswego.edu> <51DEA3D5.5000509@oracle.com> <51E1549D.4060403@cs.oswego.edu> Message-ID: <51E414C6.9070400@cs.oswego.edu> On 07/15/13 00:24, Martin Buchholz wrote: > Thoughts: > > I was sad when ThreadLocalRandom reused the lousy pseudorandom implementation > from Random. I continue to think we can do better. Yes, I'm working on it. > > It would be nice if we could guarantee a minimum period of 2^64. OK. I cannot think of any reason not to. Unless anyone else can, I'll add this. > > Doug, you say "SplittableRandoms will tend to be short-lived." but I'm not sure > why. I meant "short-lived in the contexts that would otherwise lead to memory placement issues." In other words, we hope people still use TLR, not a thread-localized SplittableRandom, in these cases. > > Random provides the useful "nextBoolean" and I think SplittableRandom should too. > It's partway down the slippery slope of also supporting the other java.util.Random methods we have no intention of supporting, but I cannot see the harm. -Doug From jed at wesleysmith.io Sat Jul 13 23:35:47 2013 From: jed at wesleysmith.io (Jed Wesley-Smith) Date: Sun, 14 Jul 2013 09:35:47 +1000 Subject: RFR: 8015317: Optional.filter, map, and flatMap In-Reply-To: <01A36604-8E66-49E8-A89B-4FF8FC1367FA@oracle.com> References: <51D73CA5.50005@oracle.com> <01A36604-8E66-49E8-A89B-4FF8FC1367FA@oracle.com> Message-ID: I did supply a test that you can use to try it. What we are talking about is whether type Box is substitutable by Box in the contravariant position. Intuitively we think we only need Box because we only care about the type parameter, but the type ? as you point out ? is actually different. Box is not "inherited by" Box. Specifically, if we have a consuming Box, and we replace it with a Box of a more specific type parameter, we could attempt feed the more general type into it, ie. a Box isn't going to appreciate having Parent fed to it. This is why covariance and mutable containers don't mix well, and why Java's covariant arrays are problematic. In this situation we have an immutable container, and we can substitute the type of our container with one of a more specific type, as it will only ever supply a value ? and a value of Child will suffice as a Parent. So, for this case we need a Box that is substitutable, and therefore we need to add the covariance to our box. is simply adding covariance to our Box type. For a much better explanation than I can give about this, see this excellent post describing generics in Scala, which ? apart from have declaration-site variance and using [A] in place of ? generally follow the same pattern: http://termsandtruthconditions.herokuapp.com/blog/2012/12/29/covariance-and-contravariance-in-scala/ cheers, jed. On 14 July 2013 04:49, Henry Jen wrote: > I think the type you talking about here is Optional instead > of ? extends Optional. > > IIRC, Optional is not a subtype of Optional, just like any > other Collection class. List is not a List. > > Cheers, > Henry > > > On Jul 13, 2013, at 3:15 AM, Jed Wesley-Smith wrote: > > > The ? extends Optional is unnecessary in flatMap as Optional is final. > > interestingly enough, it actually is. > > try the following test: > > class OptionalTest { > class Parent {}; > > class Child extends Parent {}; > > @Test public void covariantReturn() { > Optional some = some(new Parent()); > Function> f = new Function Optional>() { > @Override public Optional apply(Parent p) { > return some(new Child()); > } > }; > Optional mapped = some. flatMap(f); > assertThat(mapped.get(), notNullValue()); > } > } > > adapted from the fugue test suite: > > > https://bitbucket.org/atlassian/fugue/src/96a65067fb7aaf1edae1bffa07167a5865cbebec/src/test/java/com/atlassian/fugue/OptionTest.java#cl-155 > > The point to remember is that Optional is a type and as such is > actually a subtype of Optional ? and therefore requires a > covariant return. > > cheers, > jed. > > > > > On 13 July 2013 04:15, Mike Duigou wrote: > >> The ? extends Optional is unnecessary in flatMap as Optional is final. >> Otherwise this looks good. >> >> Mike >> >> On Jul 5 2013, at 14:37 , Henry Jen wrote: >> >> > Hi, >> > >> > Please review the webrev at >> > >> > http://cr.openjdk.java.net/~henryjen/ccc/8015317.0/webrev/ >> > >> > Which adds following method to Optional, >> > >> > public static Optional ofNullable(T value) {} >> > public Optional filter(Predicate predicate) {} >> > public Optional map(Function mapper) {} >> > public Optional flatMap(Function> >> > mapper) {} >> > >> > Also included is some cleanup on javadoc. >> > >> > Cheers, >> > Henry >> >> >> > > From jed at wesleysmith.io Sun Jul 14 13:04:29 2013 From: jed at wesleysmith.io (Jed Wesley-Smith) Date: Sun, 14 Jul 2013 23:04:29 +1000 Subject: RFR: 8015317: Optional.filter, map, and flatMap In-Reply-To: <51E230E2.2060305@oracle.com> References: <51D73CA5.50005@oracle.com> <01A36604-8E66-49E8-A89B-4FF8FC1367FA@oracle.com> <51E230E2.2060305@oracle.com> Message-ID: (accidentally didn't post to the list) > You probably know that the example provided is not completed ported to work with our Optional implementation, It should be, for the example I wrote an Optional that is final and should be otherwise identical. It should certainly be fairly easy for any committer to try. If you can make it work without the ? extends Optional I'd love an explanation of how. > and fugue works around the type system with Option as abstract class. As I've tried to explain, this isn't about the implementation of the container class, but how covariance works with a parameterised class. We originally had the non-, but in a discussion with Brian he alerted us to the fact that the signature was wrong. We hastily fixed it: https://bitbucket.org/atlassian/fugue/commits/9eca663326a5baeb8f23974732ec585d5627a05c To further demonstrate, I give you a minimal example of a final Optional implementation that does not compile for this test: https://gist.github.com/jedws/5993596#file-gistfile1-java-L57 cheers, jed. On 14 July 2013 15:02, Henry Jen wrote: > I think I understand what you are saying. However, unless we make > Optional not final, the extends part just doesn't matter. > > You probably know that the example provided is not completed ported to > work with our Optional implementation, and fugue works around the type > system with Option as abstract class. > > Cheers, > Henry > > On Jul 13, 2013, at 4:35 PM, Jed Wesley-Smith wrote: > > I did supply a test that you can use to try it. > > What we are talking about is whether type Box is substitutable > by Box in the contravariant position. Intuitively we think we only > need Box because we only care about the type parameter, > but the type ? as you point out ? is actually different. Box is not > "inherited by" Box. > > Specifically, if we have a consuming Box, and we replace it with a Box > of a more specific type parameter, we could attempt feed the more general > type into it, ie. a Box isn't going to appreciate having Parent fed > to it. This is why covariance and mutable containers don't mix well, and > why Java's covariant arrays are problematic. > > In this situation we have an immutable container, and we can substitute > the type of our container with one of a more specific type, as it will only > ever supply a value ? and a value of Child will suffice as a Parent. So, > for this case we need a Box that is substitutable, and therefore we need to > add the covariance to our box. > > is simply adding covariance to our Box type. > > For a much better explanation than I can give about this, see this > excellent post describing generics in Scala, which ? apart from have > declaration-site variance and using [A] in place of ? generally follow > the same pattern: > > > http://termsandtruthconditions.herokuapp.com/blog/2012/12/29/covariance-and-contravariance-in-scala/ > > cheers, > jed. > > > On 14 July 2013 04:49, Henry Jen wrote: > >> I think the type you talking about here is Optional instead >> of ? extends Optional. >> >> IIRC, Optional is not a subtype of Optional, just like >> any other Collection class. List is not a List. >> >> Cheers, >> Henry >> >> >> On Jul 13, 2013, at 3:15 AM, Jed Wesley-Smith >> wrote: >> >> > The ? extends Optional is unnecessary in flatMap as Optional is final. >> >> interestingly enough, it actually is. >> >> try the following test: >> >> class OptionalTest { >> class Parent {}; >> >> class Child extends Parent {}; >> >> @Test public void covariantReturn() { >> Optional some = some(new Parent()); >> Function> f = new Function> Optional>() { >> @Override public Optional apply(Parent p) { >> return some(new Child()); >> } >> }; >> Optional mapped = some. flatMap(f); >> assertThat(mapped.get(), notNullValue()); >> } >> } >> >> adapted from the fugue test suite: >> >> >> https://bitbucket.org/atlassian/fugue/src/96a65067fb7aaf1edae1bffa07167a5865cbebec/src/test/java/com/atlassian/fugue/OptionTest.java#cl-155 >> >> The point to remember is that Optional is a type and as such is >> actually a subtype of Optional ? and therefore requires a >> covariant return. >> >> cheers, >> jed. >> >> >> >> >> On 13 July 2013 04:15, Mike Duigou wrote: >> >>> The ? extends Optional is unnecessary in flatMap as Optional is final. >>> Otherwise this looks good. >>> >>> Mike >>> >>> On Jul 5 2013, at 14:37 , Henry Jen wrote: >>> >>> > Hi, >>> > >>> > Please review the webrev at >>> > >>> > http://cr.openjdk.java.net/~henryjen/ccc/8015317.0/webrev/ >>> > >>> > Which adds following method to Optional, >>> > >>> > public static Optional ofNullable(T value) {} >>> > public Optional filter(Predicate predicate) {} >>> > public Optional map(Function mapper) {} >>> > public Optional flatMap(Function>> Optional> >>> > mapper) {} >>> > >>> > Also included is some cleanup on javadoc. >>> > >>> > Cheers, >>> > Henry >>> >>> >>> >> >> > > From jed at wesleysmith.io Sat Jul 13 10:15:23 2013 From: jed at wesleysmith.io (Jed Wesley-Smith) Date: Sat, 13 Jul 2013 20:15:23 +1000 Subject: RFR: 8015317: Optional.filter, map, and flatMap In-Reply-To: References: <51D73CA5.50005@oracle.com> Message-ID: > The ? extends Optional is unnecessary in flatMap as Optional is final. interestingly enough, it actually is. try the following test: class OptionalTest { class Parent {}; class Child extends Parent {}; @Test public void covariantReturn() { Optional some = some(new Parent()); Function> f = new Function>() { @Override public Optional apply(Parent p) { return some(new Child()); } }; Optional mapped = some. flatMap(f); assertThat(mapped.get(), notNullValue()); } } adapted from the fugue test suite: https://bitbucket.org/atlassian/fugue/src/96a65067fb7aaf1edae1bffa07167a5865cbebec/src/test/java/com/atlassian/fugue/OptionTest.java#cl-155 The point to remember is that Optional is a type and as such is actually a subtype of Optional ? and therefore requires a covariant return. cheers, jed. On 13 July 2013 04:15, Mike Duigou wrote: > The ? extends Optional is unnecessary in flatMap as Optional is final. > Otherwise this looks good. > > Mike > > On Jul 5 2013, at 14:37 , Henry Jen wrote: > > > Hi, > > > > Please review the webrev at > > > > http://cr.openjdk.java.net/~henryjen/ccc/8015317.0/webrev/ > > > > Which adds following method to Optional, > > > > public static Optional ofNullable(T value) {} > > public Optional filter(Predicate predicate) {} > > public Optional map(Function mapper) {} > > public Optional flatMap(Function> > > mapper) {} > > > > Also included is some cleanup on javadoc. > > > > Cheers, > > Henry > > > From jed at wesleysmith.io Mon Jul 15 03:02:33 2013 From: jed at wesleysmith.io (Jed Wesley-Smith) Date: Mon, 15 Jul 2013 13:02:33 +1000 Subject: RFR: 8015317: Optional.filter, map, and flatMap In-Reply-To: References: <51D73CA5.50005@oracle.com> <01A36604-8E66-49E8-A89B-4FF8FC1367FA@oracle.com> <51E230E2.2060305@oracle.com> Message-ID: I'm not entirely sure that is a problem, have a look at the following: https://gist.github.com/jedws/5993596#file-variancetest-java it is only the one with a covariance annotation on the parameter that fails? On 15 July 2013 12:52, Zhong Yu wrote: > Another example of possible missing a wildcard > > > http://gee.cs.oswego.edu/dl/jsr166/dist/docs/java/util/concurrent/CompletionStage.html#thenCompose%28java.util.function.Function%29 > > thenCompose(Function> fn) > > should be > > thenCompose(Function> > fn) > > The problem is probably wide spread, and we need a tool to find these > mistakes. > > Zhong Yu > > > On Sun, Jul 14, 2013 at 8:04 AM, Jed Wesley-Smith > wrote: > > (accidentally didn't post to the list) > > > >> You probably know that the example provided is not completed ported to > > work with our Optional implementation, > > > > It should be, for the example I wrote an Optional that is final and > should > > be otherwise identical. It should certainly be fairly easy for any > > committer to try. If you can make it work without the ? extends Optional > > I'd love an explanation of how. > > > >> and fugue works around the type system with Option as abstract class. > > > > As I've tried to explain, this isn't about the implementation of the > > container class, but how covariance works with a parameterised class. > > > > We originally had the non-, but in a discussion with Brian he alerted us > to > > the fact that the signature was wrong. We hastily fixed it: > > > > > https://bitbucket.org/atlassian/fugue/commits/9eca663326a5baeb8f23974732ec585d5627a05c > > > > To further demonstrate, I give you a minimal example of a final Optional > > implementation that does not compile for this test: > > > > https://gist.github.com/jedws/5993596#file-gistfile1-java-L57 > > > > cheers, > > jed. > > > > > > > > On 14 July 2013 15:02, Henry Jen wrote: > > > >> I think I understand what you are saying. However, unless we make > >> Optional not final, the extends part just doesn't matter. > >> > >> You probably know that the example provided is not completed ported to > >> work with our Optional implementation, and fugue works around the type > >> system with Option as abstract class. > >> > >> Cheers, > >> Henry > >> > >> On Jul 13, 2013, at 4:35 PM, Jed Wesley-Smith < > jed at wesleysmith.io>wrote: > >> > >> I did supply a test that you can use to try it. > >> > >> What we are talking about is whether type Box is substitutable > >> by Box in the contravariant position. Intuitively we think we > only > >> need Box because we only care about the type > parameter, > >> but the type ? as you point out ? is actually different. Box is > not > >> "inherited by" Box. > >> > >> Specifically, if we have a consuming Box, and we replace it with a Box > >> of a more specific type parameter, we could attempt feed the more > general > >> type into it, ie. a Box isn't going to appreciate having Parent > fed > >> to it. This is why covariance and mutable containers don't mix well, and > >> why Java's covariant arrays are problematic. > >> > >> In this situation we have an immutable container, and we can substitute > >> the type of our container with one of a more specific type, as it will > only > >> ever supply a value ? and a value of Child will suffice as a Parent. So, > >> for this case we need a Box that is substitutable, and therefore we > need to > >> add the covariance to our box. > >> > >> is simply adding covariance to our Box type. > >> > >> For a much better explanation than I can give about this, see this > >> excellent post describing generics in Scala, which ? apart from have > >> declaration-site variance and using [A] in place of ? generally > follow > >> the same pattern: > >> > >> > >> > http://termsandtruthconditions.herokuapp.com/blog/2012/12/29/covariance-and-contravariance-in-scala/ > >> > >> cheers, > >> jed. > >> > >> > >> On 14 July 2013 04:49, Henry Jen wrote: > >> > >>> I think the type you talking about here is Optional > instead > >>> of ? extends Optional. > >>> > >>> IIRC, Optional is not a subtype of Optional, just like > >>> any other Collection class. List is not a List. > >>> > >>> Cheers, > >>> Henry > >>> > >>> > >>> On Jul 13, 2013, at 3:15 AM, Jed Wesley-Smith > >>> wrote: > >>> > >>> > The ? extends Optional is unnecessary in flatMap as Optional is > final. > >>> > >>> interestingly enough, it actually is. > >>> > >>> try the following test: > >>> > >>> class OptionalTest { > >>> class Parent {}; > >>> > >>> class Child extends Parent {}; > >>> > >>> @Test public void covariantReturn() { > >>> Optional some = some(new Parent()); > >>> Function> f = new Function >>> Optional>() { > >>> @Override public Optional apply(Parent p) { > >>> return some(new Child()); > >>> } > >>> }; > >>> Optional mapped = some. flatMap(f); > >>> assertThat(mapped.get(), notNullValue()); > >>> } > >>> } > >>> > >>> adapted from the fugue test suite: > >>> > >>> > >>> > https://bitbucket.org/atlassian/fugue/src/96a65067fb7aaf1edae1bffa07167a5865cbebec/src/test/java/com/atlassian/fugue/OptionTest.java#cl-155 > >>> > >>> The point to remember is that Optional is a type and as such is > >>> actually a subtype of Optional ? and therefore requires a > >>> covariant return. > >>> > >>> cheers, > >>> jed. > >>> > >>> > >>> > >>> > >>> On 13 July 2013 04:15, Mike Duigou wrote: > >>> > >>>> The ? extends Optional is unnecessary in flatMap as Optional is final. > >>>> Otherwise this looks good. > >>>> > >>>> Mike > >>>> > >>>> On Jul 5 2013, at 14:37 , Henry Jen wrote: > >>>> > >>>> > Hi, > >>>> > > >>>> > Please review the webrev at > >>>> > > >>>> > http://cr.openjdk.java.net/~henryjen/ccc/8015317.0/webrev/ > >>>> > > >>>> > Which adds following method to Optional, > >>>> > > >>>> > public static Optional ofNullable(T value) {} > >>>> > public Optional filter(Predicate predicate) {} > >>>> > public Optional map(Function mapper) > {} > >>>> > public Optional flatMap(Function >>>> Optional> > >>>> > mapper) {} > >>>> > > >>>> > Also included is some cleanup on javadoc. > >>>> > > >>>> > Cheers, > >>>> > Henry > >>>> > >>>> > >>>> > >>> > >>> > >> > >> > > > From jed at wesleysmith.io Mon Jul 15 07:17:08 2013 From: jed at wesleysmith.io (Jed Wesley-Smith) Date: Mon, 15 Jul 2013 17:17:08 +1000 Subject: RFR: 8015317: Optional.filter, map, and flatMap In-Reply-To: References: <51D73CA5.50005@oracle.com> <01A36604-8E66-49E8-A89B-4FF8FC1367FA@oracle.com> <51E230E2.2060305@oracle.com> Message-ID: ignore me, you do actually need both ? extends on the type constructor and the inner type ? dunno what I was thinking. On 15 July 2013 13:02, Jed Wesley-Smith wrote: > I'm not entirely sure that is a problem, have a look at the following: > > https://gist.github.com/jedws/5993596#file-variancetest-java > > it is only the one with a covariance annotation on the parameter that > fails? > > > On 15 July 2013 12:52, Zhong Yu wrote: > >> Another example of possible missing a wildcard >> >> >> http://gee.cs.oswego.edu/dl/jsr166/dist/docs/java/util/concurrent/CompletionStage.html#thenCompose%28java.util.function.Function%29 >> >> thenCompose(Function> fn) >> >> should be >> >> thenCompose(Function> >> fn) >> >> The problem is probably wide spread, and we need a tool to find these >> mistakes. >> >> Zhong Yu >> >> >> On Sun, Jul 14, 2013 at 8:04 AM, Jed Wesley-Smith >> wrote: >> > (accidentally didn't post to the list) >> > >> >> You probably know that the example provided is not completed ported to >> > work with our Optional implementation, >> > >> > It should be, for the example I wrote an Optional that is final and >> should >> > be otherwise identical. It should certainly be fairly easy for any >> > committer to try. If you can make it work without the ? extends Optional >> > I'd love an explanation of how. >> > >> >> and fugue works around the type system with Option as abstract class. >> > >> > As I've tried to explain, this isn't about the implementation of the >> > container class, but how covariance works with a parameterised class. >> > >> > We originally had the non-, but in a discussion with Brian he alerted >> us to >> > the fact that the signature was wrong. We hastily fixed it: >> > >> > >> https://bitbucket.org/atlassian/fugue/commits/9eca663326a5baeb8f23974732ec585d5627a05c >> > >> > To further demonstrate, I give you a minimal example of a final Optional >> > implementation that does not compile for this test: >> > >> > https://gist.github.com/jedws/5993596#file-gistfile1-java-L57 >> > >> > cheers, >> > jed. >> > >> > >> > >> > On 14 July 2013 15:02, Henry Jen wrote: >> > >> >> I think I understand what you are saying. However, unless we make >> >> Optional not final, the extends part just doesn't matter. >> >> >> >> You probably know that the example provided is not completed ported to >> >> work with our Optional implementation, and fugue works around the type >> >> system with Option as abstract class. >> >> >> >> Cheers, >> >> Henry >> >> >> >> On Jul 13, 2013, at 4:35 PM, Jed Wesley-Smith < >> jed at wesleysmith.io>wrote: >> >> >> >> I did supply a test that you can use to try it. >> >> >> >> What we are talking about is whether type Box is substitutable >> >> by Box in the contravariant position. Intuitively we think we >> only >> >> need Box because we only care about the type >> parameter, >> >> but the type ? as you point out ? is actually different. Box >> is not >> >> "inherited by" Box. >> >> >> >> Specifically, if we have a consuming Box, and we replace it with a Box >> >> of a more specific type parameter, we could attempt feed the more >> general >> >> type into it, ie. a Box isn't going to appreciate having Parent >> fed >> >> to it. This is why covariance and mutable containers don't mix well, >> and >> >> why Java's covariant arrays are problematic. >> >> >> >> In this situation we have an immutable container, and we can >> substitute >> >> the type of our container with one of a more specific type, as it will >> only >> >> ever supply a value ? and a value of Child will suffice as a Parent. >> So, >> >> for this case we need a Box that is substitutable, and therefore we >> need to >> >> add the covariance to our box. >> >> >> >> is simply adding covariance to our Box type. >> >> >> >> For a much better explanation than I can give about this, see this >> >> excellent post describing generics in Scala, which ? apart from have >> >> declaration-site variance and using [A] in place of ? generally >> follow >> >> the same pattern: >> >> >> >> >> >> >> http://termsandtruthconditions.herokuapp.com/blog/2012/12/29/covariance-and-contravariance-in-scala/ >> >> >> >> cheers, >> >> jed. >> >> >> >> >> >> On 14 July 2013 04:49, Henry Jen wrote: >> >> >> >>> I think the type you talking about here is Optional >> instead >> >>> of ? extends Optional. >> >>> >> >>> IIRC, Optional is not a subtype of Optional, just >> like >> >>> any other Collection class. List is not a List. >> >>> >> >>> Cheers, >> >>> Henry >> >>> >> >>> >> >>> On Jul 13, 2013, at 3:15 AM, Jed Wesley-Smith >> >>> wrote: >> >>> >> >>> > The ? extends Optional is unnecessary in flatMap as Optional is >> final. >> >>> >> >>> interestingly enough, it actually is. >> >>> >> >>> try the following test: >> >>> >> >>> class OptionalTest { >> >>> class Parent {}; >> >>> >> >>> class Child extends Parent {}; >> >>> >> >>> @Test public void covariantReturn() { >> >>> Optional some = some(new Parent()); >> >>> Function> f = new Function> >>> Optional>() { >> >>> @Override public Optional apply(Parent p) { >> >>> return some(new Child()); >> >>> } >> >>> }; >> >>> Optional mapped = some. flatMap(f); >> >>> assertThat(mapped.get(), notNullValue()); >> >>> } >> >>> } >> >>> >> >>> adapted from the fugue test suite: >> >>> >> >>> >> >>> >> https://bitbucket.org/atlassian/fugue/src/96a65067fb7aaf1edae1bffa07167a5865cbebec/src/test/java/com/atlassian/fugue/OptionTest.java#cl-155 >> >>> >> >>> The point to remember is that Optional is a type and as such >> is >> >>> actually a subtype of Optional ? and therefore requires a >> >>> covariant return. >> >>> >> >>> cheers, >> >>> jed. >> >>> >> >>> >> >>> >> >>> >> >>> On 13 July 2013 04:15, Mike Duigou wrote: >> >>> >> >>>> The ? extends Optional is unnecessary in flatMap as Optional is >> final. >> >>>> Otherwise this looks good. >> >>>> >> >>>> Mike >> >>>> >> >>>> On Jul 5 2013, at 14:37 , Henry Jen wrote: >> >>>> >> >>>> > Hi, >> >>>> > >> >>>> > Please review the webrev at >> >>>> > >> >>>> > http://cr.openjdk.java.net/~henryjen/ccc/8015317.0/webrev/ >> >>>> > >> >>>> > Which adds following method to Optional, >> >>>> > >> >>>> > public static Optional ofNullable(T value) {} >> >>>> > public Optional filter(Predicate predicate) {} >> >>>> > public Optional map(Function mapper) >> {} >> >>>> > public Optional flatMap(Function> >>>> Optional> >> >>>> > mapper) {} >> >>>> > >> >>>> > Also included is some cleanup on javadoc. >> >>>> > >> >>>> > Cheers, >> >>>> > Henry >> >>>> >> >>>> >> >>>> >> >>> >> >>> >> >> >> >> >> > >> > > From martinrb at google.com Mon Jul 15 16:59:16 2013 From: martinrb at google.com (Martin Buchholz) Date: Mon, 15 Jul 2013 09:59:16 -0700 Subject: class SplittableRandom In-Reply-To: <51E414C6.9070400@cs.oswego.edu> References: <51DDB26D.8050506@cs.oswego.edu> <51DE6069.2060308@gmail.com> <51DEA230.2060504@cs.oswego.edu> <51DEA3D5.5000509@oracle.com> <51E1549D.4060403@cs.oswego.edu> <51E414C6.9070400@cs.oswego.edu> Message-ID: If we make the wraparound point for seeds Long.MIN_VALUE instead of 0L, then we can optimize addGammaModGeorge. Any reason the following won't work? --- src/main/java/util/SplittableRandom.java 14 Jul 2013 08:06:49 -0000 1.10 +++ src/main/java/util/SplittableRandom.java 15 Jul 2013 16:25:42 -0000 @@ -222,10 +222,10 @@ */ private static long addGammaModGeorge(long s, long g) { long p = s + g; - if (Long.compareUnsigned(p, g) >= 0) + if (p > s) return p; - long q = p - 13L; - return (Long.compareUnsigned(p, 13L) >= 0) ? q : (q + g); + p -= 13L; + return (p < s) ? p : p + g; } /** Also, if gamma is much less than 2^64 (say 2^56; that number of gammas "should be enough for anybody"), then the above will be a little more efficient since the wraparound code will be rare and well-predicted. The bits that become available as a result can then be optionally donated to the seed space! Have we run DieHarder tests against adversarial gamma values, that provide as few bits as possible? Most obviously, try gamma == 16. From martinrb at google.com Mon Jul 15 17:08:38 2013 From: martinrb at google.com (Martin Buchholz) Date: Mon, 15 Jul 2013 10:08:38 -0700 Subject: Review request: JDK-8016579 (process) IOException thrown by ProcessBuilder.start() method is incorrectly encoded In-Reply-To: <51E3C3AE.1020406@oracle.com> References: <51E3C3AE.1020406@oracle.com> Message-ID: Superficial review: Looks good mostly. Historically, switching windows code to use "W" APIs has been a big TODO, but was waiting for Win98 de-support. Please spell correctly: MESAGE_LENGTH If errno and GetLastError are two separate error notification systems, how do you know which one corresponded to the last failure? E.g. if the last failure only set errno, won't the error message be via GetLastError(), which is likely to be stale? On Mon, Jul 15, 2013 at 2:41 AM, Alexey Utkin wrote: > Bug description: > https://jbs.oracle.com/bugs/**browse/JDK-8016579 > http://bugs.sun.com/view_bug.**do?bug_id=8016579 > > Here is the suggested fix: > http://cr.openjdk.java.net/~**uta/openjdk-webrevs/JDK-**8016579/webrev.00/ > > Summary: > We have THREE locales in action: > 1. Thread default locale - dictates UNICODE-to-8bit conversion > 2. OS locale that defines the message localization > 3. The file name locale > > Each locale could be an extended locale, that means that text cannot be > mapped to 8bit sequence without multibyte encoding. VM is ready for that, > if text is UTF-8. > The suggested fix does the work right from the beginning. > > Unicode version of JVM call: > hotspot/src/os/windows/vm/os_**windows.cpp: > size_t os::lasterror(char* buf, size_t len) > was used as prototype for Unicode error message getter. It has to be fixed > accordingly as well as > jdk/src/windows/native/java/**io/io_util_md.c > size_t getLastErrorString(char *buf, size_t len) > > The bug contains the attachment > https://jbs.oracle.com/bugs/**secure/attachment/14581/JDK-**8016579.txt > that summarize the fix result in comparison with original implementation. > > Regards, > -uta > From martinrb at google.com Mon Jul 15 17:44:06 2013 From: martinrb at google.com (Martin Buchholz) Date: Mon, 15 Jul 2013 10:44:06 -0700 Subject: RFR 8020292 :Re: class SplittableRandom In-Reply-To: <7B80D649-A0D5-426D-A341-41ED818126C3@oracle.com> References: <51DDB26D.8050506@cs.oswego.edu> <51E037D7.3040305@cs.oswego.edu> <7B80D649-A0D5-426D-A341-41ED818126C3@oracle.com> Message-ID: Doug et al are still tweaking SplittableRandom (and probably also ThreadLocalRandom). I continue to worry that we are producing a PRNG that will end up not being acceptable to the Monte Carlo simulation community. From david.r.chase at oracle.com Mon Jul 15 18:07:58 2013 From: david.r.chase at oracle.com (David Chase) Date: Mon, 15 Jul 2013 14:07:58 -0400 Subject: RFR 8020292 :Re: class SplittableRandom In-Reply-To: <51E3F2E7.2080107@oracle.com> References: <51DDB26D.8050506@cs.oswego.edu> <51E037D7.3040305@cs.oswego.edu> <7B80D649-A0D5-426D-A341-41ED818126C3@oracle.com> <51E3F2E7.2080107@oracle.com> Message-ID: On 2013-07-15, at 9:02 AM, Aleksey Shipilev wrote: > The conclusion is: SR is a reasonable alternative with no obvious > performance show-stoppers. That said, TLR is also reasonably fast at > this point, and further improvements to TLR will probably beat the SR or > tie it on most scenarios. I think that depends on the nature of the improvements. TLR doesn't currently pass DieHarder; that's a problem for some people. An additional advantage of SR (as I understand it) is that it allows deterministic replay of the random numbers in a given fork-join tree. David From brian.burkhalter at oracle.com Mon Jul 15 19:45:20 2013 From: brian.burkhalter at oracle.com (Brian Burkhalter) Date: Mon, 15 Jul 2013 12:45:20 -0700 Subject: Java 8 RFR 8020409: Clean up doclint problems in java.util package, part 1 Message-ID: <399C8838-C479-4E95-982C-2733F3F25A8B@oracle.com> Reviewers: Issue http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8020409 Webrev http://cr.openjdk.java.net/~bpb/8020409/ Thanks, Brian From huizhe.wang at oracle.com Mon Jul 15 20:07:32 2013 From: huizhe.wang at oracle.com (huizhe wang) Date: Mon, 15 Jul 2013 13:07:32 -0700 Subject: RFR: (JAXP) 8020430 : NullPointerException in xml sqe nightly result on 2013-07-12 In-Reply-To: <0cbe7317-6647-46ca-aa69-14d23f634e42@default> References: <51DFC567.3070902@oracle.com> <88E5A207-A25D-48F3-AC68-941468821F1C@oracle.com> <51E03852.2020004@oracle.com> <0cbe7317-6647-46ca-aa69-14d23f634e42@default> Message-ID: <51E45684.2090105@oracle.com> Yes, it just happened! SQE team has agreed and we'll start to plan on the migration! -Joe On 7/12/2013 4:57 PM, Iris Clark wrote: > FWIW, I really like the idea of migrating the jaxp tests to the jaxp repo. I've always thought it odd that the code change and the test for it aren't in the same changeset. > > Thanks, > iris > > -----Original Message----- > From: huizhe wang > Sent: Friday, July 12, 2013 10:10 AM > To: Lance Andersen - Oracle > Cc: Core-Libs-Dev > Subject: Re: RFR: (JAXP) 8020430 : NullPointerException in xml sqe nightly result on 2013-07-12 > > > On 7/12/2013 3:30 AM, Lance Andersen - Oracle wrote: >> The fix looks fine to me Joe as does the test. I assume you will go with Chris's plan below for the test locations? > It will be jdk/test/javax/xml/jaxp, that is the location for all jaxp tests for now. We will look into migrating jaxp tests to the jaxp repo. > > Thanks, > Joe > >> Best >> Lance >> On Jul 12, 2013, at 5:44 AM, Chris Hegarty wrote: >> >>> The source changes look fine to me. >>> >>> The tests should be located elsewhere, otherwise they will collide with an Oracle internal repo. Say jdk/test/jaxp? >>> >>> As an aside, I plan to move the jaxws tests to a similar holding area, jdk/test/jaxws. They can then follow the appropriate package structure. >>> >>> -Chris >>> >>> On 12 Jul 2013, at 09:59, huizhe wang wrote: >>> >>>> Hi, >>>> >>>> This is a quick fix on a regression caused by 8016648. The new property manager added to handle the new jaxp 1.5 properties is only created for the input and event factories. For the output factory therefore, there should have a null-check. I've run the tests used in the nightly build with a local build, all passed with this patch. >>>> >>>> webrev: >>>> http://cr.openjdk.java.net/~joehw/jdk8/8020430/webrev/ >>>> >>>> Thanks, >>>> Joe >> >> Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 >> Oracle Java Engineering >> 1 Network Drive >> Burlington, MA 01803 >> Lance.Andersen at oracle.com >> From joe.darcy at oracle.com Mon Jul 15 20:11:38 2013 From: joe.darcy at oracle.com (Joe Darcy) Date: Mon, 15 Jul 2013 13:11:38 -0700 Subject: Java 8 RFR 8020409: Clean up doclint problems in java.util package, part 1 In-Reply-To: <399C8838-C479-4E95-982C-2733F3F25A8B@oracle.com> References: <399C8838-C479-4E95-982C-2733F3F25A8B@oracle.com> Message-ID: <51E4577A.1050307@oracle.com> On 07/15/2013 12:45 PM, Brian Burkhalter wrote: > Reviewers: > > Issue http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8020409 > Webrev http://cr.openjdk.java.net/~bpb/8020409/ > > Thanks, > > Brian Hi Brian, Looks fine, but I was a little surprised to see the "" tags get added in resource bundle. Thanks, -Joe From brian.burkhalter at oracle.com Mon Jul 15 20:14:41 2013 From: brian.burkhalter at oracle.com (Brian Burkhalter) Date: Mon, 15 Jul 2013 13:14:41 -0700 Subject: Java 8 RFR 8020409: Clean up doclint problems in java.util package, part 1 In-Reply-To: <51E4577A.1050307@oracle.com> References: <399C8838-C479-4E95-982C-2733F3F25A8B@oracle.com> <51E4577A.1050307@oracle.com> Message-ID: Hi Joe, On Jul 15, 2013, at 1:11 PM, Joe Darcy wrote: > I was a little surprised to see the "" tags get added in resource bundle. Why? They were missing although perhaps doclint did not complain about that, I cannot recall. It is OK to leave them in, is it not? Thanks, Brian From martinrb at google.com Mon Jul 15 20:13:50 2013 From: martinrb at google.com (Martin Buchholz) Date: Mon, 15 Jul 2013 13:13:50 -0700 Subject: class SplittableRandom In-Reply-To: References: <51DDB26D.8050506@cs.oswego.edu> <51DE6069.2060308@gmail.com> <51DEA230.2060504@cs.oswego.edu> <51DEA3D5.5000509@oracle.com> <51E1549D.4060403@cs.oswego.edu> <51E414C6.9070400@cs.oswego.edu> Message-ID: I'll be your loyal adversary today, trying to break SplittableRandom. Let's make it easier by providing a low-level constructor: /** XXXX Testing */ public SplittableRandom(long seed, long gamma, Error XXXX) { this.seed = seed; this.gamma = gamma; this.nextSplit = seed; } and provide some debugging: private static int mix32(long z) { + boolean onebit = (Long.bitCount(z) == 1); + if (onebit) System.out.printf("mix32: z=%08x%n", z); z ^= (z >>> 33); z *= 0xc4ceb9fe1a85ec53L; + if (onebit) System.out.printf("mix32: ret=%08x%n", (int)(z >>> 32)); return (int)(z >>> 32); } and then we have sneaky test using weakest args: seed = 0, gamma = 16 public void testXXXX() { SplittableRandom r = new SplittableRandom(0L, 16L, new Error("XXXX")); System.out.println(); for (int i = 0; i < 30; i++) System.out.printf("%08x%n", r.nextInt()); } And we get in the output: [java] mix32: z=00000010 [java] mix32: ret=4ceb9fe1 [java] 4ceb9fe1 ... [java] mix32: z=00000100 [java] mix32: ret=ceb9fe1a [java] ceb9fe1a ... which is not "random enough" for my taste. It would be nice if we could use mixing to twiddle the seed in addition to mixing the return value (instead of throwing away the mixing effort), but then it is hard to see how to guarantee 2^64 period. mix32 looks too simple to me to do "enough mixing". I'm surprised running nextInt through DieHarder would pass - it's close to linear congruential. On Mon, Jul 15, 2013 at 9:59 AM, Martin Buchholz wrote: > If we make the wraparound point for seeds Long.MIN_VALUE instead of 0L, > then we can optimize addGammaModGeorge. Any reason the following won't > work? > > --- src/main/java/util/SplittableRandom.java 14 Jul 2013 08:06:49 -0000 > 1.10 > +++ src/main/java/util/SplittableRandom.java 15 Jul 2013 16:25:42 -0000 > @@ -222,10 +222,10 @@ > */ > private static long addGammaModGeorge(long s, long g) { > long p = s + g; > - if (Long.compareUnsigned(p, g) >= 0) > + if (p > s) > return p; > - long q = p - 13L; > - return (Long.compareUnsigned(p, 13L) >= 0) ? q : (q + g); > + p -= 13L; > + return (p < s) ? p : p + g; > } > > /** > > Also, if gamma is much less than 2^64 (say 2^56; that number of gammas > "should be enough for anybody"), then the above will be a little more > efficient since the wraparound code will be rare and well-predicted. The > bits that become available as a result can then be optionally donated to > the seed space! > > Have we run DieHarder tests against adversarial gamma values, that provide > as few bits as possible? Most obviously, try gamma == 16. > From dan.xu at oracle.com Mon Jul 15 20:34:35 2013 From: dan.xu at oracle.com (Dan Xu) Date: Mon, 15 Jul 2013 13:34:35 -0700 Subject: Review request: JDK-8016579 (process) IOException thrown by ProcessBuilder.start() method is incorrectly encoded In-Reply-To: References: <51E3C3AE.1020406@oracle.com> Message-ID: <51E45CDB.1060001@oracle.com> I guess Alexey made the changes based on the existing implementation of JVM_GetLastErrorString() in hotspot, which is os::lasterror(char* buf, size_t len) in os_windows.cpp. One comment about the code at line 105 in win32Error(). 105 const int errnum = GetLastError(); Since in os_lasterror() function, both GetLastError() and errno are used conditionally to get the error code, will the same logic used here to get the value for errnum? Otherwise, it is possible that an error code and message are wrongly mapped and printed out. I need to point out that this issue is not brought up by this change, and also exists in the old code. Thanks! -Dan On 07/15/2013 10:08 AM, Martin Buchholz wrote: > Superficial review: > > Looks good mostly. > > Historically, switching windows code to use "W" APIs has been a big > TODO, but was waiting for Win98 de-support. > > Please spell correctly: > MESAGE_LENGTH > > If errno and GetLastError are two separate error notification systems, > how do you know which one corresponded to the last failure? E.g. if > the last failure only set errno, won't the error message be > via GetLastError(), which is likely to be stale? > > > > On Mon, Jul 15, 2013 at 2:41 AM, Alexey Utkin > wrote: > > Bug description: > https://jbs.oracle.com/bugs/browse/JDK-8016579 > http://bugs.sun.com/view_bug.do?bug_id=8016579 > > Here is the suggested fix: > http://cr.openjdk.java.net/~uta/openjdk-webrevs/JDK-8016579/webrev.00/ > > > Summary: > We have THREE locales in action: > 1. Thread default locale - dictates UNICODE-to-8bit conversion > 2. OS locale that defines the message localization > 3. The file name locale > > Each locale could be an extended locale, that means that text > cannot be mapped to 8bit sequence without multibyte encoding. VM > is ready for that, if text is UTF-8. > The suggested fix does the work right from the beginning. > > Unicode version of JVM call: > hotspot/src/os/windows/vm/os_windows.cpp: > size_t os::lasterror(char* buf, size_t len) > was used as prototype for Unicode error message getter. It has to > be fixed accordingly as well as > jdk/src/windows/native/java/io/io_util_md.c > size_t getLastErrorString(char *buf, size_t len) > > The bug contains the attachment > https://jbs.oracle.com/bugs/secure/attachment/14581/JDK-8016579.txt > that summarize the fix result in comparison with original > implementation. > > Regards, > -uta > > From guy.steele at oracle.com Mon Jul 15 21:05:08 2013 From: guy.steele at oracle.com (Guy Steele) Date: Mon, 15 Jul 2013 17:05:08 -0400 Subject: class SplittableRandom In-Reply-To: References: <51DDB26D.8050506@cs.oswego.edu> <51DE6069.2060308@gmail.com> <51DEA230.2060504@cs.oswego.edu> <51DEA3D5.5000509@oracle.com> <51E1549D.4060403@cs.oswego.edu> <51E414C6.9070400@cs.oswego.edu> Message-ID: <6099D28A-0B95-42A4-A59B-5E1C465EDCA9@oracle.com> On Jul 15, 2013, at 4:13 PM, Martin Buchholz wrote: > I'll be your loyal adversary today, trying to break SplittableRandom. Thanks so much! This is exactly the sort of skepticism we need. > Let's make it easier by providing a low-level constructor: > > /** XXXX Testing */ > public SplittableRandom(long seed, long gamma, Error XXXX) { > this.seed = seed; > this.gamma = gamma; > this.nextSplit = seed; > } > > and provide some debugging: > > private static int mix32(long z) { > + boolean onebit = (Long.bitCount(z) == 1); > + if (onebit) System.out.printf("mix32: z=%08x%n", z); > z ^= (z >>> 33); > z *= 0xc4ceb9fe1a85ec53L; > + if (onebit) System.out.printf("mix32: ret=%08x%n", (int)(z >>> > 32)); > return (int)(z >>> 32); > } > > and then we have sneaky test using weakest args: seed = 0, gamma = 16 > > public void testXXXX() { > SplittableRandom r = new SplittableRandom(0L, 16L, new > Error("XXXX")); > System.out.println(); > for (int i = 0; i < 30; i++) > System.out.printf("%08x%n", r.nextInt()); > } > > And we get in the output: > > [java] mix32: z=00000010 > [java] mix32: ret=4ceb9fe1 > [java] 4ceb9fe1 > ... > [java] mix32: z=00000100 > [java] mix32: ret=ceb9fe1a > [java] ceb9fe1a > ... > > which is not "random enough" for my taste. And indeed, if we look at more such values, we do see patterns: mix32: input=0000000000000001 result=c4ceb9fe mix32: input=0000000000000010 result=4ceb9fe1 mix32: input=0000000000000100 result=ceb9fe1a mix32: input=0000000000001000 result=eb9fe1a8 mix32: input=0000000000010000 result=b9fe1a85 mix32: input=0000000000100000 result=9fe1a85e mix32: input=0000000001000000 result=fe1a85ec mix32: input=0000000010000000 result=e1a85ec5 mix32: input=0000000100000000 result=1a85ec53 mix32: input=0000001000000000 result=ced49520 mix32: input=0000010000000000 result=ed49520d mix32: input=0000100000000000 result=d49520d4 mix32: input=0001000000000000 result=49520d42 mix32: input=0010000000000000 result=9520d42f mix32: input=0100000000000000 result=520d42f6 > And yet, I wonder what it means to be "random enough". After all, preselecting the inputs to study to be those with exactly one 1-bit is already a choice of fairly rare birds (64 values out of 2^64, or one out of every 2^58). Such values come up very rarely. > It would be nice if we could use mixing to twiddle the seed in addition to > mixing the return value (instead of throwing away the mixing effort), but > then it is hard to see how to guarantee 2^64 period. Yes, I see what you mean, and I agree. > mix32 looks too simple to me to do "enough mixing". I'm surprised running > nextInt through DieHarder would pass - it's close to linear congruential. I was surprised, too, or perhaps I should say gratified, that this worked. I was searching semi-methodically for just such a simple mixing function, testing them by examining avalanche statistics. The low-order 32 bits produced by mix32 are pretty bad, but the upper 32 bits appear to be quite well mixed. It's amazing what a little bit of XORing does to disrupt the uniformities of the linear-congruential method. [more below] > On Mon, Jul 15, 2013 at 9:59 AM, Martin Buchholz wrote: > >> If we make the wraparound point for seeds Long.MIN_VALUE instead of 0L, >> then we can optimize addGammaModGeorge. Any reason the following won't >> work? >> >> --- src/main/java/util/SplittableRandom.java 14 Jul 2013 08:06:49 -0000 >> 1.10 >> +++ src/main/java/util/SplittableRandom.java 15 Jul 2013 16:25:42 -0000 >> @@ -222,10 +222,10 @@ >> */ >> private static long addGammaModGeorge(long s, long g) { >> long p = s + g; >> - if (Long.compareUnsigned(p, g) >= 0) >> + if (p > s) >> return p; >> - long q = p - 13L; >> - return (Long.compareUnsigned(p, 13L) >= 0) ? q : (q + g); >> + p -= 13L; >> + return (p < s) ? p : p + g; >> } >> >> /** Yes, thanks, this is a good idea likely to produce speed improvements for processors/compilers that do not (yet) do a good job with Long.compareUnsigned. But I don't think that last comparison "p < s" is correct. The version I came up with, given just a hint of your technique through Doug, was this: private static long addGammaModGeorge(long sx, long g) { long px = sx + g; return (px >= sx) ? px : ((px >= 0x800000000000000DL) ? px : px + g) - 13L; } (I used an "x" on variable names to remind me which ones are using the offset representation.) For some reason, on the particular version of Java and particular processor I used for my test, this was slightly faster than: private static long addGammaModGeorge(long sx, long g) { long px = sx + g; return (px >= sx) ? px : ((px >= 0x800000000000000DL) ? px - 13L : px + g - 13L); } and I don't know why. >> Also, if gamma is much less than 2^64 (say 2^56; that number of gammas >> "should be enough for anybody"), then the above will be a little more >> efficient since the wraparound code will be rare and well-predicted. The >> bits that become available as a result can then be optionally donated to >> the seed space! Yeah, I thought about that, but was too scared of introducing some sort of bias. But now that you have made me think about it more carefully, I think you may be right. >> Have we run DieHarder tests against adversarial gamma values, that provide >> as few bits as possible? Most obviously, try gamma == 16. Or, even more obviously, gamma == 1. Yes, I intend to run such tests. You also wrote: > The algorithm in SplittableRandom is much better, although even here I'm not > sure we have enough bits of state to satisfy all non-cryptographic uses. > I continue to worry that we are producing a PRNG that will end up not being > acceptable to the Monte Carlo simulation community. And I agree. I comfort myself with the thought that even though this algorithm does not allow any single object to generate the same 64-bit value twice consecutively, that observation does not apply to double values (which use only 53 bits apiece). For applications that use doubles rather than longs, SplittableRandom may be okay. On the whole, I would really prefer to use 128-bit seeds and 128-bit gamma values. If only support for 128-bit integers were built into Java, with good use of the condition codes and add-with-carry instructions at the machine level, this would be a very plausible thing to do. I view the currently proposed 64-bit, implemented-entirely-in-Java version as adequate for a lot of purposes, and way better than java.util.Random for a lot of purposes, and therefore perhaps easy to accept into JDK8. But we want to avoid committing to too specific a mechanism; I certainly don't think this algorithm is the last word, but rather the first step toward getting much better parallel RNGs. Maybe for JDK9 we could have 128-bit algorithms supported by tightly written native machine code at very little extra computational expense, but first we need to get experience with this class of algorithms. Just a thought. --Guy From joe.darcy at oracle.com Mon Jul 15 21:30:38 2013 From: joe.darcy at oracle.com (Joe Darcy) Date: Mon, 15 Jul 2013 14:30:38 -0700 Subject: Java 8 RFR 8020409: Clean up doclint problems in java.util package, part 1 In-Reply-To: References: <399C8838-C479-4E95-982C-2733F3F25A8B@oracle.com> <51E4577A.1050307@oracle.com> Message-ID: <51E469FE.60100@oracle.com> On 07/15/2013 01:14 PM, Brian Burkhalter wrote: > Hi Joe, > > On Jul 15, 2013, at 1:11 PM, Joe Darcy wrote: > >> I was a little surprised to see the "" tags get added in resource bundle. > Why? They were missing although perhaps doclint did not complain about that, I cannot recall. It is OK to leave them in, is it not? > > Thanks, > > Brian Yep; fine to leave them in. -Joe From martinrb at google.com Mon Jul 15 22:29:34 2013 From: martinrb at google.com (Martin Buchholz) Date: Mon, 15 Jul 2013 15:29:34 -0700 Subject: class SplittableRandom In-Reply-To: <6099D28A-0B95-42A4-A59B-5E1C465EDCA9@oracle.com> References: <51DDB26D.8050506@cs.oswego.edu> <51DE6069.2060308@gmail.com> <51DEA230.2060504@cs.oswego.edu> <51DEA3D5.5000509@oracle.com> <51E1549D.4060403@cs.oswego.edu> <51E414C6.9070400@cs.oswego.edu> <6099D28A-0B95-42A4-A59B-5E1C465EDCA9@oracle.com> Message-ID: Another variant with few bits in seed or gamma is: public void testYYYY() { SplittableRandom r = new SplittableRandom(0L, 1L<<61, new Error()); System.out.println("YYYY"); int prev = 0; for (int i = 0; i < 30; i++) { int next = r.nextInt(); System.out.printf("next=%08x diff=%08x%n", next, next - prev); prev = next; } } which produces the "almost arithmetic sequence" [java] next=41a85ec5 diff=41a85ec5 [java] next=8350bd8a diff=41a85ec5 [java] next=c4f91c4f diff=41a85ec5 [java] next=06a17b14 diff=41a85ec5 [java] next=4849d9d9 diff=41a85ec5 [java] next=89f2389f diff=41a85ec6 [java] next=cb9a9764 diff=41a85ec5 [java] next=b8085924 diff=ec6dc1c0 [java] next=365ffa5e diff=7e57a13a [java] next=b4b79b99 diff=7e57a13b [java] next=330f3cd4 diff=7e57a13b [java] next=b166de0f diff=7e57a13b [java] next=2fbe7f4a diff=7e57a13b [java] next=ae162084 diff=7e57a13a [java] next=2c6dc1bf diff=7e57a13b [java] next=b687cb0b diff=8a1a094c [java] next=34df6c46 diff=7e57a13b [java] next=b3370d81 diff=7e57a13b [java] next=318eaebb diff=7e57a13a [java] next=afe64ff6 diff=7e57a13b [java] next=2e3df131 diff=7e57a13b [java] next=ac95926c diff=7e57a13b [java] next=2aed33a7 diff=7e57a13b [java] next=b5073cf2 diff=8a1a094b [java] next=335ede2d diff=7e57a13b [java] next=b1b67f68 diff=7e57a13b [java] next=300e20a3 diff=7e57a13b [java] next=ae65c1dd diff=7e57a13a [java] next=2cbd6318 diff=7e57a13b [java] next=ab150453 diff=7e57a13b From dl at cs.oswego.edu Mon Jul 15 22:46:59 2013 From: dl at cs.oswego.edu (Doug Lea) Date: Mon, 15 Jul 2013 18:46:59 -0400 Subject: class SplittableRandom In-Reply-To: References: <51DDB26D.8050506@cs.oswego.edu> <51DE6069.2060308@gmail.com> <51DEA230.2060504@cs.oswego.edu> <51DEA3D5.5000509@oracle.com> <51E1549D.4060403@cs.oswego.edu> <51E414C6.9070400@cs.oswego.edu> Message-ID: <51E47BE3.40209@cs.oswego.edu> On 07/15/13 16:13, Martin Buchholz wrote: > I'll be your loyal adversary today, trying to break SplittableRandom. > > Let's make it easier by providing a low-level constructor: > > /** XXXX Testing */ > public SplittableRandom(long seed, long gamma, Error XXXX) { Now you see why we don't do that :-) > > > and then we have sneaky test using weakest args: seed = 0, gamma = 16 Which you would otherwise run into once every 2^64 splits. So, rarely. you get some not-very-random-looking randoms. Which is also what you'd expect under a truly random RNG. -Doug From martinrb at google.com Mon Jul 15 23:06:18 2013 From: martinrb at google.com (Martin Buchholz) Date: Mon, 15 Jul 2013 16:06:18 -0700 Subject: class SplittableRandom In-Reply-To: <51E47BE3.40209@cs.oswego.edu> References: <51DDB26D.8050506@cs.oswego.edu> <51DE6069.2060308@gmail.com> <51DEA230.2060504@cs.oswego.edu> <51DEA3D5.5000509@oracle.com> <51E1549D.4060403@cs.oswego.edu> <51E414C6.9070400@cs.oswego.edu> <51E47BE3.40209@cs.oswego.edu> Message-ID: Another experiment that provides bit-full seed but poor gamma public void testAdversary3() { SplittableRandom r = new SplittableRandom(new Random().nextLong(), 1L<<61, new Error()); System.out.println("testAdversary3"); int prev = 0; for (int i = 0; i < 30; i++) { int next = r.nextInt(); System.out.printf("next=%08x diff=%08x%n", next, next - prev); prev = next; } } produces insufficiently random output like the below, which seems to show that a poor choice of gamma (even though very unlikely) can invalidate an entire generated sequence. It would be nice if we had more confidence that the gamma we choose will be "high-quality". [java] .testAdversary3 [java] next=75b1386c diff=75b1386c [java] next=b7599731 diff=41a85ec5 [java] next=aa95c7fc diff=f33c30cb [java] next=ec3e26c1 diff=41a85ec5 [java] next=2de68586 diff=41a85ec5 [java] next=6f8ee44c diff=41a85ec6 [java] next=a3f44ce7 diff=3465689b [java] next=e59cabac diff=41a85ec5 [java] next=27450a72 diff=41a85ec6 [java] next=68ed6937 diff=41a85ec5 [java] next=bc5021dc diff=5362b8a5 [java] next=fdf880a1 diff=41a85ec5 [java] next=3fa0df66 diff=41a85ec5 [java] next=81493e2b diff=41a85ec5 [java] next=b5aea6c7 diff=3465689c [java] next=f757058c diff=41a85ec5 [java] next=38ff6451 diff=41a85ec5 [java] next=7aa7c317 diff=41a85ec6 [java] next=f34f0e8c diff=78a74b75 [java] next=34f76d51 diff=41a85ec5 [java] next=769fcc16 diff=41a85ec5 [java] next=b8482adc diff=41a85ec6 [java] next=ecad9377 diff=3465689b [java] next=2e55f23c diff=41a85ec5 [java] next=6ffe5102 diff=41a85ec6 [java] next=b1a6afc7 diff=41a85ec5 [java] next=2b7f385d diff=79d88896 [java] next=6d279722 diff=41a85ec5 [java] next=aecff5e7 diff=41a85ec5 [java] next=f07854ac diff=41a85ec5 On Mon, Jul 15, 2013 at 3:46 PM, Doug Lea
wrote: > On 07/15/13 16:13, Martin Buchholz wrote: > >> I'll be your loyal adversary today, trying to break SplittableRandom. >> >> Let's make it easier by providing a low-level constructor: >> >> /** XXXX Testing */ >> public SplittableRandom(long seed, long gamma, Error XXXX) { >> > > Now you see why we don't do that :-) > > > >> >> and then we have sneaky test using weakest args: seed = 0, gamma = 16 >> > > Which you would otherwise run into once every 2^64 splits. > So, rarely. you get some not-very-random-looking randoms. > Which is also what you'd expect under a truly random RNG. > > > -Doug > > > From dl at cs.oswego.edu Mon Jul 15 23:11:01 2013 From: dl at cs.oswego.edu (Doug Lea) Date: Mon, 15 Jul 2013 19:11:01 -0400 Subject: class SplittableRandom In-Reply-To: References: <51DDB26D.8050506@cs.oswego.edu> <51DE6069.2060308@gmail.com> <51DEA230.2060504@cs.oswego.edu> <51DEA3D5.5000509@oracle.com> <51E1549D.4060403@cs.oswego.edu> <51E414C6.9070400@cs.oswego.edu> Message-ID: <51E48185.7070709@cs.oswego.edu> On 07/15/13 12:59, Martin Buchholz wrote: > If we make the wraparound point for seeds Long.MIN_VALUE instead of 0L, then we > can optimize addGammaModGeorge. This was a great suggestion; thanks! > > I continue to worry that we are producing a PRNG that will end up not being > acceptable to the Monte Carlo simulation community. > I'm not sure there is enough of an identifiable community there to decode this. Some people think they need Mersenne Twister, with 4096bit state and 2^4096 periodicity. But that would make a poor candidate for JDK. On the other side, there are people who most care about cost and are happy with a generator that is at least not obviously too regular, but we don't supply those either. The 90+% in between are likely to be happy that JDK8 provides something both cheaper and better than java.util.Random to use when it applies. -Doug From dl at cs.oswego.edu Mon Jul 15 23:31:08 2013 From: dl at cs.oswego.edu (Doug Lea) Date: Mon, 15 Jul 2013 19:31:08 -0400 Subject: class SplittableRandom In-Reply-To: References: <51DDB26D.8050506@cs.oswego.edu> <51DE6069.2060308@gmail.com> <51DEA230.2060504@cs.oswego.edu> <51DEA3D5.5000509@oracle.com> <51E1549D.4060403@cs.oswego.edu> <51E414C6.9070400@cs.oswego.edu> <51E47BE3.40209@cs.oswego.edu> Message-ID: <51E4863C.20803@cs.oswego.edu> On 07/15/13 19:06, Martin Buchholz wrote: > Another experiment that provides bit-full seed but poor gamma Keeping in mind that we won't support the seed+gamma constructor, For what value of K would you be content to know that the generators associated with the first K splits for any SplittableRandom pass DieHarder, with, in the aggregate, no more than the statistically expected false alarms stemming from the fact that RNG quality tests are themselves statistical? -Doug From dl at cs.oswego.edu Mon Jul 15 23:51:11 2013 From: dl at cs.oswego.edu (Doug Lea) Date: Mon, 15 Jul 2013 19:51:11 -0400 Subject: RFR 8020292 :Re: class SplittableRandom In-Reply-To: <51E3F2E7.2080107@oracle.com> References: <51DDB26D.8050506@cs.oswego.edu> <51E037D7.3040305@cs.oswego.edu> <7B80D649-A0D5-426D-A341-41ED818126C3@oracle.com> <51E3F2E7.2080107@oracle.com> Message-ID: <51E48AEF.7060103@cs.oswego.edu> On 07/15/13 09:02, Aleksey Shipilev wrote: > OK, early performance data follows. > ... > - 64 bit: on moderately saturated machine (1, 16 threads), SR double is > marginally faster than TLR, and SR int/long is significantly faster than TLR > - 32 bit: TLR is vastly faster in int/long standalone scenarios > ... > The conclusion is: SR is a reasonable alternative with no obvious > performance show-stoppers. That said, TLR is also reasonably fast at > this point, ... Thanks. Given the apparent increasing agreement that both APIs are needed and useful, it would be great if people could choose among them based solely on usage context, and not contaminated with speed/quality tradeoffs of the underlying algorithms. To do this, it looks like we'd end up with TLR faster than it is now on 64bit, but slower on 32bit platforms. Without yet committing to details (especially because I don't have any yet!) does anyone disagree that this is an OK tradeoff? -Doug From joe.darcy at oracle.com Tue Jul 16 01:16:08 2013 From: joe.darcy at oracle.com (joe.darcy at oracle.com) Date: Tue, 16 Jul 2013 01:16:08 +0000 Subject: hg: jdk8/tl/jdk: 8020409: Clean up doclint problems in java.util package, part 1 Message-ID: <20130716011631.A0175480D3@hg.openjdk.java.net> Changeset: 94e1a4b10811 Author: bpb Date: 2013-07-15 14:37 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/94e1a4b10811 8020409: Clean up doclint problems in java.util package, part 1 Summary: Clean up doclint problems in java.util package, part 1 Reviewed-by: darcy Contributed-by: Brian Burkhalter ! src/share/classes/java/util/ArrayList.java ! src/share/classes/java/util/Arrays.java ! src/share/classes/java/util/Base64.java ! src/share/classes/java/util/BitSet.java ! src/share/classes/java/util/Calendar.java ! src/share/classes/java/util/Collection.java ! src/share/classes/java/util/Collections.java ! src/share/classes/java/util/EnumSet.java ! src/share/classes/java/util/GregorianCalendar.java ! src/share/classes/java/util/Locale.java ! src/share/classes/java/util/ResourceBundle.java From sundararajan.athijegannathan at oracle.com Tue Jul 16 05:27:55 2013 From: sundararajan.athijegannathan at oracle.com (sundararajan.athijegannathan at oracle.com) Date: Tue, 16 Jul 2013 05:27:55 +0000 Subject: hg: jdk8/tl/nashorn: 7 new changesets Message-ID: <20130716052801.71484480DA@hg.openjdk.java.net> Changeset: 973d78ee0728 Author: attila Date: 2013-07-15 12:33 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/973d78ee0728 8020324: Implement Object.bindProperties(target, source) for beans Reviewed-by: hannesw, sundar ! src/jdk/internal/dynalink/beans/AbstractJavaLinker.java ! src/jdk/internal/dynalink/beans/BeansLinker.java ! src/jdk/internal/dynalink/beans/StaticClassLinker.java ! src/jdk/nashorn/internal/objects/NativeObject.java ! src/jdk/nashorn/internal/runtime/linker/Bootstrap.java + src/jdk/nashorn/internal/runtime/linker/BoundDynamicMethod.java + src/jdk/nashorn/internal/runtime/linker/BoundDynamicMethodLinker.java + test/script/basic/JDK-8020324.js + test/script/basic/JDK-8020324.js.EXPECTED + test/src/jdk/nashorn/test/models/PropertyBind.java Changeset: 62c552bcc342 Author: hannesw Date: 2013-07-15 15:51 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/62c552bcc342 8020354: Object literal property initialization is not done in source order Reviewed-by: sundar, jlaskey ! src/jdk/nashorn/internal/parser/Parser.java + test/script/basic/JDK-8020354.js + test/script/basic/JDK-8020354.js.EXPECTED Changeset: ede320e13c82 Author: attila Date: 2013-07-15 16:31 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/ede320e13c82 8020508: Enforce reflection access restrictions on Object.bindProperties Reviewed-by: jlaskey, sundar ! src/jdk/nashorn/internal/objects/NativeObject.java ! src/jdk/nashorn/internal/runtime/linker/Bootstrap.java ! src/jdk/nashorn/internal/runtime/linker/ReflectionCheckLinker.java + test/script/basic/JDK-8020508.js + test/script/basic/JDK-8020508.js.EXPECTED Changeset: e5505f0b10de Author: hannesw Date: 2013-07-15 16:35 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/e5505f0b10de 8020283: Don't use exceptions for widening of ArrayData Reviewed-by: jlaskey, attila ! src/jdk/nashorn/internal/runtime/arrays/IntArrayData.java ! src/jdk/nashorn/internal/runtime/arrays/LongArrayData.java ! src/jdk/nashorn/internal/runtime/arrays/NumberArrayData.java Changeset: 01212f5e7dad Author: attila Date: 2013-07-15 16:58 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/01212f5e7dad 8011210: fix reporting of call site locations; print them on -tcs=miss Reviewed-by: jlaskey, hannesw ! src/jdk/internal/dynalink/DynamicLinker.java ! src/jdk/nashorn/internal/runtime/linker/LinkerCallSite.java Changeset: 28f1f2374004 Author: hannesw Date: 2013-07-15 18:32 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/28f1f2374004 8020358: Array(0xfffffff) throws OutOfMemoryError Reviewed-by: jlaskey, sundar ! src/jdk/nashorn/internal/runtime/arrays/ArrayData.java + test/script/basic/JDK-8020358.js + test/script/basic/JDK-8020358.js.EXPECTED Changeset: d685fec24d13 Author: sundar Date: 2013-07-16 09:54 +0530 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/d685fec24d13 Merge From jandam at crcdata.cz Tue Jul 16 06:42:16 2013 From: jandam at crcdata.cz (Janda Martin) Date: Tue, 16 Jul 2013 08:42:16 +0200 (CEST) Subject: Java 8: new method proposal FileSystems::newFileSystem(Path path, Map env, ClassLoader loader) In-Reply-To: <15755959.01373956718759.JavaMail.root@zs.crcpraha> Message-ID: <22110320.21373956936314.JavaMail.root@zs.crcpraha> FileSystems static methods are inconsistent. I would expect that "newFileSystem" methods will be same for URI and Path. newFileSystem for Path is missing "env" parameter. So I can't create ZIP file system from Path (with "create=true"). This was needed as workaround for Bug ID 7156873 (already fixed in Java7u40-b1). http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7156873 Should I create record to bug tracking system? Thank you. Martin From martinrb at google.com Tue Jul 16 07:07:39 2013 From: martinrb at google.com (Martin Buchholz) Date: Tue, 16 Jul 2013 00:07:39 -0700 Subject: class SplittableRandom In-Reply-To: <6099D28A-0B95-42A4-A59B-5E1C465EDCA9@oracle.com> References: <51DDB26D.8050506@cs.oswego.edu> <51DE6069.2060308@gmail.com> <51DEA230.2060504@cs.oswego.edu> <51DEA3D5.5000509@oracle.com> <51E1549D.4060403@cs.oswego.edu> <51E414C6.9070400@cs.oswego.edu> <6099D28A-0B95-42A4-A59B-5E1C465EDCA9@oracle.com> Message-ID: On Mon, Jul 15, 2013 at 2:05 PM, Guy Steele wrote: > > On Jul 15, 2013, at 4:13 PM, Martin Buchholz wrote: > > > I'll be your loyal adversary today, trying to break SplittableRandom.> > mix32 looks too simple to me to do "enough mixing". I'm surprised running > > nextInt through DieHarder would pass - it's close to linear congruential. > > I was surprised, too, or perhaps I should say gratified, that this worked. > I was searching semi-methodically for just such a simple mixing function, > testing them by examining avalanche statistics. The low-order 32 bits > produced > by mix32 are pretty bad, but the upper 32 bits appear to be quite well > mixed. > It's amazing what a little bit of XORing does to disrupt the uniformities > of > the linear-congruential method. > > Read Appleby and Stafford ... Hmmm.... mix32 has almost the same job as mix64 - have all the bits in the seed affect all the bits in the output, so the obvious implementation is mix32() { return (int) mix64(); } or more conservatively mix32() { m = mix64(); return (int)m ^ (int)(m >>> 32); } although it would be slightly distressing to have nextInt be more expensive than nextLong. There might be some clever way of doing murmurhash-style mixing when the input is 64-bit and the output is 32-bit that can do better, but I don't think the current mix32 is it. > You also wrote: > > > The algorithm in SplittableRandom is much better, although even here I'm > not > > sure we have enough bits of state to satisfy all non-cryptographic uses. > > > I continue to worry that we are producing a PRNG that will end up not > being > > acceptable to the Monte Carlo simulation community. > > And I agree. I comfort myself with the thought that even though this > algorithm > does not allow any single object to generate the same 64-bit value twice > consecutively, > that observation does not apply to double values (which use only 53 bits > apiece). > For applications that use doubles rather than longs, SplittableRandom may > be okay. > > On the whole, I would really prefer to use 128-bit seeds and 128-bit gamma > values. > If only support for 128-bit integers were built into Java, with good use > of the condition > codes and add-with-carry instructions at the machine level, this would be > a very plausible > thing to do. I view the currently proposed 64-bit, > implemented-entirely-in-Java version > as adequate for a lot of purposes, and way better than java.util.Random > for a lot of > purposes, and therefore perhaps easy to accept into JDK8. But we want to > avoid > committing to too specific a mechanism; I certainly don't think this > algorithm is the > last word, but rather the first step toward getting much better parallel > RNGs. > Maybe for JDK9 we could have 128-bit algorithms supported by tightly > written > native machine code at very little extra computational expense, but first > we need > to get experience with this class of algorithms. Just a thought. > I agree. I have long thought that 64-bit randomness isn't quite enough, and that 128-bits is just about right, but few PRNGs inhabit that space. --- I suggest code based on the following to check for randomness. For gammabits=14, I see dups of diffs in the output, e.g. [java] next=e1e77ea6 diff=4c84b7e8 [java] next=8329b1b9 diff=a1423313 [java] next=246be4cc diff=a1423313 but not when gammabits=18. I conjecture that gammabits has to be cranked up a bit more before it passes dieharder. public void testAdversary(int gammabits) { Random rnd = new Random(); long seed = rnd.nextLong(); long gamma = (rnd.nextLong() | 1L) << (64 - gammabits); SplittableRandom r = new SplittableRandom(seed, gamma, new Error()); System.out.printf("testAdversary(%d)%n", gammabits); int prev = 0; for (int i = 0; i < 100; i++) { int next = r.nextInt(); System.out.printf("next=%08x diff=%08x%n", next, next - prev); prev = next; } } public void testAdversary14() { testAdversary(14); } public void testAdversary16() { testAdversary(16); } public void testAdversary18() { testAdversary(18); } --- Here's a version of addGammaModGeorge that uses the slightly clearer Long.MIN_VALUE + 13L instead of 0x800000000000000DL and generates identical bytecode. private static long addGammaModGeorge(long sx, long g) { long px = sx + g; return (px >= sx) ? px : ((px >= Long.MIN_VALUE + 13L) ? px : px + g) - 13L; } From dl at cs.oswego.edu Tue Jul 16 12:37:52 2013 From: dl at cs.oswego.edu (Doug Lea) Date: Tue, 16 Jul 2013 08:37:52 -0400 Subject: class SplittableRandom In-Reply-To: References: <51DDB26D.8050506@cs.oswego.edu> <51DE6069.2060308@gmail.com> <51DEA230.2060504@cs.oswego.edu> <51DEA3D5.5000509@oracle.com> <51E1549D.4060403@cs.oswego.edu> <51E414C6.9070400@cs.oswego.edu> <6099D28A-0B95-42A4-A59B-5E1C465EDCA9@oracle.com> Message-ID: <51E53EA0.7060409@cs.oswego.edu> I incorporated updates stemming from yesterday's SplittableRandom list and off-list traffic. Thanks as always for all the helpfulness. Mike Duigou: It's probably reasonable to let lambda and webrev versions lag a few days until a bit more stable. Until then, see http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/src/main/java/util/SplittableRandom.java?view=log -Doug From bill.pittore at oracle.com Tue Jul 16 16:01:44 2013 From: bill.pittore at oracle.com (bill.pittore at oracle.com) Date: Tue, 16 Jul 2013 12:01:44 -0400 Subject: RFR - Changes to address CCC 8014135: Support for statically linked agents In-Reply-To: <51D5A5CD.2070805@oracle.com> References: <51D494E9.2020200@oracle.com> <51D5A5CD.2070805@oracle.com> Message-ID: <51E56E68.8010305@oracle.com> I updated the text in VirtualMachine.java. The new webrev is here: http://cr.openjdk.java.net/~bpittore/8014135/jdk/webrev.01/ I ran it through javadoc and you can see the result here: http://cr.openjdk.java.net/~bpittore/8014135/javadoc/index.html Let me know if you have any comments. thanks, bill On 7/4/2013 12:41 PM, Alan Bateman wrote: > On 03/07/2013 22:17, BILL PITTORE wrote: >> These changes address bug 8014135 which adds support for statically >> linked agents in the VM. This is a followup to the recent JNI spec >> changes that addressed statically linked JNI libraries( 8005716). >> The JEP for this change is the same JEP as the JNI changes: >> http://openjdk.java.net/jeps/178 >> >> Webrevs are here: >> >> http://cr.openjdk.java.net/~bpittore/8014135/jdk/webrev.00/ > > I looked at the javadoc updates to the attach API. > > One thing that doesn't come across very clearly is the mapping from > the agentLibrary parameter to "agent-lib-name". I think that needs a > few words so that it's clear that it is not literally looking for > "Agent_OnAttach_agent-lib-name" but rather "Agent_OnAttach" + > where is the library name in the > agentLibrary parameter. > > As I recall, the JVM Tool Interface is supposed to be referred so as > "JVM TI" rather than "JVMTI". > > Otherwise it looks okay to me. > > -Alan > > > > From guy.steele at oracle.com Tue Jul 16 16:01:45 2013 From: guy.steele at oracle.com (Guy Steele) Date: Tue, 16 Jul 2013 12:01:45 -0400 Subject: class SplittableRandom In-Reply-To: References: <51DDB26D.8050506@cs.oswego.edu> <51DE6069.2060308@gmail.com> <51DEA230.2060504@cs.oswego.edu> <51DEA3D5.5000509@oracle.com> <51E1549D.4060403@cs.oswego.edu> <51E414C6.9070400@cs.oswego.edu> <6099D28A-0B95-42A4-A59B-5E1C465EDCA9@oracle.com> Message-ID: <480BCC80-2A9C-4321-B81B-47487E90C0D7@oracle.com> On Jul 16, 2013, at 3:07 AM, Martin Buchholz wrote: > > Read Appleby and Stafford ... > > Hmmm.... mix32 has almost the same job as mix64 - have all the bits in the seed affect all the bits in the output, so the obvious implementation is > > mix32() { return (int) mix64(); } > or more conservatively > mix32() { m = mix64(); return (int)m ^ (int)(m >>> 32); } > although it would be slightly distressing to have nextInt be more expensive than nextLong. Yes---at first I used exactly mix32() { return (int) mix64(); } but was worried about the time it took, which is why I searched for a cheaper mixing function. > There might be some clever way of doing murmurhash-style mixing when the input is 64-bit and the output is 32-bit that can do better, but I don't think the current mix32 is it. Again, I was astonished that so simply a mixing function seemed to do the job as far as Dieharder is concerned. I agree that it does appear to perform poorly for sparse gamma values. So now the question is: do such sparse gamma values arise in practice? As Doug has pointed out, we carefully made the two-argument constructor private so that the user cannot specify gamma values. The gamma values are derived only from the gamma-seed 0, using the gamma value GAMMA_GAMMA, and always running the seed through mix64. I wrote a little test (code and output below) to generate the first 16 billion (well, 2^34+1) gamma values actually generated and gather certain statistics: (1) the number of 1-bits in the gamma value (output of Long.bitCount) (2) the "width" of the gamma value (64 - Long.numberOfLeadingBits(gamma) - Long.numberOfTrailingBits(gamma)) Then it histograms the bit counts, and for each possible bit count tracks the minimum width for gammas having that same bit count. Whenever the number of of gammas examined is one more than a power of 2, it prints a report consisting of those two tables and the min over the minwidth table. Here's a brief summary: For the first 65 gamma values, no gamma value has fewer than 21 1-bits or more than 41 1-bits. The minimum width is 57. So I predict there will be no weird mixing problems at all when using SplittableRandom to do a balanced split of a stream of generated randoms. For the first 2^16+1 = 65537 gamma values, the minimum bit count is 15, the maximum bit count is 50 and the minimum width is 45. For the first 2^24+1 gamma values, the minimum bit count is 12, the maximum bit count is 52 and the minimum width is 35. For the first 2^32+1 gamma values, the minimum bit count is 9, the maximum bit count is 55 and the minimum width is 28. For the first 2^34+1 gamma values, the minimum bit count is 8, the maximum bit count is 56 and the minimum width is 28. So I think we will not hit any really bad gamma values in practice. --Guy --------------------------------------------------------------------------------------------- class GammaTest { private static final long GAMMA_GAMMA = 0xF2281E2DBA6606F3L; private static long addGammaModGeorge(long sx, long g) { long px = sx + g; return (px >= sx) ? px : ((px >= Long.MIN_VALUE + 13L) ? px : px + g) - 13L; } private static long mix64(long z) { z ^= (z >>> 33); z *= 0xff51afd7ed558ccdL; z ^= (z >>> 33); z *= 0xc4ceb9fe1a85ec53L; z ^= (z >>> 33); return z; } public static void main(String[] args) { long[] hist = new long[65]; int[] minwidth = new int[65]; long splitSeed = 0; for (int j = 0; j < minwidth.length; j++) minwidth[j] = 99; for (long i = 0; i <= (1L << 34); i++) { long gamma; do { // ensure gamma >= 13, considered as an unsigned integer splitSeed = addGammaModGeorge(splitSeed, GAMMA_GAMMA); gamma = mix64(splitSeed); } while (gamma < (Long.MIN_VALUE + 13L)); int idx = Long.bitCount(gamma); if (hist[idx]++ == 0) System.out.printf("%ni=%d bitcount=%d gamma=%016x%n", i, idx, gamma); int width = 64 - Long.numberOfLeadingZeros(gamma) - Long.numberOfTrailingZeros(gamma); minwidth[idx] = Math.min(minwidth[idx], width); if ((i&(i-1)) == 0) { System.out.println(); System.out.println(i); for (int k = 0; k < hist.length; k++) System.out.print(hist[k] + " "); System.out.println(); int minmin = 99; for (int k = 0; k < minwidth.length; k++) { System.out.print(minwidth[k] + " "); minmin = Math.min(minmin, minwidth[k]); } System.out.println(); System.out.println("minmin=" + minmin); } } } } --------------------------------------------------------------------------------------------- gls% java GammaTest i=0 bitcount=35 gamma=3fa6b99a3e987361 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 62 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 minmin=62 i=1 bitcount=30 gamma=a8820f7e1a84f29b 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 64 99 99 99 99 62 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 minmin=62 i=2 bitcount=41 gamma=bcfbccf85745d3df 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 64 99 99 99 99 62 99 99 99 99 99 64 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 minmin=62 i=3 bitcount=26 gamma=13202372bd17408b i=4 bitcount=33 gamma=96772afc7533890c 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 1 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 61 99 99 99 64 99 99 62 99 62 99 99 99 99 99 64 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 minmin=61 i=5 bitcount=32 gamma=9ed441b7174f5461 i=7 bitcount=22 gamma=155aad13408a1028 i=8 bitcount=29 gamma=a0529a00afd4d6f1 8 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 1 2 0 1 1 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 58 99 99 99 61 99 99 64 63 99 64 62 99 62 99 99 99 99 99 64 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 minmin=58 i=12 bitcount=34 gamma=a760afe257da5958 i=13 bitcount=36 gamma=f52cbcdce12ac7f1 i=15 bitcount=28 gamma=c4e492cb810f16b8 i=16 bitcount=31 gamma=a1ccecf62b4013ad 16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 1 2 3 1 1 2 1 1 1 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 58 99 99 99 61 99 61 62 63 64 64 62 61 62 64 99 99 99 99 64 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 minmin=58 i=17 bitcount=25 gamma=9ac4aa4f70601a20 i=22 bitcount=37 gamma=daddf74e873c9943 i=28 bitcount=39 gamma=d9e7c776cef211ed 32 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 3 1 0 1 2 3 3 2 2 6 1 2 2 0 1 0 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 58 99 99 57 61 99 61 62 63 58 63 62 57 62 63 63 99 64 99 62 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 minmin=57 i=34 bitcount=21 gamma=7504ca488308c301 i=35 bitcount=27 gamma=43430ada33d4324c i=43 bitcount=38 gamma=b924c57b2e7eabdb i=54 bitcount=24 gamma=04912780a6716634 64 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 1 3 1 3 2 4 7 7 4 5 7 5 4 2 2 3 0 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 63 58 99 57 57 61 59 60 62 61 58 61 60 57 59 62 63 63 62 99 62 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 minmin=57 i=78 bitcount=23 gamma=0207077294708744 i=95 bitcount=40 gamma=ffdeafaa1cb578e1 128 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 7 3 5 4 11 15 14 6 13 16 12 5 3 2 3 1 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 63 58 56 57 57 61 59 60 57 58 58 61 60 57 59 62 63 63 62 64 61 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 minmin=56 i=170 bitcount=42 gamma=faf70c36cefcffb4 i=196 bitcount=43 gamma=6876bfb25ef5f3fd 256 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 2 1 2 7 3 10 12 20 20 34 26 26 27 21 12 8 6 7 2 5 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 63 58 56 57 57 61 56 56 54 58 53 55 59 57 59 60 60 62 62 61 61 62 63 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 minmin=53 i=338 bitcount=44 gamma=3bff2f8ff4f63b79 512 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 3 4 5 12 12 17 21 43 44 53 58 58 54 38 33 20 12 8 2 7 2 4 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 63 58 53 57 52 55 56 56 54 58 53 55 58 57 59 60 59 60 62 61 61 62 60 62 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 minmin=52 1024 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 4 8 15 22 35 41 59 83 87 105 115 104 98 71 60 39 32 13 8 14 3 5 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 63 58 53 56 52 55 56 52 54 58 53 55 56 57 59 59 59 58 62 61 57 62 60 62 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 minmin=52 i=1163 bitcount=19 gamma=10210841be5090c1 i=1211 bitcount=20 gamma=430484628436034a 2048 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 5 6 16 24 46 73 91 122 169 162 207 219 217 181 137 132 79 56 39 25 24 7 7 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 61 62 57 58 53 56 52 55 47 52 54 52 53 55 56 55 58 58 59 58 58 61 57 60 60 62 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 minmin=47 i=2120 bitcount=45 gamma=fbfbed9f9dd593ae i=4064 bitcount=17 gamma=0c1420320c028b14 4096 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 2 4 9 12 29 54 93 140 173 248 322 348 407 424 414 379 302 263 176 120 66 48 40 10 9 3 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 58 99 61 52 52 55 53 55 52 53 47 52 52 52 53 55 56 54 57 57 59 58 58 61 57 58 60 62 63 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 minmin=47 i=4209 bitcount=47 gamma=5bff6f9ebfe2eee7 8192 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 0 5 8 20 29 65 95 200 275 348 485 634 741 778 836 807 719 609 525 373 261 139 102 73 26 25 7 4 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 58 99 51 52 51 54 53 52 51 53 47 52 52 52 52 55 54 53 52 57 58 57 58 59 57 58 60 62 61 99 63 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 minmin=47 i=8797 bitcount=48 gamma=5fdf4b78df9ff6ff i=9220 bitcount=46 gamma=54ffd9abdf7c7ff3 i=10520 bitcount=18 gamma=10082a154f10201a 16384 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4 1 12 24 35 65 145 203 376 516 731 987 1221 1474 1606 1647 1631 1454 1186 1011 717 520 314 227 142 53 50 18 8 5 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 58 60 51 50 50 54 53 52 51 51 47 52 52 51 50 52 54 53 52 52 56 56 58 58 56 58 60 61 61 63 63 63 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 minmin=47 i=22427 bitcount=50 gamma=7ffeb5fbecb9effd 32768 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 5 2 19 46 70 131 280 398 727 999 1447 1977 2448 2975 3144 3300 3246 2905 2406 2013 1468 1068 678 469 259 125 91 39 21 7 3 2 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 58 60 51 47 45 51 50 52 50 50 47 49 52 51 50 49 49 52 52 51 55 56 58 57 56 58 60 60 59 63 63 63 99 63 99 99 99 99 99 99 99 99 99 99 99 99 99 99 minmin=45 i=33389 bitcount=49 gamma=fef6ef4fd7cdedf7 i=61883 bitcount=15 gamma=2009274214160080 65536 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 11 14 41 88 137 281 548 824 1409 2078 2942 3895 4880 5835 6287 6578 6384 5819 4862 4055 2971 2174 1426 909 512 250 180 83 35 18 5 3 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 55 99 51 47 51 47 45 51 45 50 48 48 47 49 48 48 50 49 49 50 52 51 55 55 54 55 56 58 59 60 59 61 61 63 64 63 99 99 99 99 99 99 99 99 99 99 99 99 99 99 minmin=45 i=97510 bitcount=16 gamma=0480158017905c00 131072 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 2 20 24 69 158 297 581 1025 1714 2845 4169 5995 7923 9852 11777 12554 12941 12683 11525 9805 8050 5976 4316 2832 1793 1017 526 333 157 65 31 8 5 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 55 43 51 47 49 47 45 45 45 49 48 48 47 48 48 48 50 49 49 50 52 51 55 51 54 55 54 58 55 59 59 61 61 63 63 63 99 99 99 99 99 99 99 99 99 99 99 99 99 99 minmin=43 262144 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4 13 29 38 130 305 563 1167 2056 3385 5717 8388 12027 15813 19885 23362 24906 25993 25369 22994 19803 16057 12044 8569 5572 3613 2109 1099 634 297 121 54 18 7 3 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 35 43 42 47 44 44 45 45 45 47 47 48 46 43 47 48 50 49 49 47 52 51 54 51 54 55 54 57 55 59 59 61 59 63 63 63 99 99 99 99 99 99 99 99 99 99 99 99 99 99 minmin=35 i=407116 bitcount=14 gamma=2456030052202100 524288 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 5 20 50 96 243 582 1158 2314 4225 7020 11336 17025 23860 31893 39376 46297 50332 51800 50697 46128 39809 31786 23977 17067 11407 7233 4144 2243 1220 565 234 96 30 13 6 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 99 99 99 99 99 99 99 99 99 99 99 99 99 99 54 35 43 42 47 44 44 44 45 45 47 47 43 45 43 46 48 50 49 49 47 51 50 53 51 54 55 54 57 55 59 59 61 59 63 63 63 99 99 99 99 99 99 99 99 99 99 99 99 99 99 minmin=35 i=576994 bitcount=13 gamma=920400f024808080 1048576 0 0 0 0 0 0 0 0 0 0 0 0 0 2 2 7 34 83 206 488 1161 2337 4605 8366 14318 22493 34298 47991 63906 78752 92493 100654 104072 100970 92197 79133 63541 47902 34057 22926 14460 8340 4482 2370 1124 487 212 70 26 10 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 99 99 99 99 99 99 99 99 99 99 99 99 99 57 54 35 43 42 47 44 44 44 45 45 46 47 43 45 43 46 48 48 49 46 47 50 50 52 51 51 55 54 56 55 58 59 60 59 61 62 63 99 99 99 99 99 99 99 99 99 99 99 99 99 99 minmin=35 i=1483317 bitcount=12 gamma=a0181500002c0410 i=2026274 bitcount=52 gamma=9ffdffdfab7bffbc 2097152 0 0 0 0 0 0 0 0 0 0 0 0 1 3 2 20 72 165 418 953 2262 4627 9186 16746 28712 45323 68341 96281 127978 157596 184726 201371 208836 201872 183672 157823 126903 96041 68378 45739 28607 16673 9201 4746 2239 971 439 157 49 18 5 0 1 0 0 0 0 0 0 0 0 0 0 0 0 99 99 99 99 99 99 99 99 99 99 99 99 60 57 54 35 43 42 44 44 38 44 45 45 41 47 43 45 43 44 45 45 48 46 47 50 50 51 51 51 55 53 56 55 58 59 58 59 61 60 63 99 62 99 99 99 99 99 99 99 99 99 99 99 99 minmin=35 4194304 0 0 0 0 0 0 0 0 0 0 0 0 1 7 10 35 125 312 824 1934 4487 9229 18274 33290 57289 90995 136825 192494 254986 315663 369601 402732 416949 403992 367988 315428 254190 192389 137063 91413 57008 33397 18213 9474 4412 1965 843 303 118 31 15 0 1 0 0 0 0 0 0 0 0 0 0 0 0 99 99 99 99 99 99 99 99 99 99 99 99 60 52 51 35 43 38 39 44 38 42 43 42 41 42 43 43 43 44 45 45 46 46 47 49 50 51 51 50 54 53 53 55 57 57 58 59 60 60 61 99 62 99 99 99 99 99 99 99 99 99 99 99 99 minmin=35 i=5289159 bitcount=51 gamma=fff7bf4feef3edbd 8388608 0 0 0 0 0 0 0 0 0 0 0 0 2 8 19 68 257 619 1577 3966 8988 18626 36391 66562 114416 182251 273859 385240 509615 632157 737773 806492 833917 807419 735145 631256 509264 384796 273801 182738 113834 66706 36653 18828 8879 3877 1694 600 218 70 25 2 1 0 0 0 0 0 0 0 0 0 0 0 0 99 99 99 99 99 99 99 99 99 99 99 99 51 52 50 35 43 38 39 43 38 42 40 39 41 42 43 42 43 44 45 45 46 46 47 49 49 49 51 50 51 53 53 54 56 57 58 59 60 60 61 62 62 99 99 99 99 99 99 99 99 99 99 99 99 minmin=35 16777216 0 0 0 0 0 0 0 0 0 0 0 0 5 9 49 147 485 1261 3293 7964 17769 37576 72859 133191 228598 363804 547300 769253 1019420 1262955 1474958 1613095 1669099 1614448 1472240 1263821 1017709 769610 548410 365327 227763 133219 73158 37467 17769 7924 3384 1265 424 137 42 8 2 0 0 0 0 0 0 0 0 0 0 0 0 99 99 99 99 99 99 99 99 99 99 99 99 47 51 50 35 37 38 39 38 38 40 40 39 41 42 42 42 43 44 45 43 40 46 47 47 47 49 50 50 51 53 53 54 55 55 58 59 60 58 61 62 62 99 99 99 99 99 99 99 99 99 99 99 99 minmin=35 i=16820079 bitcount=55 gamma=bfefffd7efdf37ff i=19132029 bitcount=53 gamma=bfd5fd9fdffbbeff i=28503406 bitcount=11 gamma=2001800040049298 33554432 0 0 0 0 0 0 0 0 0 0 0 1 10 16 90 304 946 2560 6632 15909 35451 74884 145325 266390 456181 727540 1094459 1540486 2036140 2525281 2949914 3228751 3336044 3231286 2945900 2527422 2034155 1539153 1097331 730442 455405 266449 146260 75158 35810 15921 6691 2492 848 273 89 27 5 1 0 1 0 0 0 0 0 0 0 0 0 99 99 99 99 99 99 99 99 99 99 99 59 39 49 44 35 37 38 39 37 38 40 40 39 37 39 40 41 42 43 44 43 40 46 47 47 47 48 50 50 51 51 53 54 55 55 57 58 60 58 61 59 62 64 99 64 99 99 99 99 99 99 99 99 99 minmin=35 i=50248637 bitcount=10 gamma=4121044020000830 67108864 0 0 0 0 0 0 0 0 0 0 1 2 16 41 172 604 1831 5064 13059 31814 71273 149700 291365 533400 912705 1456293 2186907 3079299 4068709 5051784 5895813 6461668 6671725 6465105 5893519 5054788 4070078 3079196 2192646 1459499 910002 533841 293232 150108 71335 31599 13231 4930 1739 528 186 47 7 3 0 1 0 0 0 0 0 0 0 0 0 99 99 99 99 99 99 99 99 99 99 59 45 39 47 44 35 37 38 37 37 38 40 39 39 37 39 39 41 41 43 42 43 40 46 47 47 47 48 50 50 51 51 53 54 55 55 57 58 59 58 61 59 62 63 99 64 99 99 99 99 99 99 99 99 99 minmin=35 134217728 0 0 0 0 0 0 0 0 0 0 2 5 25 89 355 1192 3664 10179 26375 63351 142557 299491 584340 1065894 1824595 2913971 4374871 6160464 8139540 10104867 11786651 12929321 13335580 12931879 11784785 10110408 8138304 6160629 4380229 2921343 1821989 1068184 584903 299658 143258 63251 26416 10002 3578 1070 343 95 22 3 0 1 0 0 0 0 0 0 0 0 0 99 99 99 99 99 99 99 99 99 99 59 45 39 36 39 35 37 37 37 37 35 38 37 39 36 39 39 39 41 42 42 42 40 46 46 46 47 47 50 50 51 51 53 54 55 55 56 56 56 58 61 59 62 63 99 64 99 99 99 99 99 99 99 99 99 minmin=35 i=211074001 bitcount=9 gamma=0800200488080184 268435456 0 0 0 0 0 0 0 0 0 1 3 10 46 167 703 2371 7196 20131 52310 126809 285119 597977 1168263 2133407 3648390 5832823 8753433 12323859 16280553 20206295 23578264 25862115 26665502 25865551 23576812 20213030 16276008 12320303 8755046 5838509 3644879 2135010 1169787 599077 285846 126847 52606 20153 7139 2202 684 167 47 6 0 1 0 0 0 0 0 0 0 0 0 99 99 99 99 99 99 99 99 99 58 59 45 39 36 39 34 35 37 35 34 35 38 37 38 36 39 39 39 38 42 42 42 40 45 46 46 47 47 49 49 51 51 52 53 53 55 56 56 56 58 60 59 61 63 99 64 99 99 99 99 99 99 99 99 99 minmin=34 i=282126527 bitcount=54 gamma=bfbfe6f77fbfbffb 536870912 0 0 0 0 0 0 0 0 0 1 4 19 111 342 1429 4596 14258 40133 104602 253712 569411 1196148 2336521 4268801 7295925 11670842 17506455 24641126 32562984 40408891 47161008 51727658 53331686 51724259 47155125 40429787 32553864 24638851 17510579 11672761 7292595 4269342 2338147 1196840 572163 253808 105069 40352 14374 4448 1403 375 90 15 2 1 0 0 0 0 0 0 0 0 0 99 99 99 99 99 99 99 99 99 58 59 40 39 36 38 34 34 36 35 34 34 34 36 36 36 38 36 39 38 42 42 42 40 44 45 46 46 47 49 49 50 51 51 52 53 54 54 56 56 58 59 59 61 61 64 64 99 99 99 99 99 99 99 99 99 minmin=34 1073741824 0 0 0 0 0 0 0 0 0 1 9 35 193 714 2768 9260 28593 80305 209383 507586 1140367 2392226 4670934 8538052 14586703 23341013 35019068 49281006 65116940 80830475 94314786 103453333 106666527 103441401 94312110 80848311 65119015 49279042 35027502 23344807 14587303 8538935 4676953 2393834 1142701 507604 210333 80614 28365 8966 2798 731 176 39 7 1 0 0 0 0 0 0 0 0 0 99 99 99 99 99 99 99 99 99 58 52 40 39 36 32 32 34 33 33 34 33 31 34 36 36 38 36 39 38 40 37 41 40 44 45 46 46 47 48 48 48 50 51 51 52 53 54 56 56 58 59 59 61 61 62 64 99 99 99 99 99 99 99 99 99 minmin=31 2147483648 0 0 0 0 0 0 0 0 0 2 15 72 393 1485 5512 18544 56885 160136 419243 1015005 2281755 4786013 9347576 17077350 29175048 46686775 70035013 98562926 130241014 161675823 188629618 206905864 213345687 206858690 188619382 161694929 130232017 98558401 70035558 46690858 29182733 17079355 9353296 4785074 2285312 1016667 420104 160973 56666 18360 5592 1466 359 86 16 1 0 0 0 0 0 0 0 0 0 99 99 99 99 99 99 99 99 99 49 43 40 37 35 30 32 32 30 33 32 32 31 34 35 36 37 36 37 38 39 37 41 40 43 44 45 45 46 46 48 48 50 51 51 52 53 54 56 56 57 57 59 61 61 60 64 99 99 99 99 99 99 99 99 99 minmin=30 4294967296 0 0 0 0 0 0 0 0 0 6 34 144 762 3039 11164 37001 113963 319754 839282 2029319 4566534 9572813 18703458 34158211 58357810 93371052 140075596 197114511 260483011 323353040 377268376 413774341 426695226 413722082 377238576 323403273 260475452 197108741 140074276 93374648 58358580 34159471 18704230 9568392 4572404 2032357 839396 321601 113435 36808 11154 3001 745 187 35 6 0 0 0 0 0 0 0 0 0 99 99 99 99 99 99 99 99 99 38 32 38 36 34 30 28 32 30 33 32 32 30 34 32 32 36 35 37 38 39 37 41 40 42 43 42 45 45 46 48 46 50 50 51 52 53 54 55 56 57 57 59 59 61 60 62 99 99 99 99 99 99 99 99 99 minmin=28 8589934592 0 0 0 0 0 0 0 0 0 13 79 336 1533 6124 22365 74005 227645 641294 1678555 4062563 9135436 19146246 37404346 68314413 116715549 186751961 280133016 394245507 520960980 646704106 754500158 827546025 853392459 827450851 754492700 646779407 520959567 394251447 280136711 186745948 116726667 68325488 37406424 19134945 9144013 4061654 1678931 643565 226826 74188 22395 6159 1556 355 70 12 0 0 0 0 0 0 0 0 0 99 99 99 99 99 99 99 99 99 38 32 37 35 31 29 28 32 30 30 29 31 30 33 32 32 36 35 37 37 38 37 40 40 42 41 42 45 44 46 48 46 48 50 51 52 53 53 55 56 57 57 59 59 61 60 62 99 99 99 99 99 99 99 99 99 minmin=28 i=9482338239 bitcount=56 gamma=f7dbbffffff3dfef i=9634895189 bitcount=8 gamma=0001028204004018 17179869184 0 0 0 0 0 0 0 0 2 25 140 684 2965 12140 44648 148477 455842 1283485 3353717 8118203 18272525 38289596 74810797 136630792 233434239 373478236 560261902 788501960 1041906860 1293417460 1508985189 1655070081 1706811030 1654980036 1509017821 1293431895 1041934469 788519174 560269067 373509002 233461129 136631104 74829674 38281590 18285512 8122298 3355225 1286114 454883 148253 44793 12172 3112 702 141 21 3 0 0 0 0 0 0 0 0 99 99 99 99 99 99 99 99 37 38 32 32 35 30 29 28 30 29 28 29 31 30 30 32 32 34 34 35 37 38 37 40 40 41 41 42 44 44 46 47 46 48 49 50 52 52 53 55 55 56 56 58 59 60 60 62 64 99 99 99 99 99 99 99 99 minmin=28 --------------------------------------------------------------------------------------------- From alexey.utkin at oracle.com Tue Jul 16 16:04:31 2013 From: alexey.utkin at oracle.com (Alexey Utkin) Date: Tue, 16 Jul 2013 20:04:31 +0400 Subject: Review request: JDK-8016579 (process) IOException thrown by ProcessBuilder.start() method is incorrectly encoded (v.2) In-Reply-To: References: <51E3C3AE.1020406@oracle.com> Message-ID: <51E56F0F.9010106@oracle.com> Here is new version of fix: http://cr.openjdk.java.net/~uta/openjdk-webrevs/JDK-8016579/webrev.01/ On 7/15/2013 9:08 PM, Martin Buchholz wrote: > Superficial review: > > Looks good mostly. > > Historically, switching windows code to use "W" APIs has been a big > TODO, but was waiting for Win98 de-support. In java.lang we have passed the half-way: the error reporting sub-system is in the ASCII world. > > Please spell correctly: > MESAGE_LENGTH Thanks, I missed it. Fixed. > > If errno and GetLastError are two separate error notification systems, > how do you know which one corresponded to the last failure? E.g. if > the last failure only set errno, won't the error message be > via GetLastError(), which is likely to be stale? As Dan mentioned, the os_lasterror was a copy of JVM os::lasterror call. The error message procedure is used for CreatePipe CreateProcessW GetExitCodeProcess WaitForMultipleObjects fail report. You are right, all the calls return the problem by GetLastMessage call. The function is changed (reduced). Here is new version of fix: http://cr.openjdk.java.net/~uta/openjdk-webrevs/JDK-8016579/webrev.01/ Regards, -uta > > > > On Mon, Jul 15, 2013 at 2:41 AM, Alexey Utkin > wrote: > > Bug description: > https://jbs.oracle.com/bugs/browse/JDK-8016579 > http://bugs.sun.com/view_bug.do?bug_id=8016579 > > Here is the suggested fix: > http://cr.openjdk.java.net/~uta/openjdk-webrevs/JDK-8016579/webrev.00/ > > > Summary: > We have THREE locales in action: > 1. Thread default locale - dictates UNICODE-to-8bit conversion > 2. OS locale that defines the message localization > 3. The file name locale > > Each locale could be an extended locale, that means that text > cannot be mapped to 8bit sequence without multibyte encoding. VM > is ready for that, if text is UTF-8. > The suggested fix does the work right from the beginning. > > Unicode version of JVM call: > hotspot/src/os/windows/vm/os_windows.cpp: > size_t os::lasterror(char* buf, size_t len) > was used as prototype for Unicode error message getter. It has to > be fixed accordingly as well as > jdk/src/windows/native/java/io/io_util_md.c > size_t getLastErrorString(char *buf, size_t len) > > The bug contains the attachment > https://jbs.oracle.com/bugs/secure/attachment/14581/JDK-8016579.txt > that summarize the fix result in comparison with original > implementation. > > Regards, > -uta > > From sundararajan.athijegannathan at oracle.com Tue Jul 16 16:16:30 2013 From: sundararajan.athijegannathan at oracle.com (sundararajan.athijegannathan at oracle.com) Date: Tue, 16 Jul 2013 16:16:30 +0000 Subject: hg: jdk8/tl/nashorn: 3 new changesets Message-ID: <20130716161634.5657648103@hg.openjdk.java.net> Changeset: 965d876853ec Author: attila Date: 2013-07-16 15:28 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/965d876853ec 8020357: throw RangeError for too large NativeArrayBuffer size Reviewed-by: jlaskey, hannesw, sundar ! src/jdk/nashorn/internal/objects/ArrayBufferView.java + test/script/basic/JDK-8020357.js + test/script/basic/JDK-8020357.js.EXPECTED Changeset: 7503f30c1355 Author: hannesw Date: 2013-07-16 16:12 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/7503f30c1355 8010821: [findbugs] Some classes in jdk.nashorn.internal.runtime.regexp expose mutable objects Reviewed-by: attila, jlaskey, sundar ! src/jdk/nashorn/internal/runtime/regexp/JoniRegExp.java ! src/jdk/nashorn/internal/runtime/regexp/joni/Analyser.java ! src/jdk/nashorn/internal/runtime/regexp/joni/ArrayCompiler.java ! src/jdk/nashorn/internal/runtime/regexp/joni/ByteCodeMachine.java ! src/jdk/nashorn/internal/runtime/regexp/joni/ByteCodePrinter.java ! src/jdk/nashorn/internal/runtime/regexp/joni/CodeRangeBuffer.java ! src/jdk/nashorn/internal/runtime/regexp/joni/EncodingHelper.java ! src/jdk/nashorn/internal/runtime/regexp/joni/Lexer.java ! src/jdk/nashorn/internal/runtime/regexp/joni/Parser.java ! src/jdk/nashorn/internal/runtime/regexp/joni/Regex.java ! src/jdk/nashorn/internal/runtime/regexp/joni/ScanEnvironment.java ! src/jdk/nashorn/internal/runtime/regexp/joni/ScannerSupport.java ! src/jdk/nashorn/internal/runtime/regexp/joni/Token.java ! src/jdk/nashorn/internal/runtime/regexp/joni/ast/BackRefNode.java ! src/jdk/nashorn/internal/runtime/regexp/joni/ast/CClassNode.java ! src/jdk/nashorn/internal/runtime/regexp/joni/ast/StateNode.java ! src/jdk/nashorn/internal/runtime/regexp/joni/ast/StringNode.java ! src/jdk/nashorn/internal/runtime/regexp/joni/constants/OPCode.java Changeset: 78bdb8a7f1e7 Author: attila Date: 2013-07-16 17:03 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/78bdb8a7f1e7 8015356: array concatenation should skip empty elements Reviewed-by: jlaskey, sundar ! src/jdk/nashorn/internal/objects/NativeArray.java + test/script/basic/JDK-8015356.js + test/script/basic/JDK-8015356.js.EXPECTED From mike.duigou at oracle.com Tue Jul 16 16:41:39 2013 From: mike.duigou at oracle.com (Mike Duigou) Date: Tue, 16 Jul 2013 09:41:39 -0700 Subject: class SplittableRandom In-Reply-To: <51E53EA0.7060409@cs.oswego.edu> References: <51DDB26D.8050506@cs.oswego.edu> <51DE6069.2060308@gmail.com> <51DEA230.2060504@cs.oswego.edu> <51DEA3D5.5000509@oracle.com> <51E1549D.4060403@cs.oswego.edu> <51E414C6.9070400@cs.oswego.edu> <6099D28A-0B95-42A4-A59B-5E1C465EDCA9@oracle.com> <51E53EA0.7060409@cs.oswego.edu> Message-ID: On Jul 16 2013, at 05:37 , Doug Lea wrote: > > I incorporated updates stemming from yesterday's SplittableRandom > list and off-list traffic. Thanks as always for all the helpfulness. > > Mike Duigou: It's probably reasonable to let lambda and webrev > versions lag a few days until a bit more stable. Until then, see > > http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/src/main/java/util/SplittableRandom.java?view=log I will hold off on updates for now. I was going to incorporate Jeff Hain's nextDouble suggestion into the lambda version but will leave it out for now. Mike From mike.duigou at oracle.com Tue Jul 16 16:55:17 2013 From: mike.duigou at oracle.com (Mike Duigou) Date: Tue, 16 Jul 2013 09:55:17 -0700 Subject: class SplittableRandom In-Reply-To: <51E48185.7070709@cs.oswego.edu> References: <51DDB26D.8050506@cs.oswego.edu> <51DE6069.2060308@gmail.com> <51DEA230.2060504@cs.oswego.edu> <51DEA3D5.5000509@oracle.com> <51E1549D.4060403@cs.oswego.edu> <51E414C6.9070400@cs.oswego.edu> <51E48185.7070709@cs.oswego.edu> Message-ID: On Jul 15 2013, at 16:11 , Doug Lea wrote: > On 07/15/13 12:59, Martin Buchholz wrote: >> If we make the wraparound point for seeds Long.MIN_VALUE instead of 0L, then we >> can optimize addGammaModGeorge. > > This was a great suggestion; thanks! > >> >> I continue to worry that we are producing a PRNG that will end up not being >> acceptable to the Monte Carlo simulation community. >> > > I'm not sure there is enough of an identifiable community there > to decode this. Some people think they need Mersenne Twister, > with 4096bit state and 2^4096 periodicity. But that would make > a poor candidate for JDK. I worry that it will be difficult/impractical for those who desire a different algorithm to replace SplittableRandom with their own (P)RNG whether it be for secure randomness or better statistical properties. Since SplittableRandom doesn't implement any interfaces it's hard to provide any form of substitute except by crufty override of every method. I know that this ground has already been travelled but it remains a concern for me. If only Stream bearing methods were offered there would be little concern but the current implementation will almost certainly be identified by type in fields and method signatures and thus difficult to supplant/work around. Useful concrete types without interfaces always make me nervous. :-) Mike > On the other side, there are people > who most care about cost and are happy with a generator that > is at least not obviously too regular, but we don't supply those > either. The 90+% in between are likely to be happy that JDK8 > provides something both cheaper and better than java.util.Random > to use when it applies. > > -Doug > From guy.steele at oracle.com Tue Jul 16 17:01:45 2013 From: guy.steele at oracle.com (Guy Steele) Date: Tue, 16 Jul 2013 13:01:45 -0400 Subject: class SplittableRandom In-Reply-To: References: <51DDB26D.8050506@cs.oswego.edu> <51DE6069.2060308@gmail.com> <51DEA230.2060504@cs.oswego.edu> <51DEA3D5.5000509@oracle.com> <51E1549D.4060403@cs.oswego.edu> <51E414C6.9070400@cs.oswego.edu> <51E48185.7070709@cs.oswego.edu> Message-ID: <51B31CBA-11F5-457C-9F9D-1EB4EF6C5DB3@oracle.com> Maybe "SplittableRandom" should be an interface, and the current implementation called, say, "SplittableRandom64" (for its 64-bit seed). --Guy On Jul 16, 2013, at 12:55 PM, Mike Duigou wrote: > > On Jul 15 2013, at 16:11 , Doug Lea wrote: > >> On 07/15/13 12:59, Martin Buchholz wrote: >>> If we make the wraparound point for seeds Long.MIN_VALUE instead of 0L, then we >>> can optimize addGammaModGeorge. >> >> This was a great suggestion; thanks! >> >>> >>> I continue to worry that we are producing a PRNG that will end up not being >>> acceptable to the Monte Carlo simulation community. >>> >> >> I'm not sure there is enough of an identifiable community there >> to decode this. Some people think they need Mersenne Twister, >> with 4096bit state and 2^4096 periodicity. But that would make >> a poor candidate for JDK. > > I worry that it will be difficult/impractical for those who desire a different algorithm to replace SplittableRandom with their own (P)RNG whether it be for secure randomness or better statistical properties. Since SplittableRandom doesn't implement any interfaces it's hard to provide any form of substitute except by crufty override of every method. > > I know that this ground has already been travelled but it remains a concern for me. If only Stream bearing methods were offered there would be little concern but the current implementation will almost certainly be identified by type in fields and method signatures and thus difficult to supplant/work around. > > Useful concrete types without interfaces always make me nervous. :-) > > Mike > >> On the other side, there are people >> who most care about cost and are happy with a generator that >> is at least not obviously too regular, but we don't supply those >> either. The 90+% in between are likely to be happy that JDK8 >> provides something both cheaper and better than java.util.Random >> to use when it applies. >> >> -Doug >> > From dl at cs.oswego.edu Tue Jul 16 17:38:11 2013 From: dl at cs.oswego.edu (Doug Lea) Date: Tue, 16 Jul 2013 13:38:11 -0400 Subject: class SplittableRandom In-Reply-To: References: <51DDB26D.8050506@cs.oswego.edu> <51DE6069.2060308@gmail.com> <51DEA230.2060504@cs.oswego.edu> <51DEA3D5.5000509@oracle.com> <51E1549D.4060403@cs.oswego.edu> <51E414C6.9070400@cs.oswego.edu> <6099D28A-0B95-42A4-A59B-5E1C465EDCA9@oracle.com> <51E53EA0.7060409@cs.oswego.edu> Message-ID: <51E58503.3080000@cs.oswego.edu> On 07/16/13 12:41, Mike Duigou wrote: > > On Jul 16 2013, at 05:37 , Doug Lea wrote: >> Mike Duigou: It's probably reasonable to let lambda and webrev >> versions lag a few days until a bit more stable. Until then, see >> >> http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/src/main/java/util/SplittableRandom.java?view=log > > I will hold off on updates for now. I was going to incorporate Jeff Hain's nextDouble suggestion into the lambda version but will leave it out for now. > On the other hand, we just found out that our long-postponed outage here as our department moves across street to a new building is on again for tomorrow morning, so now might be better than later. We can only guess when later might come... -Doug From martinrb at google.com Tue Jul 16 17:49:46 2013 From: martinrb at google.com (Martin Buchholz) Date: Tue, 16 Jul 2013 10:49:46 -0700 Subject: Review request: JDK-8016579 (process) IOException thrown by ProcessBuilder.start() method is incorrectly encoded (v.2) In-Reply-To: <51E56F0F.9010106@oracle.com> References: <51E3C3AE.1020406@oracle.com> <51E56F0F.9010106@oracle.com> Message-ID: Looks OK to me. As ever, we continue to not have good places within the JDK itself for C-level infrastructure - win32Error is not specific to the process api, and should really be pulled into some common directory - but I don't know of any such. On Tue, Jul 16, 2013 at 9:04 AM, Alexey Utkin wrote: > Here is new version of fix: > http://cr.openjdk.java.net/~uta/openjdk-webrevs/JDK-8016579/webrev.01/ > > On 7/15/2013 9:08 PM, Martin Buchholz wrote: > > Superficial review: > > Looks good mostly. > > Historically, switching windows code to use "W" APIs has been a big > TODO, but was waiting for Win98 de-support. > > In java.lang we have passed the half-way: the error reporting sub-system > is in the ASCII world. > > > Please spell correctly: > MESAGE_LENGTH > > Thanks, I missed it. Fixed. > > > If errno and GetLastError are two separate error notification systems, > how do you know which one corresponded to the last failure? E.g. if the > last failure only set errno, won't the error message be via GetLastError(), > which is likely to be stale? > > As Dan mentioned, the os_lasterror was a copy of JVM os::lasterror call. > The error message procedure is used for > CreatePipe > CreateProcessW > GetExitCodeProcess > WaitForMultipleObjects > fail report. You are right, all the calls return the problem by > GetLastMessage call. > The function is changed (reduced). > > Here is new version of fix: > http://cr.openjdk.java.net/~uta/openjdk-webrevs/JDK-8016579/webrev.01/ > > Regards, > -uta > > > > > On Mon, Jul 15, 2013 at 2:41 AM, Alexey Utkin wrote: > >> Bug description: >> https://jbs.oracle.com/bugs/browse/JDK-8016579 >> http://bugs.sun.com/view_bug.do?bug_id=8016579 >> >> Here is the suggested fix: >> http://cr.openjdk.java.net/~uta/openjdk-webrevs/JDK-8016579/webrev.00/ >> >> Summary: >> We have THREE locales in action: >> 1. Thread default locale - dictates UNICODE-to-8bit conversion >> 2. OS locale that defines the message localization >> 3. The file name locale >> >> Each locale could be an extended locale, that means that text cannot be >> mapped to 8bit sequence without multibyte encoding. VM is ready for that, >> if text is UTF-8. >> The suggested fix does the work right from the beginning. >> >> Unicode version of JVM call: >> hotspot/src/os/windows/vm/os_windows.cpp: >> size_t os::lasterror(char* buf, size_t len) >> was used as prototype for Unicode error message getter. It has to be >> fixed accordingly as well as >> jdk/src/windows/native/java/io/io_util_md.c >> size_t getLastErrorString(char *buf, size_t len) >> >> The bug contains the attachment >> https://jbs.oracle.com/bugs/secure/attachment/14581/JDK-8016579.txt >> that summarize the fix result in comparison with original implementation. >> >> Regards, >> -uta >> > > > From guy.steele at oracle.com Tue Jul 16 18:57:24 2013 From: guy.steele at oracle.com (Guy Steele) Date: Tue, 16 Jul 2013 14:57:24 -0400 Subject: class SplittableRandom In-Reply-To: References: <51DDB26D.8050506@cs.oswego.edu> <51DE6069.2060308@gmail.com> <51DEA230.2060504@cs.oswego.edu> <51DEA3D5.5000509@oracle.com> <51E1549D.4060403@cs.oswego.edu> <51E414C6.9070400@cs.oswego.edu> Message-ID: <3D22551A-C041-44E8-B0B3-813B865CC071@oracle.com> On Jul 15, 2013, at 4:13 PM, Martin Buchholz wrote: > > On Mon, Jul 15, 2013 at 9:59 AM, Martin Buchholz wrote: >> >> Also, if gamma is much less than 2^64 (say 2^56; that number of gammas >> "should be enough for anybody"), then the above will be a little more >> efficient since the wraparound code will be rare and well-predicted. The >> bits that become available as a result can then be optionally donated to >> the seed space! I just looked into this. It's not a good idea to generate 64-bit gamma values and then filter them; it's too costly to do rejection sampling, and if you just throw away bits, you risk getting duplicate gamma values, which is undesirable. So instead I took the latest version and modified the generation of gamma values to use a 56-bit GAMMA_GAMMA value and perform arithmetic modulo 2^56-5 (I will call this prime "Arthur"). I also threw together a 56-bit mixing function "mix56" by simply adding a little bit of masking to mix64; I emphasize, however, that I have not yet performed avalanche testing on mix56. The point of mix56 is that it is (I think) a bijective function of 56-bit values, whereas applying mix64 and then discarding 8 bits would not be. Therefore all the generated gamma values should be different. private static final long GAMMA_PRIME = (1L << 56) - 5; // Arthur, a prime number private static final long GAMMA_GAMMA = 0x00281E2DBA6606F3L; // must be less than Arthur private GreatestRandom(long seed, long splitSeed) { this.seed = seed; long s = (splitSeed & 0x7FFFFFFFFFFFFFFFL) % GAMMA_PRIME, g; do { // ensure gamma >= 13, considered as an unsigned integer s += GAMMA_GAMMA; if (s >= GAMMA_PRIME) s -= GAMMA_PRIME; g = mix56(s); } while (g >= 0L && g < 13L); this.gamma = g; this.nextSplit = s; } private static long mix56(long z) { z ^= (z >>> 33); z *= 0xff51afd7ed558ccdL; z &= 0x00FFFFFFFFFFFFFFL; z ^= (z >>> 33); z *= 0xc4ceb9fe1a85ec53L; z &= 0x00FFFFFFFFFFFFFFL; z ^= (z >>> 33); return z; } So here's the punchline: this change makes my Monte Carlo calculation of pi run over 19% faster! Hard to believe. It's certainly avoiding most of the hard work in addGammaModGeorge, and perhaps also making branch prediction totally win, but 19% ??? Someone please verify this independently. Still to be done: (a) verify avalanche behavior of mix56; (b) run more DieHarder tests. --Guy From henry.jen at oracle.com Tue Jul 16 19:05:50 2013 From: henry.jen at oracle.com (Henry Jen) Date: Tue, 16 Jul 2013 12:05:50 -0700 Subject: RFR: 8016846: Pattern.splitAsStream tests required Message-ID: <51E5998E.8040409@oracle.com> Hi, Please review the webrev at, http://cr.openjdk.java.net/~henryjen/tl/8016846/0/webrev/ The test is mostly contributed by Ben Evans. Cheers, Henry From dan.xu at oracle.com Tue Jul 16 19:07:57 2013 From: dan.xu at oracle.com (Dan Xu) Date: Tue, 16 Jul 2013 12:07:57 -0700 Subject: Review request: JDK-8016579 (process) IOException thrown by ProcessBuilder.start() method is incorrectly encoded (v.2) In-Reply-To: References: <51E3C3AE.1020406@oracle.com> <51E56F0F.9010106@oracle.com> Message-ID: <51E59A0D.7050506@oracle.com> I agree. Is jdk_util.c or jni_util.c or any file under native/common/ a good place? The fix looks good to me. One small comment is to get the return value of swprintf() in win32Error(). If the return value is -1, an error situation needs to be handled even though it seems very rare. If it is not -1, then get the actual length of utf16_javaMessage. And pass the length of utf16_javaMessage to WideCharToMultiByte() instead of MESSAGE_LENGTH to make the code more efficient. Thanks! -Dan On 07/16/2013 10:49 AM, Martin Buchholz wrote: > Looks OK to me. As ever, we continue to not have good places within > the JDK itself for C-level infrastructure - win32Error is not specific > to the process api, and should really be pulled into some common > directory - but I don't know of any such. > > > On Tue, Jul 16, 2013 at 9:04 AM, Alexey Utkin > wrote: > > Here is new version of fix: > http://cr.openjdk.java.net/~uta/openjdk-webrevs/JDK-8016579/webrev.01/ > > > On 7/15/2013 9:08 PM, Martin Buchholz wrote: >> Superficial review: >> >> Looks good mostly. >> >> Historically, switching windows code to use "W" APIs has been a >> big TODO, but was waiting for Win98 de-support. > In java.lang we have passed the half-way: the error reporting > sub-system is in the ASCII world. >> >> Please spell correctly: >> MESAGE_LENGTH > Thanks, I missed it. Fixed. >> >> If errno and GetLastError are two separate error notification >> systems, how do you know which one corresponded to the last >> failure? E.g. if the last failure only set errno, won't the >> error message be via GetLastError(), which is likely to be stale? > As Dan mentioned, the os_lasterror was a copy of JVM os::lasterror > call. > The error message procedure is used for > CreatePipe > CreateProcessW > GetExitCodeProcess > WaitForMultipleObjects > fail report. You are right, all the calls return the problem by > GetLastMessage call. > The function is changed (reduced). > > Here is new version of fix: > http://cr.openjdk.java.net/~uta/openjdk-webrevs/JDK-8016579/webrev.01/ > > > Regards, > -uta > >> >> >> >> On Mon, Jul 15, 2013 at 2:41 AM, Alexey Utkin >> > wrote: >> >> Bug description: >> https://jbs.oracle.com/bugs/browse/JDK-8016579 >> http://bugs.sun.com/view_bug.do?bug_id=8016579 >> >> Here is the suggested fix: >> http://cr.openjdk.java.net/~uta/openjdk-webrevs/JDK-8016579/webrev.00/ >> >> >> Summary: >> We have THREE locales in action: >> 1. Thread default locale - dictates UNICODE-to-8bit conversion >> 2. OS locale that defines the message localization >> 3. The file name locale >> >> Each locale could be an extended locale, that means that text >> cannot be mapped to 8bit sequence without multibyte encoding. >> VM is ready for that, if text is UTF-8. >> The suggested fix does the work right from the beginning. >> >> Unicode version of JVM call: >> hotspot/src/os/windows/vm/os_windows.cpp: >> size_t os::lasterror(char* buf, size_t len) >> was used as prototype for Unicode error message getter. It >> has to be fixed accordingly as well as >> jdk/src/windows/native/java/io/io_util_md.c >> size_t getLastErrorString(char *buf, size_t len) >> >> The bug contains the attachment >> https://jbs.oracle.com/bugs/secure/attachment/14581/JDK-8016579.txt >> that summarize the fix result in comparison with original >> implementation. >> >> Regards, >> -uta >> >> > > From dl at cs.oswego.edu Tue Jul 16 19:19:46 2013 From: dl at cs.oswego.edu (Doug Lea) Date: Tue, 16 Jul 2013 15:19:46 -0400 Subject: class SplittableRandom In-Reply-To: <3D22551A-C041-44E8-B0B3-813B865CC071@oracle.com> References: <51DDB26D.8050506@cs.oswego.edu> <51DE6069.2060308@gmail.com> <51DEA230.2060504@cs.oswego.edu> <51DEA3D5.5000509@oracle.com> <51E1549D.4060403@cs.oswego.edu> <51E414C6.9070400@cs.oswego.edu> <3D22551A-C041-44E8-B0B3-813B865CC071@oracle.com> Message-ID: <51E59CD2.3070905@cs.oswego.edu> On 07/16/13 14:57, Guy Steele wrote: > So instead I took the latest version and modified the generation of gamma values > to use a 56-bit GAMMA_GAMMA value and perform arithmetic modulo 2^56-5 ... > So here's the punchline: this change makes my Monte Carlo calculation of pi run over 19% faster! > Hard to believe. It's certainly avoiding most of the hard work in addGammaModGeorge, > and perhaps also making branch prediction totally win, but 19% ??? Someone please verify this > independently. > I tried this on a few other simple tests and I see varying improvements on different machines from about 8% to 15%. So this does seem worth pursuing. (Aside to casual observers on this list: Sometimes it does pay off to obsess so much over a couple of "if" statements.) -Doug From jason.uh at oracle.com Tue Jul 16 19:20:18 2013 From: jason.uh at oracle.com (jason.uh at oracle.com) Date: Tue, 16 Jul 2013 19:20:18 +0000 Subject: hg: jdk8/tl/jdk: 8020557: javadoc cleanup in javax.security Message-ID: <20130716192100.E667548112@hg.openjdk.java.net> Changeset: f7af15e2c95b Author: juh Date: 2013-07-16 12:19 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/f7af15e2c95b 8020557: javadoc cleanup in javax.security Reviewed-by: darcy ! src/share/classes/javax/security/auth/AuthPermission.java ! src/share/classes/javax/security/auth/DestroyFailedException.java ! src/share/classes/javax/security/auth/Destroyable.java ! src/share/classes/javax/security/auth/Policy.java ! src/share/classes/javax/security/auth/PrivateCredentialPermission.java ! src/share/classes/javax/security/auth/RefreshFailedException.java ! src/share/classes/javax/security/auth/Refreshable.java ! src/share/classes/javax/security/auth/Subject.java ! src/share/classes/javax/security/auth/SubjectDomainCombiner.java ! src/share/classes/javax/security/auth/callback/Callback.java ! src/share/classes/javax/security/auth/callback/CallbackHandler.java ! src/share/classes/javax/security/auth/callback/ChoiceCallback.java ! src/share/classes/javax/security/auth/callback/ConfirmationCallback.java ! src/share/classes/javax/security/auth/callback/LanguageCallback.java ! src/share/classes/javax/security/auth/callback/NameCallback.java ! src/share/classes/javax/security/auth/callback/PasswordCallback.java ! src/share/classes/javax/security/auth/callback/TextInputCallback.java ! src/share/classes/javax/security/auth/callback/TextOutputCallback.java ! src/share/classes/javax/security/auth/callback/UnsupportedCallbackException.java + src/share/classes/javax/security/auth/callback/package-info.java - src/share/classes/javax/security/auth/callback/package.html ! src/share/classes/javax/security/auth/kerberos/DelegationPermission.java ! src/share/classes/javax/security/auth/kerberos/KerberosKey.java ! src/share/classes/javax/security/auth/kerberos/KerberosPrincipal.java ! src/share/classes/javax/security/auth/kerberos/KerberosTicket.java ! src/share/classes/javax/security/auth/kerberos/KeyImpl.java ! src/share/classes/javax/security/auth/kerberos/KeyTab.java ! src/share/classes/javax/security/auth/kerberos/ServicePermission.java + src/share/classes/javax/security/auth/kerberos/package-info.java - src/share/classes/javax/security/auth/kerberos/package.html ! src/share/classes/javax/security/auth/login/AccountExpiredException.java ! src/share/classes/javax/security/auth/login/AppConfigurationEntry.java ! src/share/classes/javax/security/auth/login/Configuration.java ! src/share/classes/javax/security/auth/login/ConfigurationSpi.java ! src/share/classes/javax/security/auth/login/CredentialExpiredException.java ! src/share/classes/javax/security/auth/login/FailedLoginException.java ! src/share/classes/javax/security/auth/login/LoginContext.java + src/share/classes/javax/security/auth/login/package-info.java - src/share/classes/javax/security/auth/login/package.html + src/share/classes/javax/security/auth/package-info.java - src/share/classes/javax/security/auth/package.html ! src/share/classes/javax/security/auth/spi/LoginModule.java + src/share/classes/javax/security/auth/spi/package-info.java - src/share/classes/javax/security/auth/spi/package.html ! src/share/classes/javax/security/auth/x500/X500Principal.java ! src/share/classes/javax/security/auth/x500/X500PrivateCredential.java + src/share/classes/javax/security/auth/x500/package-info.java - src/share/classes/javax/security/auth/x500/package.html ! src/share/classes/javax/security/cert/Certificate.java ! src/share/classes/javax/security/cert/CertificateEncodingException.java ! src/share/classes/javax/security/cert/CertificateException.java ! src/share/classes/javax/security/cert/CertificateExpiredException.java ! src/share/classes/javax/security/cert/CertificateNotYetValidException.java ! src/share/classes/javax/security/cert/CertificateParsingException.java ! src/share/classes/javax/security/cert/X509Certificate.java + src/share/classes/javax/security/cert/package-info.java - src/share/classes/javax/security/cert/package.html ! src/share/classes/javax/security/sasl/AuthenticationException.java ! src/share/classes/javax/security/sasl/AuthorizeCallback.java ! src/share/classes/javax/security/sasl/RealmCallback.java ! src/share/classes/javax/security/sasl/RealmChoiceCallback.java ! src/share/classes/javax/security/sasl/Sasl.java ! src/share/classes/javax/security/sasl/SaslClient.java ! src/share/classes/javax/security/sasl/SaslClientFactory.java ! src/share/classes/javax/security/sasl/SaslException.java ! src/share/classes/javax/security/sasl/SaslServer.java ! src/share/classes/javax/security/sasl/SaslServerFactory.java + src/share/classes/javax/security/sasl/package-info.java - src/share/classes/javax/security/sasl/package.html From guy.steele at oracle.com Tue Jul 16 19:23:22 2013 From: guy.steele at oracle.com (Guy Steele) Date: Tue, 16 Jul 2013 15:23:22 -0400 Subject: class SplittableRandom In-Reply-To: <3D22551A-C041-44E8-B0B3-813B865CC071@oracle.com> References: <51DDB26D.8050506@cs.oswego.edu> <51DE6069.2060308@gmail.com> <51DEA230.2060504@cs.oswego.edu> <51DEA3D5.5000509@oracle.com> <51E1549D.4060403@cs.oswego.edu> <51E414C6.9070400@cs.oswego.edu> <3D22551A-C041-44E8-B0B3-813B865CC071@oracle.com> Message-ID: <13FABA7D-8237-4C04-9DCB-57B7CDB6346B@oracle.com> On Jul 16, 2013, at 2:57 PM, Guy Steele wrote: > . . . > So here's the punchline: this change makes my Monte Carlo calculation of pi run over 19% faster! > Hard to believe. It's certainly avoiding most of the hard work in addGammaModGeorge, > and perhaps also making branch prediction totally win, but 19% ??? Someone please verify this > independently. I ran more tests. Using 60-bit gamma values, the improvement is about 14-15%. Using 56-bit gamma values, the improvement is about 19-20%, as already reported. Using 52-bit gamma values, the improvement is about 19-20%. So, as expected, there is a knee in the curve, and 56-bit values are about right. But I should check 57, 58, and 59 bits. > Still to be done: (a) verify avalanche behavior of mix56; (b) run more DieHarder tests. And (c), look again at the mathematical proofs and see whether limiting the range of gamma values adversely affects the likelihood of hitting a bad case (different pedigrees producing duplicate values). --Guy From brian.burkhalter at oracle.com Tue Jul 16 19:50:48 2013 From: brian.burkhalter at oracle.com (Brian Burkhalter) Date: Tue, 16 Jul 2013 12:50:48 -0700 Subject: Java 8 RFR 6476168: (fmt) Inconsistency formatting subnormal doubles with hexadecimal conversion Message-ID: <23721DCA-F2A2-4B97-9CC0-56151ACD7E95@oracle.com> Reviewers: Issue http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6476168 Webrev http://cr.openjdk.java.net/~bpb/6476168/ Change is to clarify the javadoc specification such that the implementation is in sync. Thanks, Brian From brian.burkhalter at oracle.com Tue Jul 16 20:37:01 2013 From: brian.burkhalter at oracle.com (Brian Burkhalter) Date: Tue, 16 Jul 2013 13:37:01 -0700 Subject: Java 8 RFR 8020539: Clean up doclint problems in java.util package, part 2 Message-ID: <50FE640E-DC42-47F2-9FAD-8472A013EB9B@oracle.com> Reviewers: Issue: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8020539 Webrev: http://cr.openjdk.java.net/~bpb/8020539/ I think the only dubious change in here is in the Scanner class comments. This was previously using empty tag pairs for spacing purposes. I replaced each these with   repeated four times. There is no visible change in the generated HTML from what I can see and doclint likes this better. Thanks, Brian From dl at cs.oswego.edu Tue Jul 16 20:38:40 2013 From: dl at cs.oswego.edu (Doug Lea) Date: Tue, 16 Jul 2013 16:38:40 -0400 Subject: class SplittableRandom In-Reply-To: References: <51DDB26D.8050506@cs.oswego.edu> <51DE6069.2060308@gmail.com> <51DEA230.2060504@cs.oswego.edu> <51DEA3D5.5000509@oracle.com> <51E1549D.4060403@cs.oswego.edu> <51E414C6.9070400@cs.oswego.edu> <51E48185.7070709@cs.oswego.edu> Message-ID: <51E5AF50.6060206@cs.oswego.edu> On 07/16/13 12:55, Mike Duigou wrote: > I worry that it will be difficult/impractical for those who desire a > different algorithm to replace SplittableRandom with their own (P)RNG whether > it be for secure randomness or better statistical properties. Since > SplittableRandom doesn't implement any interfaces it's hard to provide any > form of substitute except by crufty override of every method. > > I know that this ground has already been travelled but it remains a concern > for me. Yes. To recap the reasons we decided to not pursue this for JDK8: 1. Impact on java.util.Random. No matter what, you'd need to somehow touch this class, which (justifiably) invites detailed study of any compatibility issues. 2. Questionability of default implementations. Impleemntation details of some non-core methods (for example, nextDouble, nextInt(bound)) are often sensitive to quirks of base algorithms, so perhaps it would be best not to supply any default implementations. On the other hand, not doing so would not be in keeping with other new JDK8 interfaces. It requires more thought about whether or how to resolve. 3. Finite parallel streams Some of the coolest things you can do with SplittableRandom stem from these new methods; that don't have obvious analogs in most other generators. So even with an interface, SplittableRandom would likely have some distinct methods. None of these are show-stoppers, or probably all that hard to address. But starting up an effort on it at this point for JDK8 seemed like a bad idea. And as mentioned in my initial post, the case for introducing SplittableRandom without this seems pretty solid. -Doug From joe.darcy at oracle.com Tue Jul 16 20:59:14 2013 From: joe.darcy at oracle.com (Joe Darcy) Date: Tue, 16 Jul 2013 13:59:14 -0700 Subject: Java 8 RFR 8020539: Clean up doclint problems in java.util package, part 2 In-Reply-To: <50FE640E-DC42-47F2-9FAD-8472A013EB9B@oracle.com> References: <50FE640E-DC42-47F2-9FAD-8472A013EB9B@oracle.com> Message-ID: <51E5B422.7000700@oracle.com> Hi Brian, For the changes in j.u.Random, - * pseudorandomly generated and returned. All 232 + * pseudorandomly generated and returned. All 232 I would just dispense with the size adjustment of the exponent -- the tag alone should be sufficient. Plain is used in java.lang.Integer and elsewhere in the core libraries. For the changes in Scanner, I recommend using definition lists instead. For guidance, here is an example from java.lang.Integer: *
*
DecodableString: *
Signopt DecimalNumeral *
Signopt {@code 0x} HexDigits *
Signopt {@code 0X} HexDigits *
Signopt {@code #} HexDigits *
Signopt {@code 0} OctalDigits *

*

Sign: *
{@code -} *
{@code +} *
The other changes look fine. Thanks, -Joe On 07/16/2013 01:37 PM, Brian Burkhalter wrote: > Reviewers: > > Issue: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8020539 > Webrev: http://cr.openjdk.java.net/~bpb/8020539/ > > I think the only dubious change in here is in the Scanner class comments. This was previously using empty tag pairs for spacing purposes. I replaced each these with   repeated four times. There is no visible change in the generated HTML from what I can see and doclint likes this better. > > Thanks, > > Brian From brian.burkhalter at oracle.com Tue Jul 16 21:32:20 2013 From: brian.burkhalter at oracle.com (Brian Burkhalter) Date: Tue, 16 Jul 2013 14:32:20 -0700 Subject: Java 8 RFR 8020641: Clean up some code style in recent BigInteger contributions Message-ID: <868A0266-E04D-440F-80A1-3134B47D79CF@oracle.com> Reviewers: Issue http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8020641 (will be public soon) Webrev http://cr.openjdk.java.net/~bpb/8020641/ Note that this patch will need to be integrated after the one for 8014319 which is pending approval [1]. Thanks, Brian [1] http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-July/018922.html From bob.vandette at oracle.com Tue Jul 16 21:44:31 2013 From: bob.vandette at oracle.com (Bob Vandette) Date: Tue, 16 Jul 2013 17:44:31 -0400 Subject: RFR - Changes to address CCC 8014135: Support for statically linked agents In-Reply-To: <51DDB632.4050805@oracle.com> References: <51D494E9.2020200@oracle.com> <51DDB632.4050805@oracle.com> Message-ID: <0F64EB55-B38C-416E-93D1-92BA8F5D43C7@oracle.com> Thanks for the suggestion Jeremy but the JVMTI agent change is being implemented as part of the original JNI static library implementation where we explicitly prohibited dynamic libraries to be loaded if a static library of the same name is baked into the launcher. "If a library L is statically linked then it will be prohibited to link a library of the same name dynamically." The primary motivation for requiring this for the -agentpath as well as the java.lang.System.load API is to minimize changes to java source code. You can statically or dynamically link a library without changing any of the code that attempts to use the library. The only thing that changes is the OnLoad name in the library and the link options. If you'd like to optionally use different implementations, you can end up with the same behavior by using a System property which alters the String of the name of the library. Bob. On Jul 10, 2013, at 3:29 PM, BILL PITTORE wrote: > On 7/3/2013 6:32 PM, Jeremy Manson wrote: >> I know that this is mentioned in the JEP, but does it really make sense to have -agentpath work here, rather than just -agentlib? I would think that specifying a full pathname and getting the library loaded out of the launcher would be a little surprising to people who are basically saying "please load this agent from the given path". >> >> Also, in practice, we do something very similar at Google, and, when testing, I find it occasionally useful to be able to say "please load this agent on the command line via the agentpath I gave you, rather than loading the one with the same name I baked into the launcher". >> >> (FWIW, when we did this internally at Google, we added a special -XX flag for when the agent is in the launcher. I know that you don't want to go that way, though.) >> > Thanks for the comments. I would say the thinking here is that we want this to be as transparent as possible to the end user. In our view of the end user is someone perhaps using an IDE and the actual execution of the VM with agent arguments is hidden. In your case it sounds like you are actually developing agents which is a whole different ball game. I could certainly see adding a -XX argument that forces agentpath to load the external library which would be good for agent development and debugging. No need to relink the entire VM with the new agent. Our tech lead is out on vacation this week so I'll bring this up when he's back. > > bill > >> >> On Wed, Jul 3, 2013 at 2:17 PM, BILL PITTORE > wrote: >> >> These changes address bug 8014135 which adds support for >> statically linked agents in the VM. This is a followup to the >> recent JNI spec changes that addressed statically linked JNI >> libraries( 8005716). >> The JEP for this change is the same JEP as the JNI changes: >> http://openjdk.java.net/jeps/178 >> >> Webrevs are here: >> >> http://cr.openjdk.java.net/~bpittore/8014135/jdk/webrev.00/ >> >> http://cr.openjdk.java.net/~bpittore/8014135/hotspot/webrev.00/ >> >> >> The changes to jvmti.xml can also be seen in the output file that >> I placed here: >> http://cr.openjdk.java.net/~bpittore/8014135/hotspot/webrev.00/jvmti.html >> >> >> Thanks, >> bill >> >> >> > From joe.darcy at oracle.com Tue Jul 16 23:14:19 2013 From: joe.darcy at oracle.com (Joe Darcy) Date: Tue, 16 Jul 2013 16:14:19 -0700 Subject: Java 8 RFR 8020641: Clean up some code style in recent BigInteger contributions In-Reply-To: <868A0266-E04D-440F-80A1-3134B47D79CF@oracle.com> References: <868A0266-E04D-440F-80A1-3134B47D79CF@oracle.com> Message-ID: <51E5D3CB.7040105@oracle.com> On 07/16/2013 02:32 PM, Brian Burkhalter wrote: > Reviewers: > > Issue http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8020641 (will be public soon) > Webrev http://cr.openjdk.java.net/~bpb/8020641/ > > Note that this patch will need to be integrated after the one for 8014319 which is pending approval [1]. > > Thanks, > > Brian > > [1] http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-July/018922.html Hi Brian, I've looked over all the code in BigInteger for general consistency of braces, spacing, etc. Besides the changes you're made, here are additional updates to BigInteger: 373 // Skip leading zeros and compute number of digits in magnitude 374 while (cursor < len && 375 Character.digit(val.charAt(cursor), radix) == 0) 376 cursor++; Given the nearby code, I think line 376 should be surrounded by {}. In the following locations, I recommend whitespace around "<", ">=", "<", and "==", respectively. 635 for (int i=0; i=0; i--) { 948 for (int i=0; i0 && z.equals(ONE) || ++j==a) 1484 for (int j=ystart, k=ystart+1+xstart; j>=0; j--, k--) { 1494 for (int j=ystart, k=ystart+1+i; j>=0; j--, k--) { 1707 for (int i=len-1; i>=0; i--) { 1840 for (int j=0, i=0; j0; i--, offset+=2) { 2153 if ((workingExponent & 1)==1) { 2167 if (signum<0 && (exponent&1)==1) { 2249 for (int i=0, c=a[i], m=i+len-1; i=0; i--) { 3655 for (int i=1; i>=0; i--) 3927 for (int i=result.length-1; i>=0; i--) { 3944 for (keep=0; keep 0) { 2089 if (signum<0 && (exponent&1)==1) { 2635 while(c>0) The texts below should be in standard block comment format. 1614 /* The algorithm requires two divisions by 2 and one by 3. 1615 All divisions are known to be exact, that is, they do not produce 1616 remainders, and all results are positive. The divisions by 2 are 1617 implemented as right shifts which are relatively efficient, leaving 1618 only an exact division by 3, which is done by a specialized 1619 linear-time algorithm. */ 1914 /* The algorithm requires two divisions by 2 and one by 3. 1915 All divisions are known to be exact, that is, they do not produce 1916 remainders, and all results are positive. The divisions by 2 are 1917 implemented as right shifts which are relatively efficient, leaving 1918 only a division by 3. 1919 The division by 3 is done by an optimized algorithm for this case. 1920 */ Please take an analogous pass over MutableBigInteger. Thanks, -Joe From brian.burkhalter at oracle.com Tue Jul 16 23:18:57 2013 From: brian.burkhalter at oracle.com (Brian Burkhalter) Date: Tue, 16 Jul 2013 16:18:57 -0700 Subject: Java 8 RFR 8020641: Clean up some code style in recent BigInteger contributions In-Reply-To: <51E5D3CB.7040105@oracle.com> References: <868A0266-E04D-440F-80A1-3134B47D79CF@oracle.com> <51E5D3CB.7040105@oracle.com> Message-ID: Hi Joe, On Jul 16, 2013, at 4:14 PM, Joe Darcy wrote: > I've looked over all the code in BigInteger for general consistency of braces, spacing, etc. > > Besides the changes you're made, here are additional updates to BigInteger: > > [?] Please note that I only reviewed the portions of the code which were touched by the recent contributions, not the entire class. > The texts below should be in standard block comment format. > > 1614 /* The algorithm requires two divisions by 2 and one by 3. > 1615 All divisions are known to be exact, that is, they do not produce > 1616 remainders, and all results are positive. The divisions by 2 are > 1617 implemented as right shifts which are relatively efficient, leaving > 1618 only an exact division by 3, which is done by a specialized > 1619 linear-time algorithm. */ > > 1914 /* The algorithm requires two divisions by 2 and one by 3. > 1915 All divisions are known to be exact, that is, they do not produce > 1916 remainders, and all results are positive. The divisions by 2 are > 1917 implemented as right shifts which are relatively efficient, leaving > 1918 only a division by 3. > 1919 The division by 3 is done by an optimized algorithm for this case. > 1920 */ This I missed. > Please take an analogous pass over MutableBigInteger. OK Thanks, Brian From brian.burkhalter at oracle.com Wed Jul 17 00:42:49 2013 From: brian.burkhalter at oracle.com (Brian Burkhalter) Date: Tue, 16 Jul 2013 17:42:49 -0700 Subject: Java 8 RFR 8020641: Clean up some code style in recent BigInteger contributions In-Reply-To: <51E5D3CB.7040105@oracle.com> References: <868A0266-E04D-440F-80A1-3134B47D79CF@oracle.com> <51E5D3CB.7040105@oracle.com> Message-ID: <975524C6-8694-4877-936C-F7B00A4A2F6A@oracle.com> Hi Joe, On Jul 16, 2013, at 4:14 PM, Joe Darcy wrote: > I've looked over all the code in BigInteger for general consistency of braces, spacing, etc. > > Besides the changes you're made, here are additional updates to BigInteger: I fixed all the items you pointed out along with a slew of others I found thanks to grep. > Please take an analogous pass over MutableBigInteger. Done. Webrev is updated http://cr.openjdk.java.net/~bpb/8020641/. As noted, this patch must follow the one for 8014319. (The present webrev is generated with the latter revision as base.) Thanks, Brian From joe.darcy at oracle.com Wed Jul 17 00:57:00 2013 From: joe.darcy at oracle.com (Joe Darcy) Date: Tue, 16 Jul 2013 17:57:00 -0700 Subject: Java 8 RFR 8020641: Clean up some code style in recent BigInteger contributions In-Reply-To: <975524C6-8694-4877-936C-F7B00A4A2F6A@oracle.com> References: <868A0266-E04D-440F-80A1-3134B47D79CF@oracle.com> <51E5D3CB.7040105@oracle.com> <975524C6-8694-4877-936C-F7B00A4A2F6A@oracle.com> Message-ID: <51E5EBDC.2070509@oracle.com> Hi Brian, Please reformat the BigInteger comment at 1915 /* The algorithm requires two divisions by 2 and one by 3. 1916 All divisions are known to be exact, that is, they do not produce 1917 remainders, and all results are positive. The divisions by 2 are 1918 implemented as right shifts which are relatively efficient, leaving 1919 only a division by 3. 1920 The division by 3 is done by an optimized algorithm for this case. 1921 */ In MutableBigInteger 1486 if(Integer.numberOfLeadingZeros(value[offset]) >= shift) { 1539 for(int j=0; j < limit-1; j++) { 1663 if(needRemainder) { still need an extra space. Otherwise, looks good. Thanks, -Joe On 07/16/2013 05:42 PM, Brian Burkhalter wrote: > Hi Joe, > > On Jul 16, 2013, at 4:14 PM, Joe Darcy wrote: > >> I've looked over all the code in BigInteger for general consistency >> of braces, spacing, etc. >> >> Besides the changes you're made, here are additional updates to >> BigInteger: > > I fixed all the items you pointed out along with a slew of others I > found thanks to grep. > >> Please take an analogous pass over MutableBigInteger. > > Done. > > Webrev is updated http://cr.openjdk.java.net/~bpb/8020641/ > . > > As noted, this patch must follow the one for 8014319. (The present > webrev is generated with the latter revision as base.) > > Thanks, > > Brian From brian.burkhalter at oracle.com Wed Jul 17 01:08:03 2013 From: brian.burkhalter at oracle.com (Brian Burkhalter) Date: Tue, 16 Jul 2013 18:08:03 -0700 Subject: Java 8 RFR 8020641: Clean up some code style in recent BigInteger contributions In-Reply-To: <51E5EBDC.2070509@oracle.com> References: <868A0266-E04D-440F-80A1-3134B47D79CF@oracle.com> <51E5D3CB.7040105@oracle.com> <975524C6-8694-4877-936C-F7B00A4A2F6A@oracle.com> <51E5EBDC.2070509@oracle.com> Message-ID: Hi Joe, I've updated the webrev http://cr.openjdk.java.net/~bpb/8020641/ with these last changes. I am not preparing an hg export patch until 8014319 is approved. Thanks, Brian On Jul 16, 2013, at 5:57 PM, Joe Darcy wrote: > Please reformat the BigInteger comment at > > 1915 /* The algorithm requires two divisions by 2 and one by 3. > 1916 All divisions are known to be exact, that is, they do not produce > 1917 remainders, and all results are positive. The divisions by 2 are > 1918 implemented as right shifts which are relatively efficient, leaving > 1919 only a division by 3. > 1920 The division by 3 is done by an optimized algorithm for this case. > 1921 */ > > In MutableBigInteger > > 1486 if(Integer.numberOfLeadingZeros(value[offset]) >= shift) { > 1539 for(int j=0; j < limit-1; j++) { > 1663 if(needRemainder) { > > still need an extra space. From rob.mckenna at oracle.com Wed Jul 17 04:44:49 2013 From: rob.mckenna at oracle.com (Rob McKenna) Date: Wed, 17 Jul 2013 05:44:49 +0100 Subject: Review request: JDK-7147084 (process) appA hangs when read output stream of appB which starts appC that runs forever (v.1) In-Reply-To: <51DE74D1.70607@oracle.com> References: <518A88B1.3060105@oracle.com> <5190FC54.8050808@oracle.com> <5194B0D8.2040607@oracle.com> <51D685E1.1080606@oracle.com> <51D6D139.40508@oracle.com> <51DE74D1.70607@oracle.com> Message-ID: <51E62141.4060402@oracle.com> Hi Alexey, I've just had a look at the webrev. Looks good. Unfortunately I'm not a reviewer here so the only benefit was for my education I'm afraid. It would be great to get Alan's input next week. For the benefit of the alias: I had asked Alexey if an intermediate launcher akin to the one described by MS and found in 5049299 would make sense. Alexey mentioned the cost of launching processes on windows was pretty high making this approach preferable. -Rob On 11/07/13 10:03, Alexey Utkin wrote: > Rob, > > Could you help me with bug review. It stay in review pool too long. > Nobody like to look into the native code. > > Here is the long problem & solution description: > https://jbs.oracle.com/bugs/browse/JDK-7147084?focusedCommentId=13322689&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13322689 > > > Discussion thread: > http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-May/016753.html > > Bug description: > https://jbs.oracle.com/bugs/browse/JDK-7147084 > http://bugs.sun.com/view_bug.do?bug_id=7147084 > > Here is the suggested fix: > http://cr.openjdk.java.net/~uta/openjdk-webrevs/JDK-7147084/webrev.01/ > > Summary for v1 changes: > > -- The set of handles that need to restore the inherit flag was extended > by child process IOE handles. That was done to avoid "greedy sibling" > problem for the file handles. The file handles are closed outside the > synchronized block. > -- "Greedy sibling" problem is covered by the > [test/java/lang/ProcessBuilder/SiblingIOEHandle.java] test. > -- The fact that the set of current process standard IOE handles and the > set of child process IOE handles can intersect was taken into account. > -- The [test/java/lang/ProcessBuilder/InheritIOEHandle.java] was changed > in accordance with Martin's concern. > > Regards, > -uta > > On 7/5/2013 5:59 PM, Alan Bateman wrote: >> On 05/07/2013 09:37, Alexey Utkin wrote: >>> Hi Alan, >>> >>> I know that your stack is overflowed, >>> that is just ping. >>> >>> Regards, >>> -uta >> Sorry Alexey, I just have not had time to fully digest this one and >> understand the performance/correctness trade-off. Also I've been >> desperately trying to get through a list of things before going on >> vacation this week (for 2 weeks). >> >> Rob - since you are interested in ProcessBuilder and Runtime.exec >> then could you take a pass over Alexey's change on core-libs-dev. >> This one fixes a long standing issue on Windows. I will get make time >> to help review when I get back. >> >> -Alan >> > From joe.darcy at oracle.com Wed Jul 17 06:26:40 2013 From: joe.darcy at oracle.com (Joe Darcy) Date: Tue, 16 Jul 2013 23:26:40 -0700 Subject: Java 8 RFR 8020641: Clean up some code style in recent BigInteger contributions In-Reply-To: References: <868A0266-E04D-440F-80A1-3134B47D79CF@oracle.com> <51E5D3CB.7040105@oracle.com> <975524C6-8694-4877-936C-F7B00A4A2F6A@oracle.com> <51E5EBDC.2070509@oracle.com> Message-ID: <51E63920.5070206@oracle.com> Hi Brian, This latest version looks good to go; thanks, -Joe On 07/16/2013 06:08 PM, Brian Burkhalter wrote: > Hi Joe, > > I've updated the webrev http://cr.openjdk.java.net/~bpb/8020641/ > with these last changes. > > I am not preparing an hg export patch until 8014319 is approved. > > Thanks, > > Brian > > On Jul 16, 2013, at 5:57 PM, Joe Darcy wrote: > >> Please reformat the BigInteger comment at >> >> 1915 /* The algorithm requires two divisions by 2 and one by 3. >> 1916 All divisions are known to be exact, that is, they do >> not produce >> 1917 remainders, and all results are positive. The >> divisions by 2 are >> 1918 implemented as right shifts which are relatively >> efficient, leaving >> 1919 only a division by 3. >> 1920 The division by 3 is done by an optimized algorithm >> for this case. >> 1921 */ >> >> In MutableBigInteger >> >> 1486 if(Integer.numberOfLeadingZeros(value[offset]) >= shift) { >> 1539 for(int j=0; j < limit-1; j++) { >> 1663 if(needRemainder) { >> >> still need an extra space. > From iris.clark at oracle.com Wed Jul 17 06:32:15 2013 From: iris.clark at oracle.com (Iris Clark) Date: Tue, 16 Jul 2013 23:32:15 -0700 (PDT) Subject: RFR: (JAXP) 8020430 : NullPointerException in xml sqe nightly result on 2013-07-12 In-Reply-To: <51E45684.2090105@oracle.com> References: <51DFC567.3070902@oracle.com> <88E5A207-A25D-48F3-AC68-941468821F1C@oracle.com> <51E03852.2020004@oracle.com> <0cbe7317-6647-46ca-aa69-14d23f634e42@default> <51E45684.2090105@oracle.com> Message-ID: <0769d669-c015-47b2-80df-58c279f9797d@default> I'm so thrilled this is happening! Thanks! iris -----Original Message----- From: huizhe wang Sent: Monday, July 15, 2013 1:08 PM To: Iris Clark Cc: Lance Andersen; Core-Libs-Dev Subject: Re: RFR: (JAXP) 8020430 : NullPointerException in xml sqe nightly result on 2013-07-12 Yes, it just happened! SQE team has agreed and we'll start to plan on the migration! -Joe On 7/12/2013 4:57 PM, Iris Clark wrote: > FWIW, I really like the idea of migrating the jaxp tests to the jaxp repo. I've always thought it odd that the code change and the test for it aren't in the same changeset. > > Thanks, > iris > > -----Original Message----- > From: huizhe wang > Sent: Friday, July 12, 2013 10:10 AM > To: Lance Andersen - Oracle > Cc: Core-Libs-Dev > Subject: Re: RFR: (JAXP) 8020430 : NullPointerException in xml sqe > nightly result on 2013-07-12 > > > On 7/12/2013 3:30 AM, Lance Andersen - Oracle wrote: >> The fix looks fine to me Joe as does the test. I assume you will go with Chris's plan below for the test locations? > It will be jdk/test/javax/xml/jaxp, that is the location for all jaxp tests for now. We will look into migrating jaxp tests to the jaxp repo. > > Thanks, > Joe > >> Best >> Lance >> On Jul 12, 2013, at 5:44 AM, Chris Hegarty wrote: >> >>> The source changes look fine to me. >>> >>> The tests should be located elsewhere, otherwise they will collide with an Oracle internal repo. Say jdk/test/jaxp? >>> >>> As an aside, I plan to move the jaxws tests to a similar holding area, jdk/test/jaxws. They can then follow the appropriate package structure. >>> >>> -Chris >>> >>> On 12 Jul 2013, at 09:59, huizhe wang wrote: >>> >>>> Hi, >>>> >>>> This is a quick fix on a regression caused by 8016648. The new property manager added to handle the new jaxp 1.5 properties is only created for the input and event factories. For the output factory therefore, there should have a null-check. I've run the tests used in the nightly build with a local build, all passed with this patch. >>>> >>>> webrev: >>>> http://cr.openjdk.java.net/~joehw/jdk8/8020430/webrev/ >>>> >>>> Thanks, >>>> Joe >> >> Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 >> Oracle Java Engineering >> 1 Network Drive >> Burlington, MA 01803 >> Lance.Andersen at oracle.com >> From maurizio.cimadamore at oracle.com Wed Jul 17 14:28:47 2013 From: maurizio.cimadamore at oracle.com (maurizio.cimadamore at oracle.com) Date: Wed, 17 Jul 2013 14:28:47 +0000 Subject: hg: jdk8/tl/langtools: 10 new changesets Message-ID: <20130717142920.800FD48153@hg.openjdk.java.net> Changeset: 44e27378f523 Author: mcimadamore Date: 2013-07-17 14:04 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/44e27378f523 8012242: Lambda compatibility and checked exceptions Summary: Inference variables in 'throws' clause with no constraints should be inferred as RuntimeException Reviewed-by: jjg, vromero ! src/share/classes/com/sun/tools/javac/code/Flags.java ! src/share/classes/com/sun/tools/javac/comp/Infer.java ! src/share/classes/com/sun/tools/javac/comp/MemberEnter.java ! test/tools/javac/generics/6723444/T6723444.java - test/tools/javac/generics/6723444/T6723444.out + test/tools/javac/generics/6723444/T6723444_1.out + test/tools/javac/generics/6723444/T6723444_2.out ! test/tools/javac/generics/7015430/T7015430.java - test/tools/javac/generics/7015430/T7015430.out + test/tools/javac/generics/7015430/T7015430_1.out + test/tools/javac/generics/7015430/T7015430_2.out + test/tools/javac/lambda/TargetType63.java + test/tools/javac/lambda/TargetType63.out Changeset: 866c87c01285 Author: mcimadamore Date: 2013-07-17 14:09 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/866c87c01285 8016175: Add bottom-up type-checking support for unambiguous method references Summary: Type-checking of non-overloaded method references should be independent from target-type Reviewed-by: jjg, vromero ! src/share/classes/com/sun/tools/javac/comp/Attr.java ! src/share/classes/com/sun/tools/javac/comp/DeferredAttr.java ! src/share/classes/com/sun/tools/javac/comp/Infer.java ! src/share/classes/com/sun/tools/javac/comp/Resolve.java + test/tools/javac/lambda/MethodReference68.java + test/tools/javac/lambda/MethodReference68.out + test/tools/javac/lambda/MethodReference69.java + test/tools/javac/lambda/MethodReference69.out + test/tools/javac/lambda/MethodReference70.java + test/tools/javac/lambda/MethodReference70.out + test/tools/javac/lambda/MethodReference71.java + test/tools/javac/lambda/MethodReference71.out + test/tools/javac/lambda/MethodReference72.java + test/tools/javac/lambda/MethodReference72.out ! test/tools/javac/lambda/TargetType60.out + test/tools/javac/lambda/TargetType76.java Changeset: a204cf7aab7e Author: mcimadamore Date: 2013-07-17 14:11 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/a204cf7aab7e 8012238: Nested method capture and inference 8008200: java/lang/Class/asSubclass/BasicUnit.java fails to compile Summary: Inference support should be more flexible w.r.t. nested method calls returning captured types Reviewed-by: jjg, vromero ! src/share/classes/com/sun/tools/javac/code/Type.java ! src/share/classes/com/sun/tools/javac/comp/Attr.java ! src/share/classes/com/sun/tools/javac/comp/Infer.java ! src/share/classes/com/sun/tools/javac/comp/Resolve.java + test/tools/javac/lambda/NestedCapture01.java + test/tools/javac/lambda/NestedCapture02.java + test/tools/javac/lambda/NestedCapture03.java Changeset: c60a5099863a Author: mcimadamore Date: 2013-07-17 14:13 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/c60a5099863a 8020147: Spurious errors when compiling nested stuck lambdas Summary: Scope of deferred types is not copied correctly; postAttr analyzer should not run on stuck expressions Reviewed-by: jjg ! src/share/classes/com/sun/tools/javac/comp/Attr.java ! src/share/classes/com/sun/tools/javac/comp/DeferredAttr.java ! src/share/classes/com/sun/tools/javac/comp/Flow.java + test/tools/javac/lambda/8020147/T8020147.java + test/tools/javac/lambda/8020147/T8020147.out Changeset: 328896931b98 Author: mcimadamore Date: 2013-07-17 14:14 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/328896931b98 8020286: Wrong diagnostic after compaction Summary: compact diagnostic shows the least relevant method in the list Reviewed-by: jjg ! src/share/classes/com/sun/tools/javac/comp/Resolve.java + test/tools/javac/Diagnostics/compressed/T8020286.java + test/tools/javac/Diagnostics/compressed/T8020286.out Changeset: db2c539819dd Author: mcimadamore Date: 2013-07-17 14:14 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/db2c539819dd 7041019: Bogus type-variable substitution with array types with dependencies on accessibility check Summary: call to upperBound() when performing type-variable substitution on element type leads to unsoundness Reviewed-by: jjg ! src/share/classes/com/sun/tools/javac/code/Types.java ! src/share/classes/com/sun/tools/javac/comp/Resolve.java ! test/tools/javac/generics/7034511/T7034511a.java ! test/tools/javac/generics/7034511/T7034511a.out ! test/tools/javac/generics/7034511/T7034511b.java ! test/tools/javac/generics/7034511/T7034511b.out + test/tools/javac/generics/7034511/T7041019.java Changeset: fae8f309ff80 Author: mcimadamore Date: 2013-07-17 14:16 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/fae8f309ff80 8016640: compiler hangs if the generics arity of a base class is wrong Summary: Check.checkCompatibleConcretes hang when javac creates synthetic supertypes for 269 model API Reviewed-by: jjg ! src/share/classes/com/sun/tools/javac/code/Types.java ! src/share/classes/com/sun/tools/javadoc/ClassDocImpl.java + test/tools/javac/generics/8016640/T8016640.java + test/tools/javac/generics/8016640/T8016640.out Changeset: 155809b1b969 Author: mcimadamore Date: 2013-07-17 14:19 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/155809b1b969 8020149: Graph inference: wrong logic for picking best variable to solve Summary: Replace logic for selecting best inference leaf in the graph during an unsticking round Reviewed-by: jjg ! src/share/classes/com/sun/tools/javac/comp/Infer.java + test/tools/javac/generics/inference/8020149/T8020149.java Changeset: b577222ef7b3 Author: mcimadamore Date: 2013-07-17 14:19 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/b577222ef7b3 8019340: varargs-related warnings are meaningless on signature-polymorphic methods such as MethodHandle.invokeExact Summary: Disable certain varargs warnings when compiling polymorphic signature calls Reviewed-by: jjg ! src/share/classes/com/sun/tools/javac/comp/Check.java + test/tools/javac/meth/VarargsWarn.java + test/tools/javac/meth/VarargsWarn.out Changeset: f65a807714ba Author: mcimadamore Date: 2013-07-17 14:21 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/f65a807714ba 8019942: Graph inference: avoid redundant computation during bound incorporation Summary: Bound incorporation should not perform same operation multiple times Reviewed-by: jjg ! src/share/classes/com/sun/tools/javac/code/Type.java ! src/share/classes/com/sun/tools/javac/comp/Infer.java ! test/tools/javac/generics/inference/8019824/T8019824.out From maurizio.cimadamore at oracle.com Wed Jul 17 14:46:04 2013 From: maurizio.cimadamore at oracle.com (maurizio.cimadamore at oracle.com) Date: Wed, 17 Jul 2013 14:46:04 +0000 Subject: hg: jdk8/tl/langtools: 8020586: Warning produced for an incorrect file Message-ID: <20130717144608.EDAB948154@hg.openjdk.java.net> Changeset: 10711bd8bb2d Author: jlahoda Date: 2013-07-17 15:08 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/10711bd8bb2d 8020586: Warning produced for an incorrect file Summary: Always using DeferredLintHandler.immediateHandler when processing import classes Reviewed-by: mcimadamore ! src/share/classes/com/sun/tools/javac/comp/MemberEnter.java + test/tools/javac/warnings/6594914/Auxiliary.java + test/tools/javac/warnings/6594914/ExplicitCompilation.out + test/tools/javac/warnings/6594914/ImplicitCompilation.java + test/tools/javac/warnings/6594914/ImplicitCompilation.out From alexey.utkin at oracle.com Wed Jul 17 15:28:37 2013 From: alexey.utkin at oracle.com (Alexey Utkin) Date: Wed, 17 Jul 2013 19:28:37 +0400 Subject: Review request: JDK-8016579 (process) IOException thrown by ProcessBuilder.start() method is incorrectly encoded (v.3) In-Reply-To: <51E59A0D.7050506@oracle.com> References: <51E3C3AE.1020406@oracle.com> <51E56F0F.9010106@oracle.com> <51E59A0D.7050506@oracle.com> Message-ID: <51E6B825.2050006@oracle.com> Thanks, Here is new version with Dan's correction: http://cr.openjdk.java.net/~uta/openjdk-webrevs/JDK-8016579/webrev.02/ Regards, -uta On 7/16/2013 11:07 PM, Dan Xu wrote: > I agree. Is jdk_util.c or jni_util.c or any file under native/common/ > a good place? > > The fix looks good to me. > > One small comment is to get the return value of swprintf() in > win32Error(). If the return value is -1, an error situation needs to > be handled even though it seems very rare. If it is not -1, then get > the actual length of utf16_javaMessage. And pass the length of > utf16_javaMessage to WideCharToMultiByte() instead of MESSAGE_LENGTH > to make the code more efficient. Thanks! Accepted. > > -Dan > > > > > On 07/16/2013 10:49 AM, Martin Buchholz wrote: >> Looks OK to me. As ever, we continue to not have good places within >> the JDK itself for C-level infrastructure - win32Error is not >> specific to the process api, and should really be pulled into some >> common directory - but I don't know of any such. >> >> >> On Tue, Jul 16, 2013 at 9:04 AM, Alexey Utkin >> > wrote: >> >> Here is new version of fix: >> http://cr.openjdk.java.net/~uta/openjdk-webrevs/JDK-8016579/webrev.01/ >> >> >> On 7/15/2013 9:08 PM, Martin Buchholz wrote: >>> Superficial review: >>> >>> Looks good mostly. >>> >>> Historically, switching windows code to use "W" APIs has been a >>> big TODO, but was waiting for Win98 de-support. >> In java.lang we have passed the half-way: the error reporting >> sub-system is in the ASCII world. >>> >>> Please spell correctly: >>> MESAGE_LENGTH >> Thanks, I missed it. Fixed. >>> >>> If errno and GetLastError are two separate error notification >>> systems, how do you know which one corresponded to the last >>> failure? E.g. if the last failure only set errno, won't the >>> error message be via GetLastError(), which is likely to be stale? >> As Dan mentioned, the os_lasterror was a copy of JVM >> os::lasterror call. >> The error message procedure is used for >> CreatePipe >> CreateProcessW >> GetExitCodeProcess >> WaitForMultipleObjects >> fail report. You are right, all the calls return the problem by >> GetLastMessage call. >> The function is changed (reduced). >> >> Here is new version of fix: >> http://cr.openjdk.java.net/~uta/openjdk-webrevs/JDK-8016579/webrev.01/ >> >> >> Regards, >> -uta >> >>> >>> >>> >>> On Mon, Jul 15, 2013 at 2:41 AM, Alexey Utkin >>> > wrote: >>> >>> Bug description: >>> https://jbs.oracle.com/bugs/browse/JDK-8016579 >>> http://bugs.sun.com/view_bug.do?bug_id=8016579 >>> >>> Here is the suggested fix: >>> http://cr.openjdk.java.net/~uta/openjdk-webrevs/JDK-8016579/webrev.00/ >>> >>> >>> Summary: >>> We have THREE locales in action: >>> 1. Thread default locale - dictates UNICODE-to-8bit conversion >>> 2. OS locale that defines the message localization >>> 3. The file name locale >>> >>> Each locale could be an extended locale, that means that >>> text cannot be mapped to 8bit sequence without multibyte >>> encoding. VM is ready for that, if text is UTF-8. >>> The suggested fix does the work right from the beginning. >>> >>> Unicode version of JVM call: >>> hotspot/src/os/windows/vm/os_windows.cpp: >>> size_t os::lasterror(char* buf, size_t len) >>> was used as prototype for Unicode error message getter. It >>> has to be fixed accordingly as well as >>> jdk/src/windows/native/java/io/io_util_md.c >>> size_t getLastErrorString(char *buf, size_t len) >>> >>> The bug contains the attachment >>> https://jbs.oracle.com/bugs/secure/attachment/14581/JDK-8016579.txt >>> that summarize the fix result in comparison with original >>> implementation. >>> >>> Regards, >>> -uta >>> >>> >> >> > From mike.duigou at oracle.com Wed Jul 17 18:03:27 2013 From: mike.duigou at oracle.com (Mike Duigou) Date: Wed, 17 Jul 2013 11:03:27 -0700 Subject: RFR 8020292 :Re: class SplittableRandom In-Reply-To: References: <51DDB26D.8050506@cs.oswego.edu> <51E037D7.3040305@cs.oswego.edu> <7B80D649-A0D5-426D-A341-41ED818126C3@oracle.com> Message-ID: <24262E7B-3C53-42EF-ACE6-4027C8AF6253@oracle.com> Hello all; Paul is on vacation (well deserved) and Doug/Guy/others have been continuing to work on SplittableRandom. As the code is continuing to evolve quickly I won't immediately post an update to this list but encourage those interested to follow along with updates either in the lambda repo: http://hg.openjdk.java.net/lambda/lambda/jdk/log/tip/src/share/classes/java/util/SplittableRandom.java or in the JSR-166 CVS: http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/src/main/java/util/SplittableRandom.java?view=log Once the API and implementation settles a bit I will restart the corelibs RFR. (Don't feel you have to wait to comment though....) Thanks, Mike On Jul 12 2013, at 10:44 , Paul Sandoz wrote: > > On Jul 12, 2013, at 7:26 PM, Paul Sandoz wrote: > >> Hi, >> >> Thanks Doug. >> >> Here is the webrev: >> >> http://cr.openjdk.java.net/~psandoz/tl/JDK-8020292-splittable-random/webrev/ >> > > In my haste i forgot to mention this patch is based off: > > http://cr.openjdk.java.net/~psandoz/tl/JDK-8019395-StreamSupport/webrev/ > > Which stands a good chance of being pushed to tl today. > > Paul. From dan.xu at oracle.com Wed Jul 17 18:29:24 2013 From: dan.xu at oracle.com (Dan Xu) Date: Wed, 17 Jul 2013 11:29:24 -0700 Subject: Review request: JDK-8016579 (process) IOException thrown by ProcessBuilder.start() method is incorrectly encoded (v.3) In-Reply-To: <51E6B825.2050006@oracle.com> References: <51E3C3AE.1020406@oracle.com> <51E56F0F.9010106@oracle.com> <51E59A0D.7050506@oracle.com> <51E6B825.2050006@oracle.com> Message-ID: <51E6E284.1080601@oracle.com> I don't know the difference between (*env)->NewStringUTF(env, buf) and JNU_NewStringPlatform(env, buf). Does the JNU_NewStringPlatform() function currently fail to process non-western locale? According to the code, JNU_NewStringPlatform() is also trying to use the right encoding for the give string. Other changes look good to me. Thanks for fixing getLastErrorString function in io_util_md.c file. -Dan On 07/17/2013 08:28 AM, Alexey Utkin wrote: > Thanks, > > Here is new version with Dan's correction: > http://cr.openjdk.java.net/~uta/openjdk-webrevs/JDK-8016579/webrev.02/ > > Regards, > -uta > > > On 7/16/2013 11:07 PM, Dan Xu wrote: >> I agree. Is jdk_util.c or jni_util.c or any file under native/common/ >> a good place? >> >> The fix looks good to me. >> >> One small comment is to get the return value of swprintf() in >> win32Error(). If the return value is -1, an error situation needs to >> be handled even though it seems very rare. If it is not -1, then get >> the actual length of utf16_javaMessage. And pass the length of >> utf16_javaMessage to WideCharToMultiByte() instead of MESSAGE_LENGTH >> to make the code more efficient. Thanks! > Accepted. >> >> -Dan >> >> >> >> >> On 07/16/2013 10:49 AM, Martin Buchholz wrote: >>> Looks OK to me. As ever, we continue to not have good places within >>> the JDK itself for C-level infrastructure - win32Error is not >>> specific to the process api, and should really be pulled into some >>> common directory - but I don't know of any such. >>> >>> >>> On Tue, Jul 16, 2013 at 9:04 AM, Alexey Utkin >>> > wrote: >>> >>> Here is new version of fix: >>> http://cr.openjdk.java.net/~uta/openjdk-webrevs/JDK-8016579/webrev.01/ >>> >>> >>> On 7/15/2013 9:08 PM, Martin Buchholz wrote: >>>> Superficial review: >>>> >>>> Looks good mostly. >>>> >>>> Historically, switching windows code to use "W" APIs has been a >>>> big TODO, but was waiting for Win98 de-support. >>> In java.lang we have passed the half-way: the error reporting >>> sub-system is in the ASCII world. >>>> >>>> Please spell correctly: >>>> MESAGE_LENGTH >>> Thanks, I missed it. Fixed. >>>> >>>> If errno and GetLastError are two separate error notification >>>> systems, how do you know which one corresponded to the last >>>> failure? E.g. if the last failure only set errno, won't the >>>> error message be via GetLastError(), which is likely to be stale? >>> As Dan mentioned, the os_lasterror was a copy of JVM >>> os::lasterror call. >>> The error message procedure is used for >>> CreatePipe >>> CreateProcessW >>> GetExitCodeProcess >>> WaitForMultipleObjects >>> fail report. You are right, all the calls return the problem by >>> GetLastMessage call. >>> The function is changed (reduced). >>> >>> Here is new version of fix: >>> http://cr.openjdk.java.net/~uta/openjdk-webrevs/JDK-8016579/webrev.01/ >>> >>> >>> Regards, >>> -uta >>> >>>> >>>> >>>> >>>> On Mon, Jul 15, 2013 at 2:41 AM, Alexey Utkin >>>> > wrote: >>>> >>>> Bug description: >>>> https://jbs.oracle.com/bugs/browse/JDK-8016579 >>>> http://bugs.sun.com/view_bug.do?bug_id=8016579 >>>> >>>> Here is the suggested fix: >>>> http://cr.openjdk.java.net/~uta/openjdk-webrevs/JDK-8016579/webrev.00/ >>>> >>>> >>>> Summary: >>>> We have THREE locales in action: >>>> 1. Thread default locale - dictates UNICODE-to-8bit conversion >>>> 2. OS locale that defines the message localization >>>> 3. The file name locale >>>> >>>> Each locale could be an extended locale, that means that >>>> text cannot be mapped to 8bit sequence without multibyte >>>> encoding. VM is ready for that, if text is UTF-8. >>>> The suggested fix does the work right from the beginning. >>>> >>>> Unicode version of JVM call: >>>> hotspot/src/os/windows/vm/os_windows.cpp: >>>> size_t os::lasterror(char* buf, size_t len) >>>> was used as prototype for Unicode error message getter. It >>>> has to be fixed accordingly as well as >>>> jdk/src/windows/native/java/io/io_util_md.c >>>> size_t getLastErrorString(char *buf, size_t len) >>>> >>>> The bug contains the attachment >>>> https://jbs.oracle.com/bugs/secure/attachment/14581/JDK-8016579.txt >>>> that summarize the fix result in comparison with original >>>> implementation. >>>> >>>> Regards, >>>> -uta >>>> >>>> >>> >>> >> > From lana.steuck at oracle.com Wed Jul 17 19:01:57 2013 From: lana.steuck at oracle.com (lana.steuck at oracle.com) Date: Wed, 17 Jul 2013 19:01:57 +0000 Subject: hg: jdk8/tl/jaxws: Added tag jdk8-b98 for changeset b1fb4612a2ca Message-ID: <20130717190204.104B048166@hg.openjdk.java.net> Changeset: 8ef83d4b23c9 Author: katleman Date: 2013-07-11 10:13 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jaxws/rev/8ef83d4b23c9 Added tag jdk8-b98 for changeset b1fb4612a2ca ! .hgtags From lana.steuck at oracle.com Wed Jul 17 19:01:55 2013 From: lana.steuck at oracle.com (lana.steuck at oracle.com) Date: Wed, 17 Jul 2013 19:01:55 +0000 Subject: hg: jdk8/tl: 2 new changesets Message-ID: <20130717190156.42B3148163@hg.openjdk.java.net> Changeset: 0d0c983a817b Author: tbell Date: 2013-07-09 08:35 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/rev/0d0c983a817b 8009315: F# on PATH breaks Cygwin tools (mkdir, echo, mktemp ...) Reviewed-by: erikj ! common/autoconf/generated-configure.sh ! common/autoconf/toolchain_windows.m4 Changeset: 59dc9da81379 Author: katleman Date: 2013-07-11 10:13 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/rev/59dc9da81379 Added tag jdk8-b98 for changeset 0d0c983a817b ! .hgtags From lana.steuck at oracle.com Wed Jul 17 19:01:57 2013 From: lana.steuck at oracle.com (lana.steuck at oracle.com) Date: Wed, 17 Jul 2013 19:01:57 +0000 Subject: hg: jdk8/tl/nashorn: 2 new changesets Message-ID: <20130717190203.3C39348165@hg.openjdk.java.net> Changeset: 10a1ab9e20a4 Author: katleman Date: 2013-07-11 10:13 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/10a1ab9e20a4 Added tag jdk8-b98 for changeset 542b7803f038 ! .hgtags Changeset: 81cbb18d558a Author: lana Date: 2013-07-17 00:36 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/81cbb18d558a Merge From lana.steuck at oracle.com Wed Jul 17 19:02:09 2013 From: lana.steuck at oracle.com (lana.steuck at oracle.com) Date: Wed, 17 Jul 2013 19:02:09 +0000 Subject: hg: jdk8/tl/jdk: 5 new changesets Message-ID: <20130717190344.40F0348169@hg.openjdk.java.net> Changeset: 2c26ccf0a85b Author: tbell Date: 2013-07-08 07:20 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/2c26ccf0a85b 8012925: [parfait] Missing return value in jdk/src/macosx/native/sun/awt/AWTEvent.m Reviewed-by: katleman, leonidr Contributed-by: petr.pchelko at oracle.com ! src/macosx/native/sun/awt/AWTEvent.m Changeset: c4908732fef5 Author: katleman Date: 2013-07-08 14:29 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/c4908732fef5 Merge Changeset: 758c21301545 Author: katleman Date: 2013-07-11 10:13 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/758c21301545 Added tag jdk8-b98 for changeset c4908732fef5 ! .hgtags Changeset: f83794805201 Author: mcimadamore Date: 2013-07-11 14:02 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/f83794805201 8016281: The SAM method should be passed to the metafactory as a MethodType not a MethodHandle 8020010: Move lambda bridge creation from metafactory and VM to compiler Summary: JDK/metafactory component of the bridge fix and and MethodType vs. MethodHandle changes. Reviewed-by: twisti, briangoetz, forax Contributed-by: robert.field at oracle.com ! src/share/classes/java/lang/invoke/AbstractValidatingLambdaMetafactory.java ! src/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java ! src/share/classes/java/lang/invoke/LambdaMetafactory.java ! src/share/classes/java/lang/invoke/SerializedLambda.java Changeset: cbdd2529d93a Author: lana Date: 2013-07-17 00:34 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/cbdd2529d93a Merge From lana.steuck at oracle.com Wed Jul 17 19:01:54 2013 From: lana.steuck at oracle.com (lana.steuck at oracle.com) Date: Wed, 17 Jul 2013 19:01:54 +0000 Subject: hg: jdk8/tl/corba: Added tag jdk8-b98 for changeset 3370fb6146e4 Message-ID: <20130717190158.9338448164@hg.openjdk.java.net> Changeset: 3f67804ab613 Author: katleman Date: 2013-07-11 10:13 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/corba/rev/3f67804ab613 Added tag jdk8-b98 for changeset 3370fb6146e4 ! .hgtags From lana.steuck at oracle.com Wed Jul 17 19:02:06 2013 From: lana.steuck at oracle.com (lana.steuck at oracle.com) Date: Wed, 17 Jul 2013 19:02:06 +0000 Subject: hg: jdk8/tl/langtools: 3 new changesets Message-ID: <20130717190220.0D7F948168@hg.openjdk.java.net> Changeset: bdeef606be8e Author: katleman Date: 2013-07-11 10:13 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/bdeef606be8e Added tag jdk8-b98 for changeset ce5a90df517b ! .hgtags Changeset: 39ec5d8a691b Author: mcimadamore Date: 2013-07-11 14:07 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/39ec5d8a691b 8016281: The SAM method should be passed to the metafactory as a MethodType not a MethodHandle 8020010: Move lambda bridge creation from metafactory and VM to compiler Summary: langtools/javac component of the bridge support and MethodType vs. MethodHandle changes. Reviewed-by: jjg, vromero, briangoetz, forax Contributed-by: robert.field at oracle.com ! src/share/classes/com/sun/tools/javac/code/Types.java ! src/share/classes/com/sun/tools/javac/comp/Attr.java ! src/share/classes/com/sun/tools/javac/comp/Check.java ! src/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java ! src/share/classes/com/sun/tools/javac/comp/TransTypes.java ! src/share/classes/com/sun/tools/javac/tree/JCTree.java ! src/share/classes/com/sun/tools/javac/util/Names.java + test/tools/javac/generics/bridges/Bridge.java + test/tools/javac/generics/bridges/BridgeHarness.java + test/tools/javac/generics/bridges/Bridges.java + test/tools/javac/generics/bridges/tests/TestBridgeWithDefault.java + test/tools/javac/generics/bridges/tests/TestClassAndInterfaceBridgeIdentical01.java + test/tools/javac/generics/bridges/tests/TestClassAndInterfaceBridgeIdentical02.java + test/tools/javac/generics/bridges/tests/TestNoBridgeInSiblingsSuper.java + test/tools/javac/generics/bridges/tests/TestNoDuplicateBridges01.java + test/tools/javac/generics/bridges/tests/TestNoDuplicateBridges02.java + test/tools/javac/lambda/bridge/TestMetafactoryBridges.java ! test/tools/javac/lambda/lambdaExpression/LambdaTest6.java ! test/tools/javac/lambda/methodReference/BridgeMethod.java ! test/tools/javac/lambdaShapes/org/openjdk/tests/vm/DefaultMethodsTest.java Changeset: e990e6bcecbe Author: lana Date: 2013-07-17 10:40 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/e990e6bcecbe Merge ! src/share/classes/com/sun/tools/javac/code/Types.java ! src/share/classes/com/sun/tools/javac/comp/Attr.java ! src/share/classes/com/sun/tools/javac/comp/Check.java From lana.steuck at oracle.com Wed Jul 17 19:02:29 2013 From: lana.steuck at oracle.com (lana.steuck at oracle.com) Date: Wed, 17 Jul 2013 19:02:29 +0000 Subject: hg: jdk8/tl/hotspot: 69 new changesets Message-ID: <20130717190504.8CA854816A@hg.openjdk.java.net> Changeset: 8c4424890028 Author: amurillo Date: 2013-06-28 02:33 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/8c4424890028 8019302: new hotspot build - hs25-b40 Reviewed-by: jcoomes ! make/hotspot_version Changeset: 8cff1de240de Author: zgu Date: 2013-06-25 17:22 -0400 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/8cff1de240de 8017478: Kitchensink crashed with SIGSEGV in BaselineReporter::diff_callsites Summary: Fixed possible NULL pointer that caused SIGSEGV Reviewed-by: coleenp, acorn, ctornqvi ! src/share/vm/services/memReporter.cpp Changeset: c14867f95c60 Author: zgu Date: 2013-06-25 14:51 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/c14867f95c60 Merge Changeset: 38ea2efa32a7 Author: kevinw Date: 2013-06-26 00:01 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/38ea2efa32a7 8010278: SA: provide mechanism for using an alternative SA debugger back-end. Reviewed-by: sla, dsamersoff ! agent/src/share/classes/sun/jvm/hotspot/CLHSDB.java ! agent/src/share/classes/sun/jvm/hotspot/CommandProcessor.java ! agent/src/share/classes/sun/jvm/hotspot/HSDB.java ! agent/src/share/classes/sun/jvm/hotspot/HotSpotAgent.java ! agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxAddress.java ! agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxOopHandle.java ! agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java ! agent/src/share/classes/sun/jvm/hotspot/tools/ClassLoaderStats.java ! agent/src/share/classes/sun/jvm/hotspot/tools/FinalizerInfo.java ! agent/src/share/classes/sun/jvm/hotspot/tools/FlagDumper.java ! agent/src/share/classes/sun/jvm/hotspot/tools/HeapDumper.java ! agent/src/share/classes/sun/jvm/hotspot/tools/HeapSummary.java ! agent/src/share/classes/sun/jvm/hotspot/tools/JInfo.java ! agent/src/share/classes/sun/jvm/hotspot/tools/JMap.java ! agent/src/share/classes/sun/jvm/hotspot/tools/JSnap.java ! agent/src/share/classes/sun/jvm/hotspot/tools/JStack.java ! agent/src/share/classes/sun/jvm/hotspot/tools/ObjectHistogram.java ! agent/src/share/classes/sun/jvm/hotspot/tools/PMap.java ! agent/src/share/classes/sun/jvm/hotspot/tools/PStack.java ! agent/src/share/classes/sun/jvm/hotspot/tools/StackTrace.java ! agent/src/share/classes/sun/jvm/hotspot/tools/SysPropsDumper.java ! agent/src/share/classes/sun/jvm/hotspot/tools/Tool.java ! agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassDump.java ! agent/src/share/classes/sun/jvm/hotspot/tools/soql/JSDB.java ! agent/src/share/classes/sun/jvm/hotspot/tools/soql/SOQL.java Changeset: 8eb40545e209 Author: kevinw Date: 2013-06-26 11:00 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/8eb40545e209 Merge Changeset: 221df7e37535 Author: iklam Date: 2013-06-27 10:03 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/221df7e37535 8016075: Win32 crash with CDS enabled and small heap size Summary: Fixed MetaspaceShared::is_in_shared_space Reviewed-by: coleenp, hseigel ! src/share/vm/memory/filemap.cpp ! src/share/vm/memory/filemap.hpp ! src/share/vm/memory/metaspaceShared.cpp Changeset: e0fe0c9a88da Author: nloodin Date: 2013-06-28 14:05 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/e0fe0c9a88da Merge Changeset: bb4f2b27e824 Author: dcubed Date: 2013-06-29 11:55 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/bb4f2b27e824 Merge Changeset: 97c5acae48be Author: hseigel Date: 2013-06-30 09:59 -0400 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/97c5acae48be 7007040: Check of capacity paramenters in JNI_PushLocalFrame is wrong Summary: changed AND to OR Reviewed-by: coleenp, hseigel Contributed-by: lois.foltan at oracle.com ! src/share/vm/prims/jni.cpp Changeset: 068b406e307f Author: fparain Date: 2013-07-01 09:13 +0000 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/068b406e307f 7060111: race condition in VMError::report_and_die() Reviewed-by: zgu, coleenp Contributed-by: volker.simonis at gmail.com ! src/share/vm/utilities/vmError.cpp ! src/share/vm/utilities/vmError.hpp Changeset: acfa2cc19146 Author: rbackman Date: 2013-06-12 09:49 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/acfa2cc19146 8016444: Duplicate zombie check in safe_for_sender Reviewed-by: dholmes, sla ! src/cpu/sparc/vm/frame_sparc.cpp ! src/share/vm/memory/referenceProcessorStats.hpp Changeset: 993dfb57c575 Author: egahlin Date: 2013-06-26 17:02 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/993dfb57c575 8016331: Minor issues in event tracing metadata Reviewed-by: stefank, brutisso, mgronlun ! src/share/vm/trace/trace.xml Changeset: 7f11c12d7a90 Author: sspitsyn Date: 2013-07-01 14:13 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/7f11c12d7a90 8009204: [dtrace] signatures returned by Java 7 jstack() are corrupted on Solaris Summary: The fix is basically a backport of JDK-7019165 (pstack issue) to jhelper.d. Reviewed-by: coleenp, sspitsyn Contributed-by: tomas.hurka at oracle.com ! src/os/solaris/dtrace/jhelper.d Changeset: de2d15ce3d4a Author: coleenp Date: 2013-07-02 08:42 -0400 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/de2d15ce3d4a 8015391: NPG: With -XX:+UseCompressedKlassPointers OOME due to exhausted metadata space could occur when metaspace is almost empty Summary: Allocate medium chunks for class metaspace when class loader has lots of classes Reviewed-by: mgerdin, jmasa ! src/share/vm/memory/metaspace.cpp ! src/share/vm/memory/universe.cpp ! src/share/vm/memory/universe.hpp ! src/share/vm/runtime/vmStructs.cpp Changeset: cedf20e2a655 Author: coleenp Date: 2013-07-02 16:54 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/cedf20e2a655 Merge - src/os_cpu/linux_sparc/vm/assembler_linux_sparc.cpp - src/os_cpu/solaris_sparc/vm/assembler_solaris_sparc.cpp ! src/share/vm/memory/metaspace.cpp ! src/share/vm/memory/universe.cpp ! src/share/vm/memory/universe.hpp ! src/share/vm/runtime/vmStructs.cpp Changeset: c92b74c62d97 Author: brutisso Date: 2013-06-27 09:59 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/c92b74c62d97 8017483: G1 tests fail with native OOME on Solaris x86 after HeapBaseMinAddress has been increased Summary: Set HeapBaseMinAddress as default rather than ergo Reviewed-by: stefank, jmasa, kvn ! src/share/vm/runtime/arguments.cpp Changeset: 3ea89789ba39 Author: ehelin Date: 2013-06-28 18:28 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/3ea89789ba39 Merge Changeset: b30744960351 Author: brutisso Date: 2013-06-30 21:42 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/b30744960351 8014022: G1: Non Java threads should lock the shared SATB queue lock without safepoint checks. Reviewed-by: tschatzl, brutisso, jmasa, ysr Contributed-by: per.liden at oracle.com ! src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.cpp Changeset: 5ea20b3bd249 Author: johnc Date: 2013-07-01 09:30 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/5ea20b3bd249 8017070: G1: assert(_card_counts[card_num] <= G1ConcRSHotCardLimit) failed Summary: The assert is invalid when a card is being refined by two different threads and its count crosses the hot threshold - the refinement count will be updated once by each thread triggering the assert. Remove the assert and update the count using a bounded expression. Reviewed-by: jmasa, tamao, brutisso ! src/share/vm/gc_implementation/g1/g1CardCounts.cpp Changeset: 6e3634222155 Author: tamao Date: 2013-06-28 20:18 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/6e3634222155 8017611: Auto corrector for mistyped vm options Summary: The auto corrector for mistyped vm options fuzzy-matches existing flags based on string similarity (Dice's coefficient). Reviewed-by: kvn, dsamersoff, hseigel, johnc ! src/share/vm/runtime/arguments.cpp ! src/share/vm/runtime/globals.cpp ! src/share/vm/runtime/globals.hpp + test/gc/arguments/TestUnrecognizedVMOptionsHandling.java Changeset: 536976a22f5f Author: tamao Date: 2013-07-03 14:50 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/536976a22f5f Merge Changeset: 70bea4a43c6d Author: tamao Date: 2013-07-03 15:04 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/70bea4a43c6d Merge Changeset: ac7193063af8 Author: jiangli Date: 2013-07-01 19:44 -0400 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/ac7193063af8 8006023: Embedded Builds fail management test because of requirement for UsePerfData being enabled. Summary: Added -XX:+UsePerfData to Test7196045.java. Reviewed-by: dholmes, collins ! test/runtime/7196045/Test7196045.java Changeset: 94aa8de029c5 Author: clucasius Date: 2013-07-03 22:36 -0400 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/94aa8de029c5 Merge Changeset: fea6a49c2762 Author: bdelsart Date: 2013-07-04 01:03 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/fea6a49c2762 Merge Changeset: f765bfec8f07 Author: kvn Date: 2013-07-01 12:22 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/f765bfec8f07 8006629: NEED_TEST: need test for JDK-8001071 Summary: added regression test Reviewed-by: kvn, coleenp Contributed-by: Filipp Zhinkin + test/runtime/8001071/Test8001071.java + test/runtime/8001071/Test8001071.sh Changeset: a023ec3452c7 Author: simonis Date: 2013-07-01 14:14 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/a023ec3452c7 8019382: PPC64: Fix bytecodeInterpreter to compile with '-Wunused-value' Summary: cast the offending expressions to (void) Reviewed-by: kvn, coleenp ! src/share/vm/interpreter/bytecodeInterpreter.cpp Changeset: 2b3fe74309b6 Author: kvn Date: 2013-07-02 10:30 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/2b3fe74309b6 8019247: SIGSEGV in compiled method c8e.e.t_.getArray(Ljava/lang/Class;)[Ljava/lang/Object Summary: Undo recent changes (and add more comments) in Ideal_allocation(). Reviewed-by: roland ! src/share/vm/opto/graphKit.cpp Changeset: 738e04fb1232 Author: anoll Date: 2013-07-02 07:51 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/738e04fb1232 8014972: Crash with specific values for -XX:InitialCodeCacheSize=500K -XX:ReservedCodeCacheSize=500k Summary: Introduce a minimum code cache size that guarantees that the VM can startup. Reviewed-by: kvn, twisti ! src/cpu/sparc/vm/c1_globals_sparc.hpp ! src/cpu/sparc/vm/c2_globals_sparc.hpp ! src/cpu/x86/vm/c1_globals_x86.hpp ! src/cpu/x86/vm/c2_globals_x86.hpp ! src/cpu/zero/vm/shark_globals_zero.hpp ! src/share/vm/runtime/arguments.cpp ! src/share/vm/runtime/globals.hpp Changeset: b800986664f4 Author: drchase Date: 2013-07-02 20:42 -0400 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/b800986664f4 7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32 Summary: add intrinsics using new instruction to interpreter, C1, C2, for suitable x86; add test Reviewed-by: kvn, twisti ! src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp ! src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp ! src/cpu/x86/vm/assembler_x86.cpp ! src/cpu/x86/vm/assembler_x86.hpp ! src/cpu/x86/vm/c1_LIRAssembler_x86.cpp ! src/cpu/x86/vm/c1_LIRGenerator_x86.cpp ! src/cpu/x86/vm/globals_x86.hpp ! src/cpu/x86/vm/interpreterGenerator_x86.hpp ! src/cpu/x86/vm/macroAssembler_x86.cpp ! src/cpu/x86/vm/macroAssembler_x86.hpp ! src/cpu/x86/vm/stubGenerator_x86_32.cpp ! src/cpu/x86/vm/stubGenerator_x86_64.cpp + src/cpu/x86/vm/stubRoutines_x86.cpp + src/cpu/x86/vm/stubRoutines_x86.hpp ! src/cpu/x86/vm/stubRoutines_x86_32.cpp ! src/cpu/x86/vm/stubRoutines_x86_32.hpp ! src/cpu/x86/vm/stubRoutines_x86_64.cpp ! src/cpu/x86/vm/stubRoutines_x86_64.hpp ! src/cpu/x86/vm/templateInterpreter_x86_32.cpp ! src/cpu/x86/vm/templateInterpreter_x86_64.cpp ! src/cpu/x86/vm/vm_version_x86.cpp ! src/cpu/x86/vm/vm_version_x86.hpp ! src/share/vm/c1/c1_GraphBuilder.cpp ! src/share/vm/c1/c1_LIR.cpp ! src/share/vm/c1/c1_LIR.hpp ! src/share/vm/c1/c1_LIRAssembler.hpp ! src/share/vm/c1/c1_LIRGenerator.cpp ! src/share/vm/c1/c1_LIRGenerator.hpp ! src/share/vm/c1/c1_Runtime1.cpp ! src/share/vm/classfile/vmSymbols.hpp ! src/share/vm/interpreter/abstractInterpreter.hpp ! src/share/vm/interpreter/interpreter.cpp ! src/share/vm/interpreter/templateInterpreter.cpp ! src/share/vm/opto/escape.cpp ! src/share/vm/opto/library_call.cpp ! src/share/vm/opto/runtime.cpp ! src/share/vm/opto/runtime.hpp ! src/share/vm/runtime/globals.hpp ! src/share/vm/runtime/stubRoutines.cpp ! src/share/vm/runtime/stubRoutines.hpp + test/compiler/7088419/CRCTest.java Changeset: c1bd7b5bdc70 Author: twisti Date: 2013-07-02 20:27 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/c1bd7b5bdc70 8017571: JSR292: JVM crashing on assert "cast to instanceKlass" while producing MethodHandle for array methods with MethodHandle.findVirtual Reviewed-by: kvn ! src/share/vm/prims/methodHandles.cpp ! src/share/vm/runtime/reflection.cpp Changeset: bed0eddd82cd Author: twisti Date: 2013-07-02 22:51 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/bed0eddd82cd Merge Changeset: 8b789ce47503 Author: roland Date: 2013-07-04 01:42 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/8b789ce47503 Merge ! src/share/vm/runtime/arguments.cpp ! src/share/vm/runtime/globals.hpp Changeset: fece0ee013fc Author: roland Date: 2013-07-04 03:41 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/fece0ee013fc Merge Changeset: c9dd82da51ed Author: amurillo Date: 2013-07-04 14:45 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/c9dd82da51ed Merge Changeset: 30b5b75c42ac Author: amurillo Date: 2013-07-04 14:45 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/30b5b75c42ac Added tag hs25-b40 for changeset c9dd82da51ed ! .hgtags Changeset: 1a3390aa8326 Author: katleman Date: 2013-07-11 10:13 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/1a3390aa8326 Added tag jdk8-b98 for changeset 30b5b75c42ac ! .hgtags Changeset: ea4d24c1e0c6 Author: amurillo Date: 2013-07-04 14:56 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/ea4d24c1e0c6 8019934: new hotspot build - hs25-b41 Reviewed-by: jcoomes ! make/hotspot_version Changeset: f323bbb0e6c1 Author: coleenp Date: 2013-07-03 13:45 -0400 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/f323bbb0e6c1 8019833: Wrong JNI error code for preexisting JVM Summary: Return the appropriate JNI error message (instead of the generic one) when the JVM is already started Reviewed-by: coleenp, hseigel Contributed-by: sylvestre at debian.org ! src/share/vm/prims/jni.cpp Changeset: 5f7a4367c787 Author: zgu Date: 2013-07-04 06:24 -0400 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/5f7a4367c787 8016074: NMT: assertion failed: assert(thread->thread_state() == from) failed: coming from wrong thread state Summary: Uses os::NakedYield() on Solaris instead of os::yield_all() Reviewed-by: acorn, coleenp, hseigel ! src/share/vm/services/memTracker.hpp Changeset: a55aa67bce1a Author: zgu Date: 2013-07-04 04:03 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/a55aa67bce1a Merge Changeset: 59b052799158 Author: dcubed Date: 2013-07-04 21:10 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/59b052799158 8015884: runThese crashed with SIGSEGV, hs_err has an error instead of stacktrace Summary: Dl_info struct should only be used if dladdr() has returned non-zero (no errors) and always check the dladdr() return value; Dl_info.dli_sname and Dl_info.dli_saddr fields should only be used if non-NULL; update/improve runtime/6888954/vmerrors.sh test Reviewed-by: dsamersoff, zgu, hseigel, coleenp ! src/os/bsd/vm/os_bsd.cpp ! src/os/linux/vm/os_linux.cpp ! src/os/solaris/vm/os_solaris.cpp ! src/os/windows/vm/os_windows.cpp ! src/os/windows/vm/os_windows.hpp ! src/os/windows/vm/os_windows.inline.hpp ! src/share/vm/prims/jni.cpp ! src/share/vm/runtime/os.hpp ! src/share/vm/utilities/debug.cpp ! src/share/vm/utilities/debug.hpp ! test/runtime/6888954/vmerrors.sh Changeset: 93e6dce53ba7 Author: fparain Date: 2013-07-05 08:26 +0000 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/93e6dce53ba7 8016465: The hs_err file gets wrong name Reviewed-by: dcubed, dholmes, rdurbin ! src/share/vm/utilities/vmError.cpp Changeset: cc5b7915104e Author: fparain Date: 2013-07-05 08:09 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/cc5b7915104e Merge Changeset: cf9d71d3e474 Author: iklam Date: 2013-07-08 10:58 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/cf9d71d3e474 8016903: Thread::_handle_area initial size too big Summary: Changed initial size to Chunk::tiny_size (216 bytes) Reviewed-by: coleenp, dholmes, sspitsyn ! src/share/vm/memory/allocation.cpp ! src/share/vm/memory/allocation.hpp ! src/share/vm/runtime/handles.hpp Changeset: 71180a6e5080 Author: jiangli Date: 2013-07-03 17:26 -0400 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/71180a6e5080 7133260: AllocationProfiler uses space in metadata and doesn't seem to do anything useful. Summary: Remove -Xaprof and Klass::_alloc_count & ArrayKlass::_alloc_size. Reviewed-by: stefank, coleenp ! agent/src/share/classes/sun/jvm/hotspot/oops/ArrayKlass.java ! agent/src/share/classes/sun/jvm/hotspot/oops/Klass.java ! src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp ! src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp ! src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp ! src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp ! src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp ! src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp ! src/share/vm/gc_implementation/g1/g1MarkSweep.cpp ! src/share/vm/memory/defNewGeneration.cpp ! src/share/vm/memory/defNewGeneration.hpp ! src/share/vm/memory/genCollectedHeap.cpp ! src/share/vm/memory/genCollectedHeap.hpp ! src/share/vm/memory/generation.cpp ! src/share/vm/memory/generation.hpp ! src/share/vm/memory/sharedHeap.hpp ! src/share/vm/memory/universe.cpp ! src/share/vm/oops/arrayKlass.cpp ! src/share/vm/oops/arrayKlass.hpp ! src/share/vm/oops/instanceKlass.cpp ! src/share/vm/oops/instanceKlass.hpp ! src/share/vm/oops/klass.cpp ! src/share/vm/oops/klass.hpp - src/share/vm/runtime/aprofiler.cpp - src/share/vm/runtime/aprofiler.hpp ! src/share/vm/runtime/arguments.cpp ! src/share/vm/runtime/arguments.hpp ! src/share/vm/runtime/java.cpp ! src/share/vm/runtime/thread.cpp ! src/share/vm/runtime/vmStructs.cpp Changeset: fa6929d0b0a9 Author: jiangli Date: 2013-07-08 14:21 -0400 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/fa6929d0b0a9 Merge ! src/share/vm/runtime/arguments.cpp Changeset: 3c7b4b7b2625 Author: jiangli Date: 2013-07-08 14:53 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/3c7b4b7b2625 Merge - src/share/vm/runtime/aprofiler.cpp - src/share/vm/runtime/aprofiler.hpp Changeset: ba9dacff9c9d Author: hseigel Date: 2013-07-08 19:36 -0400 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/ba9dacff9c9d 8014399: Remove JVM_SetProtectionDomain from hotspot Summary: JVM_SetProtectionDomain has been deprecated since 1.5 and is being removed Reviewed-by: coleenp, hseigel Contributed-by: eric.mccorkle at oracle.com ! make/bsd/makefiles/mapfile-vers-debug ! make/bsd/makefiles/mapfile-vers-product ! make/linux/makefiles/mapfile-vers-debug ! make/linux/makefiles/mapfile-vers-product ! make/solaris/makefiles/mapfile-vers ! src/share/vm/classfile/javaClasses.hpp ! src/share/vm/prims/jvm.cpp ! src/share/vm/prims/jvm.h Changeset: 26037663c2a6 Author: hseigel Date: 2013-07-08 16:44 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/26037663c2a6 Merge Changeset: e79a9f26ba2e Author: hseigel Date: 2013-07-08 18:26 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/e79a9f26ba2e Merge Changeset: 72fce0b2d341 Author: zgu Date: 2013-07-09 13:18 -0400 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/72fce0b2d341 8011760: assert(delta != 0) failed: dup pointer in MemBaseline::malloc_sort_by_addr Summary: Some of qsort implementation on Linux x86 compares element to itself, which is mistakenly treated as duplicate pointer Reviewed-by: dcubed, acorn ! src/share/vm/services/memBaseline.cpp Changeset: 2839ce15e450 Author: zgu Date: 2013-07-09 19:56 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/2839ce15e450 Merge - src/share/vm/runtime/aprofiler.cpp - src/share/vm/runtime/aprofiler.hpp Changeset: 50257d6f5aaa Author: acorn Date: 2013-07-09 14:02 -0400 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/50257d6f5aaa 8013635: VM should no longer create bridges for generic signatures. Summary: Requires: 8013789: Compiler bridges, 8015402: metafactory Reviewed-by: sspitsyn, coleenp, bharadwaj ! src/share/vm/classfile/defaultMethods.cpp ! src/share/vm/runtime/globals.hpp Changeset: 22baec423e2f Author: acorn Date: 2013-07-09 22:48 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/22baec423e2f Merge Changeset: e50be1620201 Author: goetz Date: 2013-07-08 14:15 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/e50be1620201 8020059: The flag introduced by 8014972 is not defined if Hotspot is built without a compiler (zero, ppc64 core build). Summary: define CodeCacheMinimumUseSpace flag for cppInterpeter build. Reviewed-by: kvn ! src/share/vm/runtime/globals.hpp Changeset: e554162ab094 Author: adlertz Date: 2013-07-09 17:20 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/e554162ab094 8019625: Test compiler/8005956/PolynomialRoot.java timeouts on Solaris SPARCs Summary: Disable the test for SPARC and reduce the number of test iterations Reviewed-by: kvn ! test/compiler/8005956/PolynomialRoot.java Changeset: b42fe1a8e180 Author: drchase Date: 2013-07-09 08:56 -0400 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/b42fe1a8e180 8017578: Hotspot compilation error with latest Studio compiler Summary: Make the destructor virtual (note more non-compiler hotspot errors occur downstream) Reviewed-by: kvn, twisti ! src/share/vm/adlc/forms.hpp Changeset: 7ac80525ece9 Author: anoll Date: 2013-07-09 11:48 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/7ac80525ece9 8015635: Crash when specifying very large code cache size Summary: Limit the size of the code cache to at most 2G when arguments are checked; added regression test Reviewed-by: kvn, twisti ! src/share/vm/runtime/arguments.cpp + test/compiler/codecache/CheckUpperLimit.java Changeset: 5f533e38e7d5 Author: twisti Date: 2013-07-09 22:00 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/5f533e38e7d5 Merge Changeset: dec841e0c9aa Author: anoll Date: 2013-07-10 13:33 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/dec841e0c9aa 8016749: -XX:+UseISM fails an assert(obj->is_oop()) when running SPECjbb2005 Summary: Remove obsolete code that relates to ISM which was used only on Solaris 8. Reviewed-by: kvn, twisti ! src/os/solaris/vm/globals_solaris.hpp ! src/os/solaris/vm/os_solaris.cpp ! src/os/solaris/vm/os_solaris.hpp ! src/share/vm/runtime/arguments.cpp Changeset: ec173c8f3739 Author: roland Date: 2013-07-11 01:11 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/ec173c8f3739 Merge ! src/os/solaris/vm/os_solaris.cpp ! src/share/vm/runtime/arguments.cpp ! src/share/vm/runtime/globals.hpp Changeset: 2cbc8f3011a0 Author: ehelin Date: 2013-06-05 09:44 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/2cbc8f3011a0 8015972: Refactor the sending of the object count after GC event Reviewed-by: brutisso, pliden ! src/share/vm/gc_implementation/shared/gcTrace.cpp ! src/share/vm/gc_implementation/shared/gcTrace.hpp ! src/share/vm/gc_implementation/shared/gcTraceSend.cpp + src/share/vm/gc_implementation/shared/objectCountEventSender.cpp + src/share/vm/gc_implementation/shared/objectCountEventSender.hpp ! src/share/vm/memory/heapInspection.hpp - src/share/vm/memory/klassInfoClosure.hpp Changeset: 63cffb381adc Author: ehelin Date: 2013-06-12 15:50 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/63cffb381adc 8016170: GC id variable in gcTrace.cpp should use typedef GCId Reviewed-by: johnc, jwilhelm, jmasa ! src/share/vm/gc_implementation/shared/gcTrace.cpp Changeset: 6aa440bc1125 Author: ehelin Date: 2013-06-12 15:21 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/6aa440bc1125 8015683: object_count_after_gc should have the same timestamp for all events Reviewed-by: mgerdin, stefank ! src/share/vm/gc_implementation/shared/gcTrace.cpp ! src/share/vm/gc_implementation/shared/objectCountEventSender.cpp ! src/share/vm/gc_implementation/shared/objectCountEventSender.hpp Changeset: 27c53c9f3a7e Author: ehelin Date: 2013-07-10 15:28 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/27c53c9f3a7e 8013939: Metaspace capacity not available Reviewed-by: tschatzl, mgerdin, stefank ! src/share/vm/gc_interface/collectedHeap.cpp Changeset: 0f631140d13b Author: tamao Date: 2013-07-11 11:45 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/0f631140d13b Merge - src/share/vm/memory/klassInfoClosure.hpp Changeset: 2b9946e10587 Author: amurillo Date: 2013-07-12 16:53 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/2b9946e10587 Merge - src/share/vm/memory/klassInfoClosure.hpp - src/share/vm/runtime/aprofiler.cpp - src/share/vm/runtime/aprofiler.hpp Changeset: ea979302bb70 Author: amurillo Date: 2013-07-12 16:53 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/ea979302bb70 Added tag hs25-b41 for changeset 2b9946e10587 ! .hgtags From lana.steuck at oracle.com Wed Jul 17 19:02:00 2013 From: lana.steuck at oracle.com (lana.steuck at oracle.com) Date: Wed, 17 Jul 2013 19:02:00 +0000 Subject: hg: jdk8/tl/jaxp: 2 new changesets Message-ID: <20130717190211.4493348167@hg.openjdk.java.net> Changeset: adf49c3ef83c Author: katleman Date: 2013-07-11 10:13 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jaxp/rev/adf49c3ef83c Added tag jdk8-b98 for changeset 15e5bb51bc0c ! .hgtags Changeset: 74ec7b48e3be Author: lana Date: 2013-07-17 00:34 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jaxp/rev/74ec7b48e3be Merge From brian.burkhalter at oracle.com Wed Jul 17 20:15:57 2013 From: brian.burkhalter at oracle.com (Brian Burkhalter) Date: Wed, 17 Jul 2013 13:15:57 -0700 Subject: Java 8 RFR 8020539: Clean up doclint problems in java.util package, part 2 In-Reply-To: <51E5B422.7000700@oracle.com> References: <50FE640E-DC42-47F2-9FAD-8472A013EB9B@oracle.com> <51E5B422.7000700@oracle.com> Message-ID: Hi Joe, The changes requested below have been made and the webrev updated accordingly: http://cr.openjdk.java.net/~bpb/8020539/ The HTML for Scanner may be viewed here http://cr.openjdk.java.net/~bpb/Scanner.html Thanks, Brian On Jul 16, 2013, at 1:59 PM, Joe Darcy wrote: > For the changes in j.u.Random, > > - * pseudorandomly generated and returned. All 232 > + * pseudorandomly generated and returned. All 232 > > I would just dispense with the size adjustment of the exponent -- the tag alone should be sufficient. Plain is used in java.lang.Integer and elsewhere in the core libraries. > > For the changes in Scanner, I recommend using definition lists instead. For guidance, here is an example from java.lang.Integer: > > *
> *
DecodableString: > *
Signopt DecimalNumeral > *
Signopt {@code 0x} HexDigits > *
Signopt {@code 0X} HexDigits > *
Signopt {@code #} HexDigits > *
Signopt {@code 0} OctalDigits > *

> *

Sign: > *
{@code -} > *
{@code +} > *
> > The other changes look fine. From tbuktu at hotmail.com Wed Jul 17 20:53:30 2013 From: tbuktu at hotmail.com (Tim Buktu) Date: Wed, 17 Jul 2013 22:53:30 +0200 Subject: Java 8 RFR 8014319: Faster division of large integers In-Reply-To: <4BC6E06A-DA95-4669-B3AD-82897C7B4AF8@oracle.com> References: <4BC6E06A-DA95-4669-B3AD-82897C7B4AF8@oracle.com> Message-ID: I noticed a couple of minor things. In MutableBigInteger, I made an error in the javadoc where it says + * Has the same effect as {@code addend.leftShift(32*ints); add(b);} + * but doesn't change the value of {@code b}. when it should be + * Has the same effect as {@code addend.leftShift(32*ints); add(addend);} + * but doesn't change the value of {@code addend}. In BigIntegerTest, I think SIZEd should probably be lower case: + * throw in boundary numbers such as 0, 1, maximum SIZEd, etc. + * a lot of numbers that will find failure points, such as max SIZEd Tim On 12.07.2013 20:59, Brian Burkhalter wrote: > Math Reviewers: > > This review request encompasses the incorporation of the Burnikel-Ziegler recursive division algorithm into BigInteger. As presented, it applies when the large integers involved are each represented by at least 50 ints. This algorithm crossover threshold is subject to change pending further experimentation. > > This patch is identical to the original contribution from Tim Buktu > > http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-July/018784.html > > aside from some minor cosmetic javadoc updates in MutableBigInteger and the addition of the divideLarge() method and some other minor changes in BigIntegerTest. > > Issue: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8014319 > Webrev: http://cr.openjdk.java.net/~bpb/8014319/ > > Thanks, > > Brian > > [1] http://cr.yp.to/bib/1998/burnikel.ps > [2] http://bioinfo.ict.ac.cn/%7Edbu/AlgorithmCourses/Lectures/Hasselstrom2003.pdf > > From martinrb at google.com Wed Jul 17 21:00:23 2013 From: martinrb at google.com (Martin Buchholz) Date: Wed, 17 Jul 2013 14:00:23 -0700 Subject: Java 8 RFR 8020539: Clean up doclint problems in java.util package, part 2 In-Reply-To: <50FE640E-DC42-47F2-9FAD-8472A013EB9B@oracle.com> References: <50FE640E-DC42-47F2-9FAD-8472A013EB9B@oracle.com> Message-ID: Queue.java and Deque.java are primarily maintained in Doug's CVS and should be updated there. Please remove them from this change. Doug and I will work on cleaning up doclint warnings in CVS. On Tue, Jul 16, 2013 at 1:37 PM, Brian Burkhalter < brian.burkhalter at oracle.com> wrote: > Reviewers: > > Issue: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8020539 > Webrev: http://cr.openjdk.java.net/~bpb/8020539/ > > I think the only dubious change in here is in the Scanner class comments. > This was previously using empty tag pairs for spacing purposes. I > replaced each these with   repeated four times. There is no visible > change in the generated HTML from what I can see and doclint likes this > better. > > Thanks, > > Brian From brian.burkhalter at oracle.com Wed Jul 17 21:05:04 2013 From: brian.burkhalter at oracle.com (Brian Burkhalter) Date: Wed, 17 Jul 2013 14:05:04 -0700 Subject: Java 8 RFR 8014319: Faster division of large integers In-Reply-To: References: <4BC6E06A-DA95-4669-B3AD-82897C7B4AF8@oracle.com> Message-ID: Hi Tim, Thanks for pointing these out. The SIZE error is mine: overzealous use of "replace all." I am inclined to fold these updates into this subsequent patch http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-July/019009.html as it is simpler. Brian On Jul 17, 2013, at 1:53 PM, Tim Buktu wrote: > I noticed a couple of minor things. > In MutableBigInteger, I made an error in the javadoc where it says > > + * Has the same effect as {@code addend.leftShift(32*ints); add(b);} > + * but doesn't change the value of {@code b}. > > when it should be > > + * Has the same effect as {@code addend.leftShift(32*ints); add(addend);} > + * but doesn't change the value of {@code addend}. > > > In BigIntegerTest, I think SIZEd should probably be lower case: > > + * throw in boundary numbers such as 0, 1, maximum SIZEd, etc. > > + * a lot of numbers that will find failure points, such as max SIZEd From martinrb at google.com Wed Jul 17 21:05:39 2013 From: martinrb at google.com (Martin Buchholz) Date: Wed, 17 Jul 2013 14:05:39 -0700 Subject: Java 8 RFR 8020539: Clean up doclint problems in java.util package, part 2 In-Reply-To: References: <50FE640E-DC42-47F2-9FAD-8472A013EB9B@oracle.com> Message-ID: To follow up, what standard of cleanliness is expected, i.e. what is the exact -Xdoclint flag that you are using to check for warnings? On Wed, Jul 17, 2013 at 2:00 PM, Martin Buchholz wrote: > Queue.java and Deque.java are primarily maintained in Doug's CVS and > should be updated there. Please remove them from this change. > > Doug and I will work on cleaning up doclint warnings in CVS. > > > On Tue, Jul 16, 2013 at 1:37 PM, Brian Burkhalter < > brian.burkhalter at oracle.com> wrote: > >> Reviewers: >> >> Issue: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8020539 >> Webrev: http://cr.openjdk.java.net/~bpb/8020539/ >> >> I think the only dubious change in here is in the Scanner class comments. >> This was previously using empty tag pairs for spacing purposes. I >> replaced each these with   repeated four times. There is no visible >> change in the generated HTML from what I can see and doclint likes this >> better. >> >> Thanks, >> >> Brian > > > From brian.burkhalter at oracle.com Wed Jul 17 21:23:28 2013 From: brian.burkhalter at oracle.com (Brian Burkhalter) Date: Wed, 17 Jul 2013 14:23:28 -0700 Subject: Java 8 RFR 8020539: Clean up doclint problems in java.util package, part 2 In-Reply-To: References: <50FE640E-DC42-47F2-9FAD-8472A013EB9B@oracle.com> Message-ID: Will do so once what has been posted is approved. On Jul 17, 2013, at 2:00 PM, Martin Buchholz wrote: > Queue.java and Deque.java are primarily maintained in Doug's CVS and should be updated there. Please remove them from this change. > > Doug and I will work on cleaning up doclint warnings in CVS. From brian.burkhalter at oracle.com Wed Jul 17 21:23:54 2013 From: brian.burkhalter at oracle.com (Brian Burkhalter) Date: Wed, 17 Jul 2013 14:23:54 -0700 Subject: Java 8 RFR 8020539: Clean up doclint problems in java.util package, part 2 In-Reply-To: References: <50FE640E-DC42-47F2-9FAD-8472A013EB9B@oracle.com> Message-ID: This is the command which I have been using: ../build/macosx-x86_64-normal-server-fastdebug/jdk/bin/javac -Xdoclint:all/protected -d /tmp -XDignore.symbol.file src/share/classes/java/util/ On Jul 17, 2013, at 2:05 PM, Martin Buchholz wrote: > To follow up, what standard of cleanliness is expected, i.e. what is the exact -Xdoclint flag that you are using to check for warnings? From martinrb at google.com Wed Jul 17 21:42:34 2013 From: martinrb at google.com (Martin Buchholz) Date: Wed, 17 Jul 2013 14:42:34 -0700 Subject: Java 8 RFR 8020539: Clean up doclint problems in java.util package, part 2 In-Reply-To: References: <50FE640E-DC42-47F2-9FAD-8472A013EB9B@oracle.com> Message-ID: I believe most doclint warnings have already been fixed for a while in jsr166 CVS, so please sync Queue.java and Deque.java or leave them out of this change. (More generally, I'd like all of jsr166 CVS sync'ed to openjdk8 asap) On Wed, Jul 17, 2013 at 2:23 PM, Brian Burkhalter < brian.burkhalter at oracle.com> wrote: > This is the command which I have been using: > > ../build/macosx-x86_64-normal-server-fastdebug/jdk/bin/javac > -Xdoclint:all/protected -d /tmp -XDignore.symbol.file > src/share/classes/java/util/ > > On Jul 17, 2013, at 2:05 PM, Martin Buchholz wrote: > > > To follow up, what standard of cleanliness is expected, i.e. what is the > exact -Xdoclint flag that you are using to check for warnings? > > From jason.uh at oracle.com Wed Jul 17 22:40:35 2013 From: jason.uh at oracle.com (Jason Uh) Date: Wed, 17 Jul 2013 15:40:35 -0700 Subject: [8] Request for Review: Fix doclint accessibility issues in java.io Message-ID: <51E71D63.1060509@oracle.com> Hi Joe, Could I please get a review of this change? This changeset fixes doclint issues in java.io. Webrev: http://cr.openjdk.java.net/~juh/8020426/webrev.02/ Changes have been checked with specdiff. Thanks, Jason From mike.duigou at oracle.com Wed Jul 17 23:00:49 2013 From: mike.duigou at oracle.com (Mike Duigou) Date: Wed, 17 Jul 2013 16:00:49 -0700 Subject: [8] Request for Review: Fix doclint accessibility issues in java.io In-Reply-To: <51E71D63.1060509@oracle.com> References: <51E71D63.1060509@oracle.com> Message-ID: <1A0D1A3E-7FB4-4BA3-93DE-00FC22B0246F@oracle.com> Looks good to me. You could add {@code} around true in ObjectStreamField Mike On Jul 17 2013, at 15:40 , Jason Uh wrote: > Hi Joe, > > Could I please get a review of this change? This changeset fixes doclint issues in java.io. > > Webrev: http://cr.openjdk.java.net/~juh/8020426/webrev.02/ > > Changes have been checked with specdiff. > > Thanks, > Jason From jason.uh at oracle.com Wed Jul 17 23:19:02 2013 From: jason.uh at oracle.com (Jason Uh) Date: Wed, 17 Jul 2013 16:19:02 -0700 Subject: [8] Request for Review: Fix doclint accessibility issues in java.io In-Reply-To: <1A0D1A3E-7FB4-4BA3-93DE-00FC22B0246F@oracle.com> References: <51E71D63.1060509@oracle.com> <1A0D1A3E-7FB4-4BA3-93DE-00FC22B0246F@oracle.com> Message-ID: <51E72666.1000206@oracle.com> Thanks, Mike. I'll add that before I push. On 7/17/13 4:00 PM, Mike Duigou wrote: > Looks good to me. > > You could add {@code} around true in ObjectStreamField > > Mike > > On Jul 17 2013, at 15:40 , Jason Uh wrote: > >> Hi Joe, >> >> Could I please get a review of this change? This changeset fixes doclint issues in java.io. >> >> Webrev: http://cr.openjdk.java.net/~juh/8020426/webrev.02/ >> >> Changes have been checked with specdiff. >> >> Thanks, >> Jason > From brian.burkhalter at oracle.com Wed Jul 17 23:37:11 2013 From: brian.burkhalter at oracle.com (Brian Burkhalter) Date: Wed, 17 Jul 2013 16:37:11 -0700 Subject: Java 8 RFR 8020539: Clean up doclint problems in java.util package, part 2 In-Reply-To: References: <50FE640E-DC42-47F2-9FAD-8472A013EB9B@oracle.com> Message-ID: <72ECBB9D-11EC-4850-ABF6-5DC0E36150F4@oracle.com> I'm not familiar with the JSR 166 CVS so perhaps someone with more history could enlighten me. Otherwise, I would think that any such sync would be the subject of a separate issue. On Jul 17, 2013, at 2:42 PM, Martin Buchholz wrote: > I believe most doclint warnings have already been fixed for a while in jsr166 CVS, so please sync Queue.java and Deque.java or leave them out of this change. (More generally, I'd like all of jsr166 CVS sync'ed to openjdk8 asap) From brian.burkhalter at oracle.com Wed Jul 17 23:42:21 2013 From: brian.burkhalter at oracle.com (Brian Burkhalter) Date: Wed, 17 Jul 2013 16:42:21 -0700 Subject: Java 8 RFR 8020641: Clean up some code style in recent BigInteger contributions In-Reply-To: <51E63920.5070206@oracle.com> References: <868A0266-E04D-440F-80A1-3134B47D79CF@oracle.com> <51E5D3CB.7040105@oracle.com> <975524C6-8694-4877-936C-F7B00A4A2F6A@oracle.com> <51E5EBDC.2070509@oracle.com> <51E63920.5070206@oracle.com> Message-ID: <801570A3-B74B-42FB-B440-62DB891A678B@oracle.com> Hi Joe, I've updated the webrev http://cr.openjdk.java.net/~bpb/8020641/ to include the minor changes pointed out by Tim http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-July/019033.html Thanks, Brian On Jul 16, 2013, at 11:26 PM, Joe Darcy wrote: > This latest version looks good to go; thanks, From martinrb at google.com Thu Jul 18 01:03:12 2013 From: martinrb at google.com (Martin Buchholz) Date: Wed, 17 Jul 2013 18:03:12 -0700 Subject: Java 8 RFR 8020539: Clean up doclint problems in java.util package, part 2 In-Reply-To: <72ECBB9D-11EC-4850-ABF6-5DC0E36150F4@oracle.com> References: <50FE640E-DC42-47F2-9FAD-8472A013EB9B@oracle.com> <72ECBB9D-11EC-4850-ABF6-5DC0E36150F4@oracle.com> Message-ID: I'm surprised no one has explained. The jsr166 project is upstream of openjdk and is primarily maintained by Doug Lea. http://gee.cs.oswego.edu/dl/concurrency-interest/index.html Essentially every file that can be found in Doug's CVS under src/main/util is destined for inclusion in openjdk. http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/src/main/java/util/ If modifications are made to openjdk directly, they are at risk of being overwritten in the next sync. I wish syncs from jsr166 => openjdk were more frequent. Certainly right now is a good time in the release process to do these kinds of syncs (and in fact they are in progress in other changesets). On Wed, Jul 17, 2013 at 4:37 PM, Brian Burkhalter < brian.burkhalter at oracle.com> wrote: > I'm not familiar with the JSR 166 CVS so perhaps someone with more history > could enlighten me. Otherwise, I would think that any such sync would be > the subject of a separate issue. > > On Jul 17, 2013, at 2:42 PM, Martin Buchholz wrote: > > I believe most doclint warnings have already been fixed for a while in > jsr166 CVS, so please sync Queue.java and Deque.java or leave them out of > this change. (More generally, I'd like all of jsr166 CVS sync'ed to > openjdk8 asap) > > > From jonathan.gibbons at oracle.com Thu Jul 18 01:19:24 2013 From: jonathan.gibbons at oracle.com (jonathan.gibbons at oracle.com) Date: Thu, 18 Jul 2013 01:19:24 +0000 Subject: hg: jdk8/tl/langtools: 8014636: TestLiteralCodeInPre fails on windows Message-ID: <20130718011931.069B048183@hg.openjdk.java.net> Changeset: 80e75aa6a707 Author: jjg Date: 2013-07-17 18:18 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/80e75aa6a707 8014636: TestLiteralCodeInPre fails on windows Reviewed-by: ksrini ! src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java ! src/share/classes/com/sun/tools/doclets/formats/html/TagletWriterImpl.java ! src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Util.java ! test/com/sun/javadoc/testCRLineSeparator/TestCRLineSeparator.java ! test/com/sun/javadoc/testLeadingSpaces/LeadingSpaces.java ! test/com/sun/javadoc/testLinkTaglet/TestLinkTaglet.java ! test/com/sun/javadoc/testLiteralCodeInPre/TestLiteralCodeInPre.java ! test/com/sun/javadoc/testRelativeLinks/TestRelativeLinks.java From jonathan.gibbons at oracle.com Thu Jul 18 02:16:35 2013 From: jonathan.gibbons at oracle.com (jonathan.gibbons at oracle.com) Date: Thu, 18 Jul 2013 02:16:35 +0000 Subject: hg: jdk8/tl/langtools: 8020664: doclint gives incorrect warnings on normal package statements Message-ID: <20130718021638.82C1748189@hg.openjdk.java.net> Changeset: 1476d54fdc61 Author: jjg Date: 2013-07-17 19:16 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/1476d54fdc61 8020664: doclint gives incorrect warnings on normal package statements Reviewed-by: mcimadamore ! src/share/classes/com/sun/tools/doclint/DocLint.java ! src/share/classes/com/sun/tools/doclint/resources/doclint.properties ! test/tools/doclint/BadPackageCommentTest.out ! test/tools/doclint/DocLintTester.java + test/tools/doclint/packageTests/bad/Test.java + test/tools/doclint/packageTests/bad/Test.out + test/tools/doclint/packageTests/bad/package-info.java + test/tools/doclint/packageTests/bad/package-info.out + test/tools/doclint/packageTests/good/Test.java + test/tools/doclint/packageTests/good/package-info.java From jonathan.gibbons at oracle.com Thu Jul 18 02:12:28 2013 From: jonathan.gibbons at oracle.com (jonathan.gibbons at oracle.com) Date: Thu, 18 Jul 2013 02:12:28 +0000 Subject: hg: jdk8/tl/langtools: 8020313: doclint doesn't reset HTML anchors correctly Message-ID: <20130718021233.D097348187@hg.openjdk.java.net> Changeset: 1e533c1bfb01 Author: jjg Date: 2013-07-17 19:12 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/1e533c1bfb01 8020313: doclint doesn't reset HTML anchors correctly Reviewed-by: mcimadamore ! src/share/classes/com/sun/tools/doclint/Checker.java + test/tools/doclint/AnchorTest2.java + test/tools/doclint/AnchorTest2.out + test/tools/doclint/AnchorTest2a.java From joe.darcy at oracle.com Thu Jul 18 05:07:14 2013 From: joe.darcy at oracle.com (Joe Darcy) Date: Wed, 17 Jul 2013 22:07:14 -0700 Subject: Java 8 RFR 8020539: Clean up doclint problems in java.util package, part 2 In-Reply-To: References: <50FE640E-DC42-47F2-9FAD-8472A013EB9B@oracle.com> Message-ID: <51E77802.8070001@oracle.com> Hello, In Random.java, I would prefer if the size manipulation of the exponent was removed instead of 373 * All 224 possible {@code float} values just 373 * All 224 possible {@code float} values. Also, I think the changes in Scanner would be better of the JLS-style grammar syntax was used, which is what is done in places like java.lang.*. From memory, NonTerminal: First Option of the production Second Options of the production Offhand, I wasn't aware Dequeue and Queue were maintained in Doug's CVS, but I agree changes to those files should flow through there first. Thanks, -Joe On 07/17/2013 02:23 PM, Brian Burkhalter wrote: > Will do so once what has been posted is approved. > > On Jul 17, 2013, at 2:00 PM, Martin Buchholz wrote: > >> Queue.java and Deque.java are primarily maintained in Doug's CVS and should be updated there. Please remove them from this change. >> >> Doug and I will work on cleaning up doclint warnings in CVS. From joe.darcy at oracle.com Thu Jul 18 05:12:47 2013 From: joe.darcy at oracle.com (Joe Darcy) Date: Wed, 17 Jul 2013 22:12:47 -0700 Subject: [8] Request for Review: Fix doclint accessibility issues in java.io In-Reply-To: <51E72666.1000206@oracle.com> References: <51E71D63.1060509@oracle.com> <1A0D1A3E-7FB4-4BA3-93DE-00FC22B0246F@oracle.com> <51E72666.1000206@oracle.com> Message-ID: <51E7794F.4070305@oracle.com> Looks fine. Thanks, -Joe On 07/17/2013 04:19 PM, Jason Uh wrote: > Thanks, Mike. > > I'll add that before I push. > > On 7/17/13 4:00 PM, Mike Duigou wrote: >> Looks good to me. >> >> You could add {@code} around true in ObjectStreamField >> >> Mike >> >> On Jul 17 2013, at 15:40 , Jason Uh wrote: >> >>> Hi Joe, >>> >>> Could I please get a review of this change? This changeset fixes >>> doclint issues in java.io. >>> >>> Webrev: http://cr.openjdk.java.net/~juh/8020426/webrev.02/ >>> >>> Changes have been checked with specdiff. >>> >>> Thanks, >>> Jason >> > From joe.darcy at oracle.com Thu Jul 18 05:31:14 2013 From: joe.darcy at oracle.com (Joe Darcy) Date: Wed, 17 Jul 2013 22:31:14 -0700 Subject: Java 8 RFR 6476168: (fmt) Inconsistency formatting subnormal doubles with hexadecimal conversion In-Reply-To: <23721DCA-F2A2-4B97-9CC0-56151ACD7E95@oracle.com> References: <23721DCA-F2A2-4B97-9CC0-56151ACD7E95@oracle.com> Message-ID: <51E77DA2.1050304@oracle.com> Hi Brian, In the javadoc change, is there a reason for [1, 12], rather than just [1, 12], ? The update should discuss how normal (that is non-subnormal) values are handled with reduced precision. The change should include tests of the newly specified behavior. Cheers, -Joe On 07/16/2013 12:50 PM, Brian Burkhalter wrote: > Reviewers: > > Issue http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6476168 > Webrev http://cr.openjdk.java.net/~bpb/6476168/ > > Change is to clarify the javadoc specification such that the implementation is in sync. > > Thanks, > > Brian From pbenedict at apache.org Thu Jul 18 07:11:36 2013 From: pbenedict at apache.org (Paul Benedict) Date: Thu, 18 Jul 2013 02:11:36 -0500 Subject: RFR: 8017513: Support for closeable streams Message-ID: Brian, you wrote: "It would be utterly criminal if someone were to restructure the above code into the below code because some IDE inspection complained about "must call close or use TWR." I agree here. However, the inheritance of AutoCloseable is going to likely prompt some kind of action by developers. While wrapping in TWR may be the pedantic case (and hopefully the minority case), I think the majority client code will be using @SuppressWarning("resource") because no one likes to see warnings in their IDE. I'm still a believer the best middle-ground solution is the use of @HasResource that you created -- except bumped up to apply on all AutoCloseable types. Rather than explain this, here's some code: @Retention(RetentionPolicy.CLASS) @Documented @interface HoldsResource { boolean value() default true; } // Added a new default value @HoldsResource public interface AutoCloseable { ... } @HoldsResource(false) public interface IntStream { ... } By default, all uses of AutoCloseable types definitely hold a resource. This is the expectation of today. Your work in the stream library has brought forward the case this might not always be expected. I believe this is a good progression. Your annotation was designed with static analysis in mind. I just think it's at the wrong level. This proposal makes MayHoldCloseableResource irrelevant and disappear, the use of TWR with true-backed resource streams good, and fix false leak detections for non-resource streams. -- Cheers, Paul From alexey.utkin at oracle.com Thu Jul 18 07:56:24 2013 From: alexey.utkin at oracle.com (Alexey Utkin) Date: Thu, 18 Jul 2013 11:56:24 +0400 Subject: Review request: JDK-8016579 (process) IOException thrown by ProcessBuilder.start() method is incorrectly encoded (v.3) In-Reply-To: <51E6E284.1080601@oracle.com> References: <51E3C3AE.1020406@oracle.com> <51E56F0F.9010106@oracle.com> <51E59A0D.7050506@oracle.com> <51E6B825.2050006@oracle.com> <51E6E284.1080601@oracle.com> Message-ID: <51E79FA8.5090106@oracle.com> On 7/17/2013 10:29 PM, Dan Xu wrote: > I don't know the difference between (*env)->NewStringUTF(env, buf) and > JNU_NewStringPlatform(env, buf). Does the JNU_NewStringPlatform() > function currently fail to process non-western locale? According to > the code, JNU_NewStringPlatform() is also trying to use the right > encoding for the give string. JNU_NewStringPlatform() is using the String(byte[] bytes) constructor. Javadoc says: "Constructs a new |String| by decoding the specified array of bytes using the platform's default charset ... The behavior of this constructor when the given bytes are not valid in the default charset is unspecified". In the most of cases the code page is "ISO-8859-1" by hysterical reasons (Win9x/WinMe) of user does not change the Java system property. Currently in Java for Windows (in libraries and JVM, but not in AWT - I & Artem fixed it there) we got stupid decoding pipe: win32_UTF16(aka Windows Unicode)(JNI - 16bit WCHAR) -> ISO-8859-1(JVM - 8bit char) -> UTF16(Java - 16bit jchar). It can be compared with TV stream HDTV->MPG4->HDTV. Instead, (*env)->NewStringUTF(env, buf) call goes by pipe win32_UTF16(aka Windows Unicode)(JNI) -> UTF8 (JVM multibyte 8bit!)-> UTF16(Java) without information loss and has no dependance from user's fantasy about system locale. Regards, -uta > Other changes look good to me. Thanks for fixing getLastErrorString > function in io_util_md.c file. > > -Dan > > On 07/17/2013 08:28 AM, Alexey Utkin wrote: >> Thanks, >> >> Here is new version with Dan's correction: >> http://cr.openjdk.java.net/~uta/openjdk-webrevs/JDK-8016579/webrev.02/ >> >> Regards, >> -uta >> >> >> On 7/16/2013 11:07 PM, Dan Xu wrote: >>> I agree. Is jdk_util.c or jni_util.c or any file under >>> native/common/ a good place? >>> >>> The fix looks good to me. >>> >>> One small comment is to get the return value of swprintf() in >>> win32Error(). If the return value is -1, an error situation needs to >>> be handled even though it seems very rare. If it is not -1, then get >>> the actual length of utf16_javaMessage. And pass the length of >>> utf16_javaMessage to WideCharToMultiByte() instead of MESSAGE_LENGTH >>> to make the code more efficient. Thanks! >> Accepted. >>> >>> -Dan >>> >>> >>> >>> >>> On 07/16/2013 10:49 AM, Martin Buchholz wrote: >>>> Looks OK to me. As ever, we continue to not have good places >>>> within the JDK itself for C-level infrastructure - win32Error is >>>> not specific to the process api, and should really be pulled into >>>> some common directory - but I don't know of any such. >>>> >>>> >>>> On Tue, Jul 16, 2013 at 9:04 AM, Alexey Utkin >>>> > wrote: >>>> >>>> Here is new version of fix: >>>> http://cr.openjdk.java.net/~uta/openjdk-webrevs/JDK-8016579/webrev.01/ >>>> >>>> >>>> On 7/15/2013 9:08 PM, Martin Buchholz wrote: >>>>> Superficial review: >>>>> >>>>> Looks good mostly. >>>>> >>>>> Historically, switching windows code to use "W" APIs has been >>>>> a big TODO, but was waiting for Win98 de-support. >>>> In java.lang we have passed the half-way: the error reporting >>>> sub-system is in the ASCII world. >>>>> >>>>> Please spell correctly: >>>>> MESAGE_LENGTH >>>> Thanks, I missed it. Fixed. >>>>> >>>>> If errno and GetLastError are two separate error notification >>>>> systems, how do you know which one corresponded to the last >>>>> failure? E.g. if the last failure only set errno, won't the >>>>> error message be via GetLastError(), which is likely to be stale? >>>> As Dan mentioned, the os_lasterror was a copy of JVM >>>> os::lasterror call. >>>> The error message procedure is used for >>>> CreatePipe >>>> CreateProcessW >>>> GetExitCodeProcess >>>> WaitForMultipleObjects >>>> fail report. You are right, all the calls return the problem by >>>> GetLastMessage call. >>>> The function is changed (reduced). >>>> >>>> Here is new version of fix: >>>> http://cr.openjdk.java.net/~uta/openjdk-webrevs/JDK-8016579/webrev.01/ >>>> >>>> >>>> Regards, >>>> -uta >>>> >>>>> >>>>> >>>>> >>>>> On Mon, Jul 15, 2013 at 2:41 AM, Alexey Utkin >>>>> > wrote: >>>>> >>>>> Bug description: >>>>> https://jbs.oracle.com/bugs/browse/JDK-8016579 >>>>> http://bugs.sun.com/view_bug.do?bug_id=8016579 >>>>> >>>>> Here is the suggested fix: >>>>> http://cr.openjdk.java.net/~uta/openjdk-webrevs/JDK-8016579/webrev.00/ >>>>> >>>>> >>>>> Summary: >>>>> We have THREE locales in action: >>>>> 1. Thread default locale - dictates UNICODE-to-8bit conversion >>>>> 2. OS locale that defines the message localization >>>>> 3. The file name locale >>>>> >>>>> Each locale could be an extended locale, that means that >>>>> text cannot be mapped to 8bit sequence without multibyte >>>>> encoding. VM is ready for that, if text is UTF-8. >>>>> The suggested fix does the work right from the beginning. >>>>> >>>>> Unicode version of JVM call: >>>>> hotspot/src/os/windows/vm/os_windows.cpp: >>>>> size_t os::lasterror(char* buf, size_t len) >>>>> was used as prototype for Unicode error message getter. It >>>>> has to be fixed accordingly as well as >>>>> jdk/src/windows/native/java/io/io_util_md.c >>>>> size_t getLastErrorString(char *buf, size_t len) >>>>> >>>>> The bug contains the attachment >>>>> https://jbs.oracle.com/bugs/secure/attachment/14581/JDK-8016579.txt >>>>> that summarize the fix result in comparison with original >>>>> implementation. >>>>> >>>>> Regards, >>>>> -uta >>>>> >>>>> >>>> >>>> >>> >> > From chris.hegarty at oracle.com Thu Jul 18 09:19:29 2013 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Thu, 18 Jul 2013 10:19:29 +0100 Subject: [8] Request for Review: Fix doclint accessibility issues in java.io In-Reply-To: <51E7794F.4070305@oracle.com> References: <51E71D63.1060509@oracle.com> <1A0D1A3E-7FB4-4BA3-93DE-00FC22B0246F@oracle.com> <51E72666.1000206@oracle.com> <51E7794F.4070305@oracle.com> Message-ID: <51E7B321.9040306@oracle.com> On 18/07/2013 06:12, Joe Darcy wrote: > Looks fine. +1. -Chris. > > Thanks, > > -Joe > > On 07/17/2013 04:19 PM, Jason Uh wrote: >> Thanks, Mike. >> >> I'll add that before I push. >> >> On 7/17/13 4:00 PM, Mike Duigou wrote: >>> Looks good to me. >>> >>> You could add {@code} around true in ObjectStreamField >>> >>> Mike >>> >>> On Jul 17 2013, at 15:40 , Jason Uh wrote: >>> >>>> Hi Joe, >>>> >>>> Could I please get a review of this change? This changeset fixes >>>> doclint issues in java.io. >>>> >>>> Webrev: http://cr.openjdk.java.net/~juh/8020426/webrev.02/ >>>> >>>> Changes have been checked with specdiff. >>>> >>>> Thanks, >>>> Jason >>> >> > From chris.hegarty at oracle.com Thu Jul 18 09:56:11 2013 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Thu, 18 Jul 2013 10:56:11 +0100 Subject: Java 8 RFR 8020539: Clean up doclint problems in java.util package, part 2 In-Reply-To: References: <50FE640E-DC42-47F2-9FAD-8472A013EB9B@oracle.com> <72ECBB9D-11EC-4850-ABF6-5DC0E36150F4@oracle.com> Message-ID: <51E7BBBB.50709@oracle.com> Sync's from jsr166 - > jdk8 are in progress. Paul and I have pushed, or still in flight, a number of changeset over the past number of weeks. I would hope to have the remainder of changes in jdk8 soon. doclint issues should be fixed in jsr166 CVS first. Either work with Doug or Martin to provide patches based in the CVS source, or wait until jdk8 catches up, and then the patches should be applicable to both sources ( accounting for header offset ). -Chris. On 18/07/2013 02:03, Martin Buchholz wrote: > I'm surprised no one has explained. > The jsr166 project is upstream of openjdk and is primarily maintained by > Doug Lea. > http://gee.cs.oswego.edu/dl/concurrency-interest/index.html > Essentially every file that can be found in Doug's CVS under src/main/util > is destined for inclusion in openjdk. > http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/src/main/java/util/ > If modifications are made to openjdk directly, they are at risk of being > overwritten in the next sync. > > I wish syncs from jsr166 => openjdk were more frequent. Certainly right > now is a good time in the release process to do these kinds of syncs (and > in fact they are in progress in other changesets). > > > On Wed, Jul 17, 2013 at 4:37 PM, Brian Burkhalter< > brian.burkhalter at oracle.com> wrote: > >> I'm not familiar with the JSR 166 CVS so perhaps someone with more history >> could enlighten me. Otherwise, I would think that any such sync would be >> the subject of a separate issue. >> >> On Jul 17, 2013, at 2:42 PM, Martin Buchholz wrote: >> >> I believe most doclint warnings have already been fixed for a while in >> jsr166 CVS, so please sync Queue.java and Deque.java or leave them out of >> this change. (More generally, I'd like all of jsr166 CVS sync'ed to >> openjdk8 asap) >> >> >> From dl at cs.oswego.edu Thu Jul 18 11:36:27 2013 From: dl at cs.oswego.edu (Doug Lea) Date: Thu, 18 Jul 2013 07:36:27 -0400 Subject: Java 8 RFR 8020539: Clean up doclint problems in java.util package, part 2 In-Reply-To: References: <50FE640E-DC42-47F2-9FAD-8472A013EB9B@oracle.com> <72ECBB9D-11EC-4850-ABF6-5DC0E36150F4@oracle.com> Message-ID: <51E7D33B.90702@cs.oswego.edu> On 07/17/13 21:03, Martin Buchholz wrote: > I'm surprised no one has explained. > The jsr166 project is upstream of openjdk and is primarily maintained by > Doug Lea. > http://gee.cs.oswego.edu/dl/concurrency-interest/index.html > Essentially every file that can be found in Doug's CVS under src/main/util > is destined for inclusion in openjdk. > http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/src/main/java/util/ > If modifications are made to openjdk directly, they are at risk of being > overwritten in the next sync. > To further explain: jsr166 initially introduced in JDK5, java.util.concurrent, plus a few things in java.util and elsewhere. These sources are also used in Android, and ongoing maintenance and extension include participation of folks from Google. Until legal matters surrounding this are straightened out, to be cautious, we always commit first into jsr166 repository and then sync. We do happily accept patch requests though, and try to keep all parties content. While there is no rule saying that Oracle engineers must go through this pathway for updates to any files originating from jsr166, it has worked pretty well, considering all the alternatives. -Doug From dan.xu at oracle.com Thu Jul 18 17:40:21 2013 From: dan.xu at oracle.com (Dan Xu) Date: Thu, 18 Jul 2013 10:40:21 -0700 Subject: Review request: JDK-8016579 (process) IOException thrown by ProcessBuilder.start() method is incorrectly encoded (v.3) In-Reply-To: <51E79FA8.5090106@oracle.com> References: <51E3C3AE.1020406@oracle.com> <51E56F0F.9010106@oracle.com> <51E59A0D.7050506@oracle.com> <51E6B825.2050006@oracle.com> <51E6E284.1080601@oracle.com> <51E79FA8.5090106@oracle.com> Message-ID: <51E82885.4080000@oracle.com> I see. Thanks for your good explanation. The change looks good to me. -Dan On 07/18/2013 12:56 AM, Alexey Utkin wrote: > On 7/17/2013 10:29 PM, Dan Xu wrote: >> I don't know the difference between (*env)->NewStringUTF(env, buf) >> and JNU_NewStringPlatform(env, buf). Does the JNU_NewStringPlatform() >> function currently fail to process non-western locale? According to >> the code, JNU_NewStringPlatform() is also trying to use the right >> encoding for the give string. > JNU_NewStringPlatform() is using the String(byte[] bytes) constructor. > Javadoc says: "Constructs a new |String| by decoding the specified > array of bytes using the platform's default charset ... The behavior > of this constructor when the given bytes are not valid in the default > charset is unspecified". In the most of cases the code page is > "ISO-8859-1" by hysterical reasons (Win9x/WinMe) of user does not > change the Java system property. > > Currently in Java for Windows (in libraries and JVM, but not in AWT - > I & Artem fixed it there) we got stupid decoding pipe: > win32_UTF16(aka Windows Unicode)(JNI - 16bit WCHAR) -> ISO-8859-1(JVM > - 8bit char) -> UTF16(Java - 16bit jchar). > It can be compared with TV stream HDTV->MPG4->HDTV. > > Instead, (*env)->NewStringUTF(env, buf) call goes by pipe > win32_UTF16(aka Windows Unicode)(JNI) -> UTF8 (JVM multibyte 8bit!)-> > UTF16(Java) without information loss and has no dependance from user's > fantasy about system locale. > > Regards, > -uta > >> Other changes look good to me. Thanks for fixing getLastErrorString >> function in io_util_md.c file. >> >> -Dan >> >> On 07/17/2013 08:28 AM, Alexey Utkin wrote: >>> Thanks, >>> >>> Here is new version with Dan's correction: >>> http://cr.openjdk.java.net/~uta/openjdk-webrevs/JDK-8016579/webrev.02/ >>> >>> Regards, >>> -uta >>> >>> >>> On 7/16/2013 11:07 PM, Dan Xu wrote: >>>> I agree. Is jdk_util.c or jni_util.c or any file under >>>> native/common/ a good place? >>>> >>>> The fix looks good to me. >>>> >>>> One small comment is to get the return value of swprintf() in >>>> win32Error(). If the return value is -1, an error situation needs >>>> to be handled even though it seems very rare. If it is not -1, then >>>> get the actual length of utf16_javaMessage. And pass the length of >>>> utf16_javaMessage to WideCharToMultiByte() instead of >>>> MESSAGE_LENGTH to make the code more efficient. Thanks! >>> Accepted. >>>> >>>> -Dan >>>> >>>> >>>> >>>> >>>> On 07/16/2013 10:49 AM, Martin Buchholz wrote: >>>>> Looks OK to me. As ever, we continue to not have good places >>>>> within the JDK itself for C-level infrastructure - win32Error is >>>>> not specific to the process api, and should really be pulled into >>>>> some common directory - but I don't know of any such. >>>>> >>>>> >>>>> On Tue, Jul 16, 2013 at 9:04 AM, Alexey Utkin >>>>> > wrote: >>>>> >>>>> Here is new version of fix: >>>>> http://cr.openjdk.java.net/~uta/openjdk-webrevs/JDK-8016579/webrev.01/ >>>>> >>>>> >>>>> On 7/15/2013 9:08 PM, Martin Buchholz wrote: >>>>>> Superficial review: >>>>>> >>>>>> Looks good mostly. >>>>>> >>>>>> Historically, switching windows code to use "W" APIs has been >>>>>> a big TODO, but was waiting for Win98 de-support. >>>>> In java.lang we have passed the half-way: the error reporting >>>>> sub-system is in the ASCII world. >>>>>> >>>>>> Please spell correctly: >>>>>> MESAGE_LENGTH >>>>> Thanks, I missed it. Fixed. >>>>>> >>>>>> If errno and GetLastError are two separate error notification >>>>>> systems, how do you know which one corresponded to the last >>>>>> failure? E.g. if the last failure only set errno, won't the >>>>>> error message be via GetLastError(), which is likely to be stale? >>>>> As Dan mentioned, the os_lasterror was a copy of JVM >>>>> os::lasterror call. >>>>> The error message procedure is used for >>>>> CreatePipe >>>>> CreateProcessW >>>>> GetExitCodeProcess >>>>> WaitForMultipleObjects >>>>> fail report. You are right, all the calls return the problem >>>>> by GetLastMessage call. >>>>> The function is changed (reduced). >>>>> >>>>> Here is new version of fix: >>>>> http://cr.openjdk.java.net/~uta/openjdk-webrevs/JDK-8016579/webrev.01/ >>>>> >>>>> >>>>> Regards, >>>>> -uta >>>>> >>>>>> >>>>>> >>>>>> >>>>>> On Mon, Jul 15, 2013 at 2:41 AM, Alexey Utkin >>>>>> > wrote: >>>>>> >>>>>> Bug description: >>>>>> https://jbs.oracle.com/bugs/browse/JDK-8016579 >>>>>> http://bugs.sun.com/view_bug.do?bug_id=8016579 >>>>>> >>>>>> Here is the suggested fix: >>>>>> http://cr.openjdk.java.net/~uta/openjdk-webrevs/JDK-8016579/webrev.00/ >>>>>> >>>>>> >>>>>> Summary: >>>>>> We have THREE locales in action: >>>>>> 1. Thread default locale - dictates UNICODE-to-8bit >>>>>> conversion >>>>>> 2. OS locale that defines the message localization >>>>>> 3. The file name locale >>>>>> >>>>>> Each locale could be an extended locale, that means that >>>>>> text cannot be mapped to 8bit sequence without multibyte >>>>>> encoding. VM is ready for that, if text is UTF-8. >>>>>> The suggested fix does the work right from the beginning. >>>>>> >>>>>> Unicode version of JVM call: >>>>>> hotspot/src/os/windows/vm/os_windows.cpp: >>>>>> size_t os::lasterror(char* buf, size_t len) >>>>>> was used as prototype for Unicode error message getter. >>>>>> It has to be fixed accordingly as well as >>>>>> jdk/src/windows/native/java/io/io_util_md.c >>>>>> size_t getLastErrorString(char *buf, size_t len) >>>>>> >>>>>> The bug contains the attachment >>>>>> https://jbs.oracle.com/bugs/secure/attachment/14581/JDK-8016579.txt >>>>>> that summarize the fix result in comparison with original >>>>>> implementation. >>>>>> >>>>>> Regards, >>>>>> -uta >>>>>> >>>>>> >>>>> >>>>> >>>> >>> >> > From jason.uh at oracle.com Thu Jul 18 17:50:03 2013 From: jason.uh at oracle.com (jason.uh at oracle.com) Date: Thu, 18 Jul 2013 17:50:03 +0000 Subject: hg: jdk8/tl/jdk: 8020426: Fix doclint accessibility issues in java.io Message-ID: <20130718175031.52C09481C6@hg.openjdk.java.net> Changeset: 6e10d93273d0 Author: juh Date: 2013-07-18 10:49 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/6e10d93273d0 8020426: Fix doclint accessibility issues in java.io Reviewed-by: mduigou, darcy, chegar ! src/share/classes/java/io/DataInput.java ! src/share/classes/java/io/File.java ! src/share/classes/java/io/ObjectStreamField.java ! src/share/classes/java/io/RandomAccessFile.java From xueming.shen at oracle.com Thu Jul 18 18:01:30 2013 From: xueming.shen at oracle.com (xueming.shen at oracle.com) Date: Thu, 18 Jul 2013 18:01:30 +0000 Subject: hg: jdk8/tl/jdk: 8016025: JSR 310 DateTime API Updates IV; ... Message-ID: <20130718180152.D2595481CE@hg.openjdk.java.net> Changeset: b39797bb86c0 Author: sherman Date: 2013-07-18 11:02 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/b39797bb86c0 8016025: JSR 310 DateTime API Updates IV 8020418: Cleanup of -Xlint warnings in java.time 8016623: test/java/time/format/TestDateTimeTextProvider.java failing Summary: Integration of JSR310 Date/Time API update IV Reviewed-by: sherman Contributed-by: scolebourne at joda.org, roger.riggs at oracle.com, masayoshi.okutsu at oracle.com, patrick.zhang at oracle.com, chand.basha at oracle.com ! src/share/classes/java/time/DayOfWeek.java ! src/share/classes/java/time/Duration.java ! src/share/classes/java/time/Instant.java ! src/share/classes/java/time/LocalDate.java ! src/share/classes/java/time/LocalDateTime.java ! src/share/classes/java/time/LocalTime.java ! src/share/classes/java/time/Month.java ! src/share/classes/java/time/MonthDay.java ! src/share/classes/java/time/OffsetDateTime.java ! src/share/classes/java/time/OffsetTime.java ! src/share/classes/java/time/Period.java ! src/share/classes/java/time/Year.java ! src/share/classes/java/time/YearMonth.java ! src/share/classes/java/time/ZoneId.java ! src/share/classes/java/time/ZoneOffset.java ! src/share/classes/java/time/ZoneRegion.java ! src/share/classes/java/time/ZonedDateTime.java ! src/share/classes/java/time/chrono/ChronoDateImpl.java ! src/share/classes/java/time/chrono/ChronoLocalDate.java ! src/share/classes/java/time/chrono/ChronoLocalDateTime.java ! src/share/classes/java/time/chrono/ChronoLocalDateTimeImpl.java ! src/share/classes/java/time/chrono/ChronoZonedDateTime.java ! src/share/classes/java/time/chrono/ChronoZonedDateTimeImpl.java ! src/share/classes/java/time/chrono/Chronology.java ! src/share/classes/java/time/chrono/Era.java ! src/share/classes/java/time/chrono/HijrahChronology.java ! src/share/classes/java/time/chrono/HijrahDate.java ! src/share/classes/java/time/chrono/IsoChronology.java ! src/share/classes/java/time/chrono/JapaneseChronology.java ! src/share/classes/java/time/chrono/JapaneseDate.java ! src/share/classes/java/time/chrono/JapaneseEra.java ! src/share/classes/java/time/chrono/MinguoChronology.java ! src/share/classes/java/time/chrono/MinguoDate.java ! src/share/classes/java/time/chrono/ThaiBuddhistChronology.java ! src/share/classes/java/time/chrono/ThaiBuddhistDate.java ! src/share/classes/java/time/chrono/package-info.java ! src/share/classes/java/time/format/DateTimeFormatter.java ! src/share/classes/java/time/format/DateTimeFormatterBuilder.java ! src/share/classes/java/time/format/DateTimePrintContext.java ! src/share/classes/java/time/format/Parsed.java ! src/share/classes/java/time/temporal/ChronoField.java ! src/share/classes/java/time/temporal/ChronoUnit.java ! src/share/classes/java/time/temporal/IsoFields.java ! src/share/classes/java/time/temporal/JulianFields.java ! src/share/classes/java/time/temporal/Temporal.java ! src/share/classes/java/time/temporal/TemporalAccessor.java ! src/share/classes/java/time/temporal/TemporalField.java ! src/share/classes/java/time/temporal/TemporalUnit.java ! src/share/classes/java/time/temporal/ValueRange.java ! src/share/classes/java/time/temporal/WeekFields.java ! src/share/lib/hijrah-config-umalqura.properties ! test/java/time/tck/java/time/MockSimplePeriod.java ! test/java/time/tck/java/time/TCKClock_Fixed.java ! test/java/time/tck/java/time/TCKDayOfWeek.java ! test/java/time/tck/java/time/TCKInstant.java ! test/java/time/tck/java/time/TCKLocalDate.java ! test/java/time/tck/java/time/TCKLocalDateTime.java ! test/java/time/tck/java/time/TCKLocalTime.java ! test/java/time/tck/java/time/TCKMonth.java ! test/java/time/tck/java/time/TCKMonthDay.java ! test/java/time/tck/java/time/TCKOffsetDateTime.java ! test/java/time/tck/java/time/TCKOffsetTime.java ! test/java/time/tck/java/time/TCKPeriod.java ! test/java/time/tck/java/time/TCKYear.java ! test/java/time/tck/java/time/TCKYearMonth.java ! test/java/time/tck/java/time/TCKZoneId.java ! test/java/time/tck/java/time/TCKZonedDateTime.java ! test/java/time/tck/java/time/chrono/CopticDate.java ! test/java/time/tck/java/time/chrono/TCKChronoLocalDate.java ! test/java/time/tck/java/time/chrono/TCKChronoLocalDateTime.java ! test/java/time/tck/java/time/chrono/TCKChronoZonedDateTime.java ! test/java/time/tck/java/time/chrono/TCKChronology.java ! test/java/time/tck/java/time/chrono/TCKHijrahChronology.java ! test/java/time/tck/java/time/chrono/TCKHijrahEra.java ! test/java/time/tck/java/time/chrono/TCKIsoChronology.java ! test/java/time/tck/java/time/chrono/TCKJapaneseChronology.java ! test/java/time/tck/java/time/chrono/TCKJapaneseEra.java ! test/java/time/tck/java/time/chrono/TCKMinguoChronology.java ! test/java/time/tck/java/time/chrono/TCKThaiBuddhistChronology.java + test/java/time/tck/java/time/format/TCKFormatStyle.java + test/java/time/tck/java/time/format/TCKResolverStyle.java + test/java/time/tck/java/time/format/TCKSignStyle.java ! test/java/time/tck/java/time/format/TCKTextStyle.java ! test/java/time/tck/java/time/format/TCKZoneIdPrinterParser.java + test/java/time/tck/java/time/temporal/TCKChronoField.java + test/java/time/tck/java/time/temporal/TCKChronoUnit.java ! test/java/time/tck/java/time/temporal/TCKWeekFields.java ! test/java/time/tck/java/time/zone/TCKZoneRules.java ! test/java/time/test/java/time/MockSimplePeriod.java ! test/java/time/test/java/time/chrono/TestChronoLocalDate.java ! test/java/time/test/java/time/chrono/TestExampleCode.java ! test/java/time/test/java/time/chrono/TestJapaneseChronoImpl.java ! test/java/time/test/java/time/chrono/TestJapaneseChronology.java ! test/java/time/test/java/time/chrono/TestUmmAlQuraChronology.java ! test/java/time/test/java/time/format/TestDateTimeTextProvider.java ! test/java/time/test/java/time/format/TestNonIsoFormatter.java ! test/java/time/test/java/time/format/TestNumberPrinter.java ! test/java/time/test/java/time/format/TestReducedPrinter.java ! test/java/time/test/java/time/temporal/MockFieldNoValue.java ! test/java/time/test/java/time/temporal/MockFieldValue.java From brian.burkhalter at oracle.com Thu Jul 18 18:16:17 2013 From: brian.burkhalter at oracle.com (Brian Burkhalter) Date: Thu, 18 Jul 2013 11:16:17 -0700 Subject: Java 8 RFR 8020539: Clean up doclint problems in java.util package, part 2 In-Reply-To: <51E77802.8070001@oracle.com> References: <50FE640E-DC42-47F2-9FAD-8472A013EB9B@oracle.com> <51E77802.8070001@oracle.com> Message-ID: <9A6B22F5-51DE-4726-8FC6-3585616852D7@oracle.com> On Jul 17, 2013, at 10:07 PM, Joe Darcy wrote: > In Random.java, I would prefer if the size manipulation of the exponent was removed instead of > > 373 * All 224 possible {@code float} values > > just > > 373 * All 224 possible {@code float} values. I previously made that change and must have inadvertently reverted it. Thanks for the catch. > Also, I think the changes in Scanner would be better of the JLS-style grammar syntax was used, which is what is done in places like java.lang.*. From memory, > > NonTerminal: > First Option of the production > Second Options of the production This I interpret to mean the second example in the first block in this section http://docs.oracle.com/javase/specs/jls/se7/html/jls-2.html#jls-2.4. > Offhand, I wasn't aware Dequeue and Queue were maintained in Doug's CVS, but I agree changes to those files should flow through there first. I shall remove them from the patch. Thanks, Brian From martinrb at google.com Thu Jul 18 18:35:04 2013 From: martinrb at google.com (Martin Buchholz) Date: Thu, 18 Jul 2013 11:35:04 -0700 Subject: Java 8 RFR 8020539: Clean up doclint problems in java.util package, part 2 In-Reply-To: <51E7BBBB.50709@oracle.com> References: <50FE640E-DC42-47F2-9FAD-8472A013EB9B@oracle.com> <72ECBB9D-11EC-4850-ABF6-5DC0E36150F4@oracle.com> <51E7BBBB.50709@oracle.com> Message-ID: As of today, jsr166 CVS src/main is doclint-clean, and will stay that way because of the added in build.xml On Thu, Jul 18, 2013 at 2:56 AM, Chris Hegarty wrote: > Sync's from jsr166 - > jdk8 are in progress. Paul and I have pushed, or > still in flight, a number of changeset over the past number of weeks. I > would hope to have the remainder of changes in jdk8 soon. > > doclint issues should be fixed in jsr166 CVS first. Either work with Doug > or Martin to provide patches based in the CVS source, or wait until jdk8 > catches up, and then the patches should be applicable to both sources ( > accounting for header offset ). > > -Chris. > > > On 18/07/2013 02:03, Martin Buchholz wrote: > >> I'm surprised no one has explained. >> The jsr166 project is upstream of openjdk and is primarily maintained by >> Doug Lea. >> http://gee.cs.oswego.edu/dl/**concurrency-interest/index.**html >> Essentially every file that can be found in Doug's CVS under src/main/util >> is destined for inclusion in openjdk. >> http://gee.cs.oswego.edu/cgi-**bin/viewcvs.cgi/jsr166/src/** >> main/java/util/ >> If modifications are made to openjdk directly, they are at risk of being >> overwritten in the next sync. >> >> I wish syncs from jsr166 => openjdk were more frequent. Certainly right >> now is a good time in the release process to do these kinds of syncs (and >> in fact they are in progress in other changesets). >> >> >> On Wed, Jul 17, 2013 at 4:37 PM, Brian Burkhalter< >> brian.burkhalter at oracle.com> wrote: >> >> I'm not familiar with the JSR 166 CVS so perhaps someone with more >>> history >>> could enlighten me. Otherwise, I would think that any such sync would be >>> the subject of a separate issue. >>> >>> On Jul 17, 2013, at 2:42 PM, Martin Buchholz wrote: >>> >>> I believe most doclint warnings have already been fixed for a while in >>> jsr166 CVS, so please sync Queue.java and Deque.java or leave them out of >>> this change. (More generally, I'd like all of jsr166 CVS sync'ed to >>> openjdk8 asap) >>> >>> >>> >>> From joe.darcy at oracle.com Thu Jul 18 18:50:16 2013 From: joe.darcy at oracle.com (Joe Darcy) Date: Thu, 18 Jul 2013 11:50:16 -0700 Subject: Java 8 RFR 8020539: Clean up doclint problems in java.util package, part 2 In-Reply-To: <9A6B22F5-51DE-4726-8FC6-3585616852D7@oracle.com> References: <50FE640E-DC42-47F2-9FAD-8472A013EB9B@oracle.com> <51E77802.8070001@oracle.com> <9A6B22F5-51DE-4726-8FC6-3585616852D7@oracle.com> Message-ID: <51E838E8.6010201@oracle.com> On 07/18/2013 11:16 AM, Brian Burkhalter wrote: > On Jul 17, 2013, at 10:07 PM, Joe Darcy wrote: > >> In Random.java, I would prefer if the size manipulation of the >> exponent was removed instead of >> >> 373 * All 224 >> possible {@code float} values >> >> just >> >> 373 * All 224 possible {@code float} values. > > I previously made that change and must have inadvertently reverted it. > Thanks for the catch. > >> Also, I think the changes in Scanner would be better of the JLS-style >> grammar syntax was used, which is what is done in places like >> java.lang.*. From memory, >> >> NonTerminal: >> First Option of the production >> Second Options of the production > > This I interpret to mean the second example in the first block in this > section > http://docs.oracle.com/javase/specs/jls/se7/html/jls-2.html#jls-2.4. Right (although the on-line rendering in the browser I'm using while typing this doesn't look very clear in distinguishing the terminals and non-terminals). I've used this notation for grammars in java.lang.Integer and java.lang.Double. > >> Offhand, I wasn't aware Dequeue and Queue were maintained in Doug's >> CVS, but I agree changes to those files should flow through there first. > > I shall remove them from the patch. > > Thanks, > > Brian Thanks, -Joe From joe.darcy at oracle.com Thu Jul 18 18:53:54 2013 From: joe.darcy at oracle.com (Joe Darcy) Date: Thu, 18 Jul 2013 11:53:54 -0700 Subject: Java 8 RFR 8020539: Clean up doclint problems in java.util package, part 2 In-Reply-To: References: <50FE640E-DC42-47F2-9FAD-8472A013EB9B@oracle.com> <72ECBB9D-11EC-4850-ABF6-5DC0E36150F4@oracle.com> <51E7BBBB.50709@oracle.com> Message-ID: <51E839C2.2080203@oracle.com> On 07/18/2013 11:35 AM, Martin Buchholz wrote: > As of today, jsr166 CVS src/main is doclint-clean, and will stay that way > because of the added > > in build.xml Excellent news! Looking forward to the next sync :-) (Note there are some bugs in doclint that are in the process of being fixed so for building with JDK 8, it will be helpful to keep the langtools repo up-to-date.) Thanks, -Joe > > > > On Thu, Jul 18, 2013 at 2:56 AM, Chris Hegarty wrote: > >> Sync's from jsr166 - > jdk8 are in progress. Paul and I have pushed, or >> still in flight, a number of changeset over the past number of weeks. I >> would hope to have the remainder of changes in jdk8 soon. >> >> doclint issues should be fixed in jsr166 CVS first. Either work with Doug >> or Martin to provide patches based in the CVS source, or wait until jdk8 >> catches up, and then the patches should be applicable to both sources ( >> accounting for header offset ). >> >> -Chris. >> >> >> On 18/07/2013 02:03, Martin Buchholz wrote: >> >>> I'm surprised no one has explained. >>> The jsr166 project is upstream of openjdk and is primarily maintained by >>> Doug Lea. >>> http://gee.cs.oswego.edu/dl/**concurrency-interest/index.**html >>> Essentially every file that can be found in Doug's CVS under src/main/util >>> is destined for inclusion in openjdk. >>> http://gee.cs.oswego.edu/cgi-**bin/viewcvs.cgi/jsr166/src/** >>> main/java/util/ >>> If modifications are made to openjdk directly, they are at risk of being >>> overwritten in the next sync. >>> >>> I wish syncs from jsr166 => openjdk were more frequent. Certainly right >>> now is a good time in the release process to do these kinds of syncs (and >>> in fact they are in progress in other changesets). >>> >>> >>> On Wed, Jul 17, 2013 at 4:37 PM, Brian Burkhalter< >>> brian.burkhalter at oracle.com> wrote: >>> >>> I'm not familiar with the JSR 166 CVS so perhaps someone with more >>>> history >>>> could enlighten me. Otherwise, I would think that any such sync would be >>>> the subject of a separate issue. >>>> >>>> On Jul 17, 2013, at 2:42 PM, Martin Buchholz wrote: >>>> >>>> I believe most doclint warnings have already been fixed for a while in >>>> jsr166 CVS, so please sync Queue.java and Deque.java or leave them out of >>>> this change. (More generally, I'd like all of jsr166 CVS sync'ed to >>>> openjdk8 asap) >>>> >>>> >>>> >>>> From chris.hegarty at oracle.com Thu Jul 18 18:57:00 2013 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Thu, 18 Jul 2013 19:57:00 +0100 Subject: Java 8 RFR 8020539: Clean up doclint problems in java.util package, part 2 In-Reply-To: References: <50FE640E-DC42-47F2-9FAD-8472A013EB9B@oracle.com> <72ECBB9D-11EC-4850-ABF6-5DC0E36150F4@oracle.com> <51E7BBBB.50709@oracle.com> Message-ID: <9A8DC0C3-4FD5-4598-B1A0-40187D9EC77F@oracle.com> On 18 Jul 2013, at 19:35, Martin Buchholz wrote: > As of today, jsr166 CVS src/main is doclint-clean, and will stay that way because of the added > > in build.xml > Thanks Martin, we'll sync these changes soon. -Chris > > On Thu, Jul 18, 2013 at 2:56 AM, Chris Hegarty wrote: >> Sync's from jsr166 - > jdk8 are in progress. Paul and I have pushed, or still in flight, a number of changeset over the past number of weeks. I would hope to have the remainder of changes in jdk8 soon. >> >> doclint issues should be fixed in jsr166 CVS first. Either work with Doug or Martin to provide patches based in the CVS source, or wait until jdk8 catches up, and then the patches should be applicable to both sources ( accounting for header offset ). >> >> -Chris. >> >> >> On 18/07/2013 02:03, Martin Buchholz wrote: >>> I'm surprised no one has explained. >>> The jsr166 project is upstream of openjdk and is primarily maintained by >>> Doug Lea. >>> http://gee.cs.oswego.edu/dl/concurrency-interest/index.html >>> Essentially every file that can be found in Doug's CVS under src/main/util >>> is destined for inclusion in openjdk. >>> http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/src/main/java/util/ >>> If modifications are made to openjdk directly, they are at risk of being >>> overwritten in the next sync. >>> >>> I wish syncs from jsr166 => openjdk were more frequent. Certainly right >>> now is a good time in the release process to do these kinds of syncs (and >>> in fact they are in progress in other changesets). >>> >>> >>> On Wed, Jul 17, 2013 at 4:37 PM, Brian Burkhalter< >>> brian.burkhalter at oracle.com> wrote: >>> >>>> I'm not familiar with the JSR 166 CVS so perhaps someone with more history >>>> could enlighten me. Otherwise, I would think that any such sync would be >>>> the subject of a separate issue. >>>> >>>> On Jul 17, 2013, at 2:42 PM, Martin Buchholz wrote: >>>> >>>> I believe most doclint warnings have already been fixed for a while in >>>> jsr166 CVS, so please sync Queue.java and Deque.java or leave them out of >>>> this change. (More generally, I'd like all of jsr166 CVS sync'ed to >>>> openjdk8 asap) > From brian.burkhalter at oracle.com Thu Jul 18 19:04:46 2013 From: brian.burkhalter at oracle.com (Brian Burkhalter) Date: Thu, 18 Jul 2013 12:04:46 -0700 Subject: Java 8 RFR 8020539: Clean up doclint problems in java.util package, part 2 In-Reply-To: <51E838E8.6010201@oracle.com> References: <50FE640E-DC42-47F2-9FAD-8472A013EB9B@oracle.com> <51E77802.8070001@oracle.com> <9A6B22F5-51DE-4726-8FC6-3585616852D7@oracle.com> <51E838E8.6010201@oracle.com> Message-ID: <9D885E93-5582-4C2C-8813-3C605AA19F76@oracle.com> On Jul 18, 2013, at 11:50 AM, Joe Darcy wrote: >> This I interpret to mean the second example in the first block in this section http://docs.oracle.com/javase/specs/jls/se7/html/jls-2.html#jls-2.4. > > Right (although the on-line rendering in the browser I'm using while typing this doesn't look very clear in distinguishing the terminals and non-terminals). > > I've used this notation for grammars in java.lang.Integer and java.lang.Double. I don't at first glance see a mapping of the regular expression "+" (one or more) to something in the JLS grammar. There are ? => [x] zero or one x * => {x} zero or more x but nothing (succinct at least) apparent for the plus sign. Thanks, Brian From brian.burkhalter at oracle.com Thu Jul 18 19:15:36 2013 From: brian.burkhalter at oracle.com (Brian Burkhalter) Date: Thu, 18 Jul 2013 12:15:36 -0700 Subject: Java 8 RFR 8020539: Clean up doclint problems in java.util package, part 2 In-Reply-To: <9D885E93-5582-4C2C-8813-3C605AA19F76@oracle.com> References: <50FE640E-DC42-47F2-9FAD-8472A013EB9B@oracle.com> <51E77802.8070001@oracle.com> <9A6B22F5-51DE-4726-8FC6-3585616852D7@oracle.com> <51E838E8.6010201@oracle.com> <9D885E93-5582-4C2C-8813-3C605AA19F76@oracle.com> Message-ID: <0CBB2332-19B8-4005-B08B-CA7841350FBF@oracle.com> On Jul 18, 2013, at 12:04 PM, Brian Burkhalter wrote: > I don't at first glance see a mapping of the regular expression "+" (one or more) to something in the JLS grammar. There are > > ? => [x] zero or one x > * => {x} zero or more x > > but nothing (succinct at least) apparent for the plus sign. I guess x+ => x {x} would work. Brian From brian.burkhalter at oracle.com Thu Jul 18 21:19:35 2013 From: brian.burkhalter at oracle.com (Brian Burkhalter) Date: Thu, 18 Jul 2013 14:19:35 -0700 Subject: Java 8 RFR 8020539: Clean up doclint problems in java.util package, part 2 In-Reply-To: <51E77802.8070001@oracle.com> References: <50FE640E-DC42-47F2-9FAD-8472A013EB9B@oracle.com> <51E77802.8070001@oracle.com> Message-ID: <67232DB5-4077-4A4D-9729-B06C7FD911BF@oracle.com> On Jul 17, 2013, at 10:07 PM, Joe Darcy wrote: > In Random.java, I would prefer if the size manipulation of the exponent was removed instead of > > 373 * All 224 possible {@code float} values > > just > > 373 * All 224 possible {@code float} values. Done. > Also, I think the changes in Scanner would be better of the JLS-style grammar syntax was used, which is what is done in places like java.lang.*. From memory, > > NonTerminal: > First Option of the production > Second Options of the production Changes made but I'm not sure that they are exactly as expected: http://cr.openjdk.java.net/~bpb/Scanner.html > Offhand, I wasn't aware Dequeue and Queue were maintained in Doug's CVS, but I agree changes to those files should flow through there first. Deque and Queue removed from the webrev: http://cr.openjdk.java.net/~bpb/8020539/ Thanks, Brian From brian.burkhalter at oracle.com Thu Jul 18 22:20:44 2013 From: brian.burkhalter at oracle.com (Brian Burkhalter) Date: Thu, 18 Jul 2013 15:20:44 -0700 Subject: Java 8 RFR 6476168: (fmt) Inconsistency formatting subnormal doubles with hexadecimal conversion In-Reply-To: <51E77DA2.1050304@oracle.com> References: <23721DCA-F2A2-4B97-9CC0-56151ACD7E95@oracle.com> <51E77DA2.1050304@oracle.com> Message-ID: <8D0EE76E-9C2E-4D5F-B687-E7D154AE4A30@oracle.com> Hi Joe, On Jul 17, 2013, at 10:31 PM, Joe Darcy wrote: > In the javadoc change, is there a reason for > > [1, 12], > > rather than just > > [1, 12], > > ? Not really. > The update should discuss how normal (that is non-subnormal) values are handled with reduced precision. > > The change should include tests of the newly specified behavior. The requested changes have been made, tested, and incorporated into the webrev http://cr.openjdk.java.net/~bpb/6476168/ Thanks, Brian From kasperni at gmail.com Fri Jul 19 05:05:47 2013 From: kasperni at gmail.com (Kasper Nielsen) Date: Fri, 19 Jul 2013 07:05:47 +0200 Subject: class SplittableRandom In-Reply-To: <51DDB26D.8050506@cs.oswego.edu> References: <51DDB26D.8050506@cs.oswego.edu> Message-ID: Telling people that your random source passes the die-hard test but at the same time only using the current time as the seed is just pure evil. Imagine spinning up a couple of thousands images with a JVM on Amazon. You are going to see collisions among the seed values a lot sooner than you think. Especially if the granularity of System.nanoTime() is not actual 1 nanosecond. You need to use some kind of random source for the seeding or at least mix in the process ID/host ID with the current time. Obviously RDRAND would be a good choice if available. This is a problem Random and TLR suffers from as well. Also I'm really worried about the seed value of just 64 bit. That is not a lot if SR is sold as a quality random number generator. People are going to experience collisions (albeit rarely) while using it. - Kasper From joe.darcy at oracle.com Fri Jul 19 05:53:21 2013 From: joe.darcy at oracle.com (Joe Darcy) Date: Thu, 18 Jul 2013 22:53:21 -0700 Subject: JDK 8 request for review for JDK-8020810: Typo in javadoc for Class.toGenericString() Message-ID: <51E8D451.70503@oracle.com> Hello, Please review the patch below which addresses JDK-8020810: Typo in javadoc for Class.toGenericString() A note of explanation for the change in j.l.Class, the essence of the change is replacing {@code @interface} with @{@code interface} The construct "{@code @interface}" doesn't render right; the literal text "@" is output rather than "@". However, "@" is problematic inside {@oode } since it gets confused as a javadoc tag. Likewise, "@" doesn't work for the same reason. In the end, "@{@code interface}" gives the desired output of "@interface". As a bonus, a javadoc issue in j.l.r.Parameter is fixed too. Thanks, -Joe --- a/src/share/classes/java/lang/Class.java Wed Jul 17 00:34:39 2013 -0700 +++ b/src/share/classes/java/lang/Class.java Thu Jul 18 22:48:04 2013 -0700 @@ -157,10 +157,10 @@ * * The string is formatted as a list of type modifiers, if any, * followed by the kind of type (empty string for primitive types - * and {@code class}, {@code enum}, {@code interface}, or {@code - * @interface}, as appropriate), followed by the type's name, - * followed by an angle-bracketed comma-separated list of the - * type's type parameters, if any. + * and {@code class}, {@code enum}, {@code interface}, or + * @{@code interface}, as appropriate), followed + * by the type's name, followed by an angle-bracketed + * comma-separated list of the type's type parameters, if any. * * A space is used to separate modifiers from one another and to * separate any modifiers from the kind of type. The modifiers diff -r cbdd2529d93a src/share/classes/java/lang/reflect/Parameter.java --- a/src/share/classes/java/lang/reflect/Parameter.java Wed Jul 17 00:34:39 2013 -0700 +++ b/src/share/classes/java/lang/reflect/Parameter.java Thu Jul 18 22:48:04 2013 -0700 @@ -162,7 +162,7 @@ /** * Returns the name of the parameter. If the parameter's name is - * {@linkplain isNamePresent() present}, then this method returns + * {@linkplain #isNamePresent() present}, then this method returns * the name provided by the class file. Otherwise, this method * synthesizes a name of the form argN, where N is the index of * the parameter in the descriptor of the method which declares From david.holmes at oracle.com Fri Jul 19 06:11:52 2013 From: david.holmes at oracle.com (David Holmes) Date: Fri, 19 Jul 2013 16:11:52 +1000 Subject: JDK 8 request for review for JDK-8020810: Typo in javadoc for Class.toGenericString() In-Reply-To: <51E8D451.70503@oracle.com> References: <51E8D451.70503@oracle.com> Message-ID: <51E8D8A8.8040501@oracle.com> I believe you. Ship it! :) David On 19/07/2013 3:53 PM, Joe Darcy wrote: > Hello, > > Please review the patch below which addresses > > JDK-8020810: Typo in javadoc for Class.toGenericString() > > A note of explanation for the change in j.l.Class, the essence of the > change is replacing > > {@code @interface} > > with > > @{@code interface} > > The construct "{@code @interface}" doesn't render right; the literal > text "@" is output rather than "@". However, "@" is problematic > inside {@oode } since it gets confused as a javadoc tag. Likewise, > "@" doesn't work for the same reason. In the end, > "@{@code interface}" gives the desired output of > "@interface". > > As a bonus, a javadoc issue in j.l.r.Parameter is fixed too. > > Thanks, > > -Joe > > --- a/src/share/classes/java/lang/Class.java Wed Jul 17 00:34:39 2013 > -0700 > +++ b/src/share/classes/java/lang/Class.java Thu Jul 18 22:48:04 2013 > -0700 > @@ -157,10 +157,10 @@ > * > * The string is formatted as a list of type modifiers, if any, > * followed by the kind of type (empty string for primitive types > - * and {@code class}, {@code enum}, {@code interface}, or {@code > - * @interface}, as appropriate), followed by the type's name, > - * followed by an angle-bracketed comma-separated list of the > - * type's type parameters, if any. > + * and {@code class}, {@code enum}, {@code interface}, or > + * @{@code interface}, as appropriate), followed > + * by the type's name, followed by an angle-bracketed > + * comma-separated list of the type's type parameters, if any. > * > * A space is used to separate modifiers from one another and to > * separate any modifiers from the kind of type. The modifiers > diff -r cbdd2529d93a src/share/classes/java/lang/reflect/Parameter.java > --- a/src/share/classes/java/lang/reflect/Parameter.java Wed Jul 17 > 00:34:39 2013 -0700 > +++ b/src/share/classes/java/lang/reflect/Parameter.java Thu Jul 18 > 22:48:04 2013 -0700 > @@ -162,7 +162,7 @@ > > /** > * Returns the name of the parameter. If the parameter's name is > - * {@linkplain isNamePresent() present}, then this method returns > + * {@linkplain #isNamePresent() present}, then this method returns > * the name provided by the class file. Otherwise, this method > * synthesizes a name of the form argN, where N is the index of > * the parameter in the descriptor of the method which declares > From joe.darcy at oracle.com Fri Jul 19 06:17:49 2013 From: joe.darcy at oracle.com (Joe Darcy) Date: Thu, 18 Jul 2013 23:17:49 -0700 Subject: JDK 8 request for review for JDK-8020810: Typo in javadoc for Class.toGenericString() In-Reply-To: <51E8D8A8.8040501@oracle.com> References: <51E8D451.70503@oracle.com> <51E8D8A8.8040501@oracle.com> Message-ID: <51E8DA0D.90208@oracle.com> Shipped! Thanks for the quick review :-) -Joe On 07/18/2013 11:11 PM, David Holmes wrote: > I believe you. > > Ship it! :) > > David > > On 19/07/2013 3:53 PM, Joe Darcy wrote: >> Hello, >> >> Please review the patch below which addresses >> >> JDK-8020810: Typo in javadoc for Class.toGenericString() >> >> A note of explanation for the change in j.l.Class, the essence of the >> change is replacing >> >> {@code @interface} >> >> with >> >> @{@code interface} >> >> The construct "{@code @interface}" doesn't render right; the literal >> text "@" is output rather than "@". However, "@" is problematic >> inside {@oode } since it gets confused as a javadoc tag. Likewise, >> "@" doesn't work for the same reason. In the end, >> "@{@code interface}" gives the desired output of >> "@interface". >> >> As a bonus, a javadoc issue in j.l.r.Parameter is fixed too. >> >> Thanks, >> >> -Joe >> >> --- a/src/share/classes/java/lang/Class.java Wed Jul 17 00:34:39 2013 >> -0700 >> +++ b/src/share/classes/java/lang/Class.java Thu Jul 18 22:48:04 2013 >> -0700 >> @@ -157,10 +157,10 @@ >> * >> * The string is formatted as a list of type modifiers, if any, >> * followed by the kind of type (empty string for primitive types >> - * and {@code class}, {@code enum}, {@code interface}, or {@code >> - * @interface}, as appropriate), followed by the type's name, >> - * followed by an angle-bracketed comma-separated list of the >> - * type's type parameters, if any. >> + * and {@code class}, {@code enum}, {@code interface}, or >> + * @{@code interface}, as appropriate), followed >> + * by the type's name, followed by an angle-bracketed >> + * comma-separated list of the type's type parameters, if any. >> * >> * A space is used to separate modifiers from one another and to >> * separate any modifiers from the kind of type. The modifiers >> diff -r cbdd2529d93a src/share/classes/java/lang/reflect/Parameter.java >> --- a/src/share/classes/java/lang/reflect/Parameter.java Wed Jul 17 >> 00:34:39 2013 -0700 >> +++ b/src/share/classes/java/lang/reflect/Parameter.java Thu Jul 18 >> 22:48:04 2013 -0700 >> @@ -162,7 +162,7 @@ >> >> /** >> * Returns the name of the parameter. If the parameter's name is >> - * {@linkplain isNamePresent() present}, then this method returns >> + * {@linkplain #isNamePresent() present}, then this method returns >> * the name provided by the class file. Otherwise, this method >> * synthesizes a name of the form argN, where N is the index of >> * the parameter in the descriptor of the method which declares >> From joe.darcy at oracle.com Fri Jul 19 06:38:36 2013 From: joe.darcy at oracle.com (Joe Darcy) Date: Thu, 18 Jul 2013 23:38:36 -0700 Subject: JDK 8 request for review: doclint fixes for some package-info files Message-ID: <51E8DEEC.2070002@oracle.com> Hello, A few more doclint issues, this time in package-info.java files, will be resolved by the patch below. Thanks, -Joe /* - * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,7 +27,7 @@ * Interfaces and classes providing access to file and file system attributes. * *
Classes for Unicode scripts, blocks, categories and binary properties
- * + * * * * @@ -38,7 +38,7 @@ * * * - * + * * * * @@ -86,14 +86,14 @@ * *
    * - *

  • The {@link java.nio.file.attribute.UserPrincipal} and + *
  • The {@link java.nio.file.attribute.UserPrincipal} and * {@link java.nio.file.attribute.GroupPrincipal} interfaces represent an * identity or group identity.
  • * - *

  • The {@link java.nio.file.attribute.UserPrincipalLookupService} + *
  • The {@link java.nio.file.attribute.UserPrincipalLookupService} * interface defines methods to lookup user or group principals.
  • * - *

  • The {@link java.nio.file.attribute.FileAttribute} interface + *
  • The {@link java.nio.file.attribute.FileAttribute} interface * represents the value of an attribute for cases where the attribute value is * required to be set atomically when creating an object in the file system.
  • * diff -r 2323b973adaa src/share/classes/java/util/function/package-info.java --- a/src/share/classes/java/util/function/package-info.java Thu Jul 18 23:16:52 2013 -0700 +++ b/src/share/classes/java/util/function/package-info.java Thu Jul 18 23:37:48 2013 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,13 +30,13 @@ * adapted. Functional interfaces can provide a target type in multiple contexts, * such as assignment context, method invocation, or cast context: * - *
    - *     Predicate<String> p = String::isEmpty;
    + * 
    {@code
    + *     Predicate p = String::isEmpty;
       *
       *     stream.filter(e -> e.getSize() > 10)...
       *
       *     stream.map((ToIntFunction) e -> e.getSize())...
    - * 
    + * }
    * *

    The interfaces in this package are functional interfaces used by the JDK, * and are available to be used by user code as well. While they do not identify From joe.darcy at oracle.com Fri Jul 19 06:17:08 2013 From: joe.darcy at oracle.com (joe.darcy at oracle.com) Date: Fri, 19 Jul 2013 06:17:08 +0000 Subject: hg: jdk8/tl/jdk: 8020810: Typo in javadoc for Class.toGenericString() Message-ID: <20130719061730.5701448202@hg.openjdk.java.net> Changeset: 2323b973adaa Author: darcy Date: 2013-07-18 23:16 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/2323b973adaa 8020810: Typo in javadoc for Class.toGenericString() Reviewed-by: dholmes ! src/share/classes/java/lang/Class.java ! src/share/classes/java/lang/reflect/Parameter.java From david.holmes at oracle.com Fri Jul 19 07:04:48 2013 From: david.holmes at oracle.com (David Holmes) Date: Fri, 19 Jul 2013 17:04:48 +1000 Subject: JDK 8 request for review: doclint fixes for some package-info files In-Reply-To: <51E8DEEC.2070002@oracle.com> References: <51E8DEEC.2070002@oracle.com> Message-ID: <51E8E510.1080206@oracle.com> Ship it! :) David On 19/07/2013 4:38 PM, Joe Darcy wrote: > Hello, > > A few more doclint issues, this time in package-info.java files, will be > resolved by the patch below. > > Thanks, > > -Joe > > /* > - * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights > reserved. > + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights > reserved. > * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. > * > * This code is free software; you can redistribute it and/or modify it > @@ -27,7 +27,7 @@ > * Interfaces and classes providing access to file and file system > attributes. > * > *

Attribute views

Description

Attribute viewsDescription
{@link java.nio.file.attribute.AttributeView}Can read or update non-opaque values associated with objects in a file system
  {@link java.nio.file.attribute.FileAttributeView}Can read or update POSIX defined file attributes
      {@link java.nio.file.attribute.DosFileAttributeView}  Can read or update FAT file attributes
    {@link java.nio.file.attribute.FileOwnerAttributeView}  
    {@link java.nio.file.attribute.FileOwnerAttributeView}  Can read or update the owner of a file
     {@link java.nio.file.attribute.AclFileAttributeView}  Can read or update Access Control Lists
> - * > + * > * > * > * > @@ -38,7 +38,7 @@ > * > * > * > - * > + * > * > * > * > @@ -86,14 +86,14 @@ > * > *
    > * > - *

  • The {@link java.nio.file.attribute.UserPrincipal} and > + *
  • The {@link java.nio.file.attribute.UserPrincipal} and > * {@link java.nio.file.attribute.GroupPrincipal} interfaces > represent an > * identity or group identity.
  • > * > - *

  • The {@link > java.nio.file.attribute.UserPrincipalLookupService} > + *
  • The {@link java.nio.file.attribute.UserPrincipalLookupService} > * interface defines methods to lookup user or group principals.
  • > * > - *

  • The {@link java.nio.file.attribute.FileAttribute} interface > + *
  • The {@link java.nio.file.attribute.FileAttribute} interface > * represents the value of an attribute for cases where the > attribute value is > * required to be set atomically when creating an object in the file > system.
  • > * > diff -r 2323b973adaa src/share/classes/java/util/function/package-info.java > --- a/src/share/classes/java/util/function/package-info.java Thu Jul > 18 23:16:52 2013 -0700 > +++ b/src/share/classes/java/util/function/package-info.java Thu Jul > 18 23:37:48 2013 -0700 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights > reserved. > + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights > reserved. > * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. > * > * This code is free software; you can redistribute it and/or modify it > @@ -30,13 +30,13 @@ > * adapted. Functional interfaces can provide a target type in > multiple contexts, > * such as assignment context, method invocation, or cast context: > * > - *
    > - *     Predicate<String> p = String::isEmpty;
    > + * 
    {@code
    > + *     Predicate p = String::isEmpty;
    >    *
    >    *     stream.filter(e -> e.getSize() > 10)...
    >    *
    >    *     stream.map((ToIntFunction) e -> e.getSize())...
    > - * 
    > + * }
    > * > *

    The interfaces in this package are functional interfaces used by > the JDK, > * and are available to be used by user code as well. While they do > not identify > From chris.hegarty at oracle.com Fri Jul 19 08:30:38 2013 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Fri, 19 Jul 2013 09:30:38 +0100 Subject: JDK 8 request for review: doclint fixes for some package-info files In-Reply-To: <51E8E510.1080206@oracle.com> References: <51E8DEEC.2070002@oracle.com> <51E8E510.1080206@oracle.com> Message-ID: <51E8F92E.2000005@oracle.com> On 07/19/2013 08:04 AM, David Holmes wrote: > Ship it! :) +1 -Chris. > > David > > On 19/07/2013 4:38 PM, Joe Darcy wrote: >> Hello, >> >> A few more doclint issues, this time in package-info.java files, will be >> resolved by the patch below. >> >> Thanks, >> >> -Joe >> >> /* >> - * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights >> reserved. >> + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights >> reserved. >> * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. >> * >> * This code is free software; you can redistribute it and/or modify it >> @@ -27,7 +27,7 @@ >> * Interfaces and classes providing access to file and file system >> attributes. >> * >> *

Attribute views

align="left">Description

Attribute views align="left">Description
{@link > java.nio.file.attribute.AttributeView}Can read or update non-opaque values associated with > objects in a file system
  {@link > java.nio.file.attribute.FileAttributeView}Can read or update POSIX defined file attributes
valign=top>      {@link > java.nio.file.attribute.DosFileAttributeView}  Can read or update FAT file attributes
    {@link > java.nio.file.attribute.FileOwnerAttributeView}  
    {@link > java.nio.file.attribute.FileOwnerAttributeView}  Can read or update the owner of a file
     {@link > java.nio.file.attribute.AclFileAttributeView}  Can read or update Access Control Lists
>> - * >> + * >> * >> * >> * >> @@ -38,7 +38,7 @@ >> * >> * >> * >> - * >> + * >> * >> * >> * >> @@ -86,14 +86,14 @@ >> * >> *

Attribute views

> align="left">Description

Attribute views> align="left">Description
{@link >> java.nio.file.attribute.AttributeView}Can read or update non-opaque values associated with >> objects in a file system
  {@link >> java.nio.file.attribute.FileAttributeView}Can read or update POSIX defined file attributes
> valign=top>      {@link >> java.nio.file.attribute.DosFileAttributeView}  Can read or update FAT file attributes
    {@link >> java.nio.file.attribute.FileOwnerAttributeView}  
    {@link >> java.nio.file.attribute.FileOwnerAttributeView}  Can read or update the owner of a file
     {@link >> java.nio.file.attribute.AclFileAttributeView}  Can read or update Access Control Lists
- * + * * * * @@ -110,7 +110,7 @@ * write them to a given writable byte channel. * *

Channels

Description

ChannelsDescription
{@link java.nio.channels.Channel}A nexus for I/O operations
  {@link java.nio.channels.ReadableByteChannel}
- * + * * * * @@ -138,7 +138,7 @@ * * *

File channels

Description

File channelsDescription
{@link java.nio.channels.FileChannel}Reads, writes, maps, and manipulates files
{@link java.nio.channels.FileLock}
- * + * * * * @@ -225,7 +225,7 @@ * * *

Multiplexed, non-blocking I/O

Description

Multiplexed, non-blocking I/O

Description

{@link java.nio.channels.SelectableChannel}A channel that can be multiplexed
  {@link java.nio.channels.DatagramChannel}
- * + * * * * diff -r e013b32118af src/share/classes/java/nio/charset/Charset.java --- a/src/share/classes/java/nio/charset/Charset.java Fri Jul 19 09:42:58 2013 -0700 +++ b/src/share/classes/java/nio/charset/Charset.java Sat Jul 20 10:15:03 2013 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -65,7 +65,7 @@ * concurrent threads. * * - * + * *

Charset names

* *

Charsets are named by strings composed of the following characters: @@ -111,21 +111,17 @@ * The aliases of a charset are returned by the {@link #aliases() aliases} * method. * - * - * - *

Some charsets have an historical name that is defined for - * compatibility with previous versions of the Java platform. A charset's + *

Some charsets have an historical name that is defined for + * compatibility with previous versions of the Java platform. A charset's * historical name is either its canonical name or one of its aliases. The * historical name is returned by the getEncoding() methods of the * {@link java.io.InputStreamReader#getEncoding InputStreamReader} and {@link * java.io.OutputStreamWriter#getEncoding OutputStreamWriter} classes. * - * - * - *

If a charset listed in the If a charset listed in the IANA Charset * Registry is supported by an implementation of the Java platform then - * its canonical name must be the name listed in the registry. Many charsets + * its canonical name must be the name listed in the registry. Many charsets * are given more than one name in the registry, in which case the registry * identifies one of the names as MIME-preferred. If a charset has more * than one registry name then its canonical name must be the MIME-preferred @@ -142,15 +138,15 @@ * *

Standard charsets

* - * + * * - *

Every implementation of the Java platform is required to support the - * following standard charsets. Consult the release documentation for your + *

Every implementation of the Java platform is required to support the + * following standard charsets. Consult the release documentation for your * implementation to see if any other charsets are supported. The behavior * of such optional charsets may differ between implementations. * *

Asynchronous I/O

Description

Asynchronous I/ODescription
{@link java.nio.channels.AsynchronousFileChannel}An asynchronous channel for reading, writing, and manipulating a file
{@link java.nio.channels.AsynchronousSocketChannel}
- * + * * * diff -r e013b32118af src/share/classes/java/nio/charset/MalformedInputException.java --- a/src/share/classes/java/nio/charset/MalformedInputException.java Fri Jul 19 09:42:58 2013 -0700 +++ b/src/share/classes/java/nio/charset/MalformedInputException.java Sat Jul 20 10:15:03 2013 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,14 +42,27 @@ private int inputLength; + /** + * Constructs an {@code MalformedInputException} with the given + * length. + * @param inputLength the length of the input + */ public MalformedInputException(int inputLength) { this.inputLength = inputLength; } + /** + * Returns the length of the input. + * @return the length of the input + */ public int getInputLength() { return inputLength; } + /** + * Returns the message. + * @return the message + */ public String getMessage() { return "Input length = " + inputLength; } diff -r e013b32118af src/share/classes/java/nio/charset/UnmappableCharacterException.java --- a/src/share/classes/java/nio/charset/UnmappableCharacterException.java Fri Jul 19 09:42:58 2013 -0700 +++ b/src/share/classes/java/nio/charset/UnmappableCharacterException.java Sat Jul 20 10:15:03 2013 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,14 +42,27 @@ private int inputLength; + /** + * Constructs an {@code UnmappableCharacterException} with the + * given length. + * @param inputLength the length of the input + */ public UnmappableCharacterException(int inputLength) { this.inputLength = inputLength; } + /** + * Returns the length of the input. + * @return the length of the input + */ public int getInputLength() { return inputLength; } + /** + * Returns the message. + * @return the message + */ public String getMessage() { return "Input length = " + inputLength; } diff -r e013b32118af src/share/classes/java/nio/file/package-info.java --- a/src/share/classes/java/nio/file/package-info.java Fri Jul 19 09:42:58 2013 -0700 +++ b/src/share/classes/java/nio/file/package-info.java Sat Jul 20 10:15:03 2013 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,8 +33,8 @@ * package is used by service provider implementors wishing to extend the * platform default provider, or to construct other provider implementations.

* - *

Symbolic Links

- * Many operating systems and file systems support for symbolic links. + *

Symbolic Links

+ *

Many operating systems and file systems support for symbolic links. * A symbolic link is a special file that serves as a reference to another file. * For the most part, symbolic links are transparent to applications and * operations on symbolic links are automatically redirected to the target @@ -45,8 +45,8 @@ * that are semantically close but support for these other types of links is * not included in this package.

* - *

Interoperability

- * The {@link java.io.File} class defines the {@link java.io.File#toPath + *

Interoperability

+ *

The {@link java.io.File} class defines the {@link java.io.File#toPath * toPath} method to construct a {@link java.nio.file.Path} by converting * the abstract path represented by the {@code java.io.File} object. The resulting * {@code Path} can be used to operate on the same file as the {@code File} @@ -55,7 +55,7 @@ * and {@code java.io.File} objects.

* *

Visibility

- * The view of the files and file system provided by classes in this package are + *

The view of the files and file system provided by classes in this package are * guaranteed to be consistent with other views provided by other instances in the * same Java virtual machine. The view may or may not, however, be consistent with * the view of the file system as seen by other concurrently running programs due @@ -65,8 +65,8 @@ * or on some other machine. The exact nature of any such inconsistencies are * system-dependent and are therefore unspecified.

* - *

Synchronized I/O File Integrity

- * The {@link java.nio.file.StandardOpenOption#SYNC SYNC} and {@link + *

Synchronized I/O File Integrity

+ *

The {@link java.nio.file.StandardOpenOption#SYNC SYNC} and {@link * java.nio.file.StandardOpenOption#DSYNC DSYNC} options are used when opening a file * to require that updates to the file are written synchronously to the underlying * storage device. In the case of the default provider, and the file resides on @@ -83,7 +83,7 @@ * specific.

* *

General Exceptions

- * Unless otherwise noted, passing a {@code null} argument to a constructor + *

Unless otherwise noted, passing a {@code null} argument to a constructor * or method of any class or interface in this package will cause a {@link * java.lang.NullPointerException NullPointerException} to be thrown. Additionally, * invoking a method with a collection containing a {@code null} element will From lance.andersen at oracle.com Sat Jul 20 17:44:20 2013 From: lance.andersen at oracle.com (Lance @ Oracle) Date: Sat, 20 Jul 2013 13:44:20 -0400 Subject: JDK 8 RFR java.nio doclint fixes In-Reply-To: <51EAC623.2080101@oracle.com> References: <51EAC623.2080101@oracle.com> Message-ID: <3C3D857C-15E0-41A2-AEE7-CD43CA3F6508@oracle.com> Looks fine joe Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 Oracle Java Engineering 1 Network Drive Burlington, MA 01803 Lance.Andersen at oracle.com Sent from my iPad On Jul 20, 2013, at 1:17 PM, Joe Darcy wrote: > Hello, > > Please review the latest batch of doclint fixes, this time java.nio.*. > > Thanks, > > -Joe > > diff -r e013b32118af src/share/classes/java/nio/channels/package-info.java > --- a/src/share/classes/java/nio/channels/package-info.java Fri Jul 19 09:42:58 2013 -0700 > +++ b/src/share/classes/java/nio/channels/package-info.java Sat Jul 20 10:15:03 2013 -0700 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. > + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. > * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. > * > * This code is free software; you can redistribute it and/or modify it > @@ -31,7 +31,7 @@ > * > * > *

Charset

Description

CharsetDescription
US-ASCIISeven-bit ASCII, a.k.a. ISO646-US, * a.k.a. the Basic Latin block of the Unicode character set
> - * > + * > * > * > * > @@ -110,7 +110,7 @@ > * write them to a given writable byte channel. > * > *

Channels

Description

ChannelsDescription
{@link java.nio.channels.Channel}A nexus for I/O operations
  {@link java.nio.channels.ReadableByteChannel}
> - * > + * > * > * > * > @@ -138,7 +138,7 @@ > * > * > *

File channels

Description

File channelsDescription
{@link java.nio.channels.FileChannel}Reads, writes, maps, and manipulates files
{@link java.nio.channels.FileLock}
> - * > > + * > * > * > * > @@ -225,7 +225,7 @@ > * > * > *

Multiplexed, non-blocking I/O

Description

Multiplexed, non-blocking I/O

Description

{@link java.nio.channels.SelectableChannel}A channel that can be multiplexed
  {@link java.nio.channels.DatagramChannel}
> - * > + * > * > * > * > diff -r e013b32118af src/share/classes/java/nio/charset/Charset.java > --- a/src/share/classes/java/nio/charset/Charset.java Fri Jul 19 09:42:58 2013 -0700 > +++ b/src/share/classes/java/nio/charset/Charset.java Sat Jul 20 10:15:03 2013 -0700 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. > + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. > * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. > * > * This code is free software; you can redistribute it and/or modify it > @@ -65,7 +65,7 @@ > * concurrent threads. > * > * > - * > + * > *

Charset names

> * > *

Charsets are named by strings composed of the following characters: > @@ -111,21 +111,17 @@ > * The aliases of a charset are returned by the {@link #aliases() aliases} > * method. > * > - * > - * > - *

Some charsets have an historical name that is defined for > - * compatibility with previous versions of the Java platform. A charset's > + *

Some charsets have an historical name that is defined for > + * compatibility with previous versions of the Java platform. A charset's > * historical name is either its canonical name or one of its aliases. The > * historical name is returned by the getEncoding() methods of the > * {@link java.io.InputStreamReader#getEncoding InputStreamReader} and {@link > * java.io.OutputStreamWriter#getEncoding OutputStreamWriter} classes. > * > - * > - * > - *

If a charset listed in the + *

If a charset listed in the * href="http://www.iana.org/assignments/character-sets">IANA Charset > * Registry is supported by an implementation of the Java platform then > - * its canonical name must be the name listed in the registry. Many charsets > + * its canonical name must be the name listed in the registry. Many charsets > * are given more than one name in the registry, in which case the registry > * identifies one of the names as MIME-preferred. If a charset has more > * than one registry name then its canonical name must be the MIME-preferred > @@ -142,15 +138,15 @@ > * > *

Standard charsets

> * > - * > + * > * > - *

Every implementation of the Java platform is required to support the > - * following standard charsets. Consult the release documentation for your > + *

Every implementation of the Java platform is required to support the > + * following standard charsets. Consult the release documentation for your > * implementation to see if any other charsets are supported. The behavior > * of such optional charsets may differ between implementations. > * > *

Asynchronous I/O

Description

Asynchronous I/ODescription
{@link java.nio.channels.AsynchronousFileChannel}An asynchronous channel for reading, writing, and manipulating a file
{@link java.nio.channels.AsynchronousSocketChannel}
> - * > + * > * > * > diff -r e013b32118af src/share/classes/java/nio/charset/MalformedInputException.java > --- a/src/share/classes/java/nio/charset/MalformedInputException.java Fri Jul 19 09:42:58 2013 -0700 > +++ b/src/share/classes/java/nio/charset/MalformedInputException.java Sat Jul 20 10:15:03 2013 -0700 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved. > + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. > * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. > * > * This code is free software; you can redistribute it and/or modify it > @@ -42,14 +42,27 @@ > > private int inputLength; > > + /** > + * Constructs an {@code MalformedInputException} with the given > + * length. > + * @param inputLength the length of the input > + */ > public MalformedInputException(int inputLength) { > this.inputLength = inputLength; > } > > + /** > + * Returns the length of the input. > + * @return the length of the input > + */ > public int getInputLength() { > return inputLength; > } > > + /** > + * Returns the message. > + * @return the message > + */ > public String getMessage() { > return "Input length = " + inputLength; > } > diff -r e013b32118af src/share/classes/java/nio/charset/UnmappableCharacterException.java > --- a/src/share/classes/java/nio/charset/UnmappableCharacterException.java Fri Jul 19 09:42:58 2013 -0700 > +++ b/src/share/classes/java/nio/charset/UnmappableCharacterException.java Sat Jul 20 10:15:03 2013 -0700 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 2001, 2007, Oracle and/or its affiliates. All rights reserved. > + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. > * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. > * > * This code is free software; you can redistribute it and/or modify it > @@ -42,14 +42,27 @@ > > private int inputLength; > > + /** > + * Constructs an {@code UnmappableCharacterException} with the > + * given length. > + * @param inputLength the length of the input > + */ > public UnmappableCharacterException(int inputLength) { > this.inputLength = inputLength; > } > > + /** > + * Returns the length of the input. > + * @return the length of the input > + */ > public int getInputLength() { > return inputLength; > } > > + /** > + * Returns the message. > + * @return the message > + */ > public String getMessage() { > return "Input length = " + inputLength; > } > diff -r e013b32118af src/share/classes/java/nio/file/package-info.java > --- a/src/share/classes/java/nio/file/package-info.java Fri Jul 19 09:42:58 2013 -0700 > +++ b/src/share/classes/java/nio/file/package-info.java Sat Jul 20 10:15:03 2013 -0700 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved. > + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. > * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. > * > * This code is free software; you can redistribute it and/or modify it > @@ -33,8 +33,8 @@ > * package is used by service provider implementors wishing to extend the > * platform default provider, or to construct other provider implementations.

> * > - *

Symbolic Links

> - * Many operating systems and file systems support for symbolic links. > + *

Symbolic Links

> + *

Many operating systems and file systems support for symbolic links. > * A symbolic link is a special file that serves as a reference to another file. > * For the most part, symbolic links are transparent to applications and > * operations on symbolic links are automatically redirected to the target > @@ -45,8 +45,8 @@ > * that are semantically close but support for these other types of links is > * not included in this package.

> * > - *

Interoperability

> - * The {@link java.io.File} class defines the {@link java.io.File#toPath > + *

Interoperability

> + *

The {@link java.io.File} class defines the {@link java.io.File#toPath > * toPath} method to construct a {@link java.nio.file.Path} by converting > * the abstract path represented by the {@code java.io.File} object. The resulting > * {@code Path} can be used to operate on the same file as the {@code File} > @@ -55,7 +55,7 @@ > * and {@code java.io.File} objects.

> * > *

Visibility

> - * The view of the files and file system provided by classes in this package are > + *

The view of the files and file system provided by classes in this package are > * guaranteed to be consistent with other views provided by other instances in the > * same Java virtual machine. The view may or may not, however, be consistent with > * the view of the file system as seen by other concurrently running programs due > @@ -65,8 +65,8 @@ > * or on some other machine. The exact nature of any such inconsistencies are > * system-dependent and are therefore unspecified.

> * > - *

Synchronized I/O File Integrity

> - * The {@link java.nio.file.StandardOpenOption#SYNC SYNC} and {@link > + *

Synchronized I/O File Integrity

> + *

The {@link java.nio.file.StandardOpenOption#SYNC SYNC} and {@link > * java.nio.file.StandardOpenOption#DSYNC DSYNC} options are used when opening a file > * to require that updates to the file are written synchronously to the underlying > * storage device. In the case of the default provider, and the file resides on > @@ -83,7 +83,7 @@ > * specific.

> * > *

General Exceptions

> - * Unless otherwise noted, passing a {@code null} argument to a constructor > + *

Unless otherwise noted, passing a {@code null} argument to a constructor > * or method of any class or interface in this package will cause a {@link > * java.lang.NullPointerException NullPointerException} to be thrown. Additionally, > * invoking a method with a collection containing a {@code null} element will > From joe.darcy at oracle.com Sat Jul 20 18:40:28 2013 From: joe.darcy at oracle.com (joe.darcy at oracle.com) Date: Sat, 20 Jul 2013 18:40:28 +0000 Subject: hg: jdk8/tl/jdk: 8020971: Fix doclint issues in java.nio.* Message-ID: <20130720184054.B221A48243@hg.openjdk.java.net> Changeset: 4bd04969a228 Author: darcy Date: 2013-07-20 11:39 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/4bd04969a228 8020971: Fix doclint issues in java.nio.* Reviewed-by: lancea ! src/share/classes/java/nio/channels/package-info.java ! src/share/classes/java/nio/charset/Charset.java ! src/share/classes/java/nio/charset/MalformedInputException.java ! src/share/classes/java/nio/charset/UnmappableCharacterException.java ! src/share/classes/java/nio/file/package-info.java From ivan.gerasimov at oracle.com Sat Jul 20 22:15:27 2013 From: ivan.gerasimov at oracle.com (Ivan Gerasimov) Date: Sun, 21 Jul 2013 02:15:27 +0400 Subject: RFR [8020669] java.nio.file.Files.readAllBytes() does not read any data when Files.size() is 0 In-Reply-To: <51E985AD.60401@redhat.com> References: <51E97416.20506@oracle.com> <51E98043.6030102@oracle.com> <51E9853E.8020409@redhat.com> <51E985AD.60401@redhat.com> Message-ID: <51EB0BFF.3030106@oracle.com> Roger, David thanks for suggestions! Would you please take a look at an updated webrev? http://cr.openjdk.java.net/~igerasim/8020669/1/webrev/ - File size is used as an initial size of BAOS's buffer. - BAOS avoids copying its buffer in toByteArray(), if size is correct . I don't want to initialize BAOS with a positive number if size happened to be zero. Because zero could indicate that the file is really empty. Sincerely yours, Ivan On 19.07.2013 22:30, David M. Lloyd wrote: > My mistake, we're not talking about strings. Still you can subclass > and determine whether the buffer size guess was right, and if so > return the array as-is (swap in an empty array or something as needed). > > On 07/19/2013 01:28 PM, David M. Lloyd wrote: >> It's trivial to subclass ByteArrayOutputStream and add a method which >> converts its contents to a string using the two protected fields which >> give you all the info you need to do so. So no extra copy is needed >> that you aren't already doing. >> >> On 07/19/2013 01:06 PM, roger riggs wrote: >>> Hi Ivan, >>> >>> I think this change takes too big a hit for the cases where the size is >>> correct. >>> >>> No real file system can be wrong about the size of a file so this is a >>> problem >>> only for special file systems. If the problem is with size reporting >>> zero >>> then maybe using the incremental read only for size == would be a >>> better >>> fix. >>> >>> At least you could pass the size to the constructor for BAOS and avoid >>> the thrashing for every re-size; but still it will allocate and create >>> an extra copy >>> of the every time. >>> >>> $.02, Roger >>> >>> >>> On 7/19/2013 1:15 PM, Ivan Gerasimov wrote: >>>> Hello everybody! >>>> >>>> Would you please review a fix for the problem with >>>> j.n.f.Files.readAllBytes() function? >>>> The current implementation relies on FileChannel.size() to preallocate >>>> a buffer for the whole file's content. >>>> However, some special filesystems can report a wrong size. >>>> An example is procfs under Linux, which reports many files under /proc >>>> to be zero sized. >>>> >>>> Thus it is proposed not to rely on the size() and instead continuously >>>> read until EOF. >>>> >>>> The downside is reallocation and copying file content between buffers. >>>> But taking into account that the doc says: "It is not intended for >>>> reading in large files." it should not be a big problem. >>>> >>>> http://bugs.sun.com/view_bug.do?bug_id=8020669 >>>> http://cr.openjdk.java.net/~igerasim/8020669/0/webrev/ >>>> >>>> The fix is for JDK8. If it is approved, it can be applied to JDK7 as >>>> well. >>>> >>>> Sincerely yours, >>>> Ivan Gerasimov >>> >> >> > > From dl at cs.oswego.edu Sun Jul 21 14:05:19 2013 From: dl at cs.oswego.edu (Doug Lea) Date: Sun, 21 Jul 2013 10:05:19 -0400 Subject: class SplittableRandom In-Reply-To: References: <51DDB26D.8050506@cs.oswego.edu> Message-ID: <51EBEA9F.3070700@cs.oswego.edu> (Catching up...) On 07/19/13 14:00, Mike Duigou wrote: >> Using a shared static SecureRandom.generateSeed() to generate the seed is >> probably the easiest way to get a good seed that is portable. I agree and updated accordingly. > I have previous experience mucking in this area. Attempting to use > SecureRandom will likely encounter order of initialization issues as it is > loaded from security providers and is only functional/available very late in > the VM boot process. Because SplittableRandom is a new class, there won't be any immediate within-JDK dependencies, so this shouldn't be a problem. > > I had considered suggesting adding a vm interface to access the platform > native secure random number generation (/dev/random or rand_s). This would be > useful for early boot and perhaps for speeding up seeding of SecureRandom. > Good idea. I started to explore doing something like this only for SplittableRandom, but then noticed that it would be better to benefit from more general improvements to SecureRandom in using OS-supported randoms: When OS support exists (which is almost always these days), it could and should be made simpler and faster to use. (Additionally, a "getLongSeed()" method would be handy, avoiding two byte-array conversions in what is probably the most common use case.) -Doug From chris.hegarty at oracle.com Sun Jul 21 14:22:34 2013 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Sun, 21 Jul 2013 15:22:34 +0100 Subject: @CallerSensitive as public API ? In-Reply-To: References: <51C9760F.7000007@gmail.com> <51E9EAE5.4070401@oracle.com> Message-ID: <8EB3CD18-2358-4426-88B6-B75C42D56C6B@oracle.com> On 20 Jul 2013, at 16:38, Chris Hegarty wrote: > > On 20 Jul 2013, at 15:28, Nick Williams wrote: > >> "This bug is not available." > > It can take up to 24hrs for a newly created bug to become available, please check again later. :-( > http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8020968 This bug is now available. -Chris. > -Chris. > >> >> On Jul 19, 2013, at 8:41 PM, Mandy Chung wrote: >> >>> Peter, >>> >>> FYI. I have filed this RFE: >>> 8020968: Load resource files using the caller's class and class loader >>> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8020968 >>> >>> Mandy >>> >>> On 6/25/2013 6:50 PM, Peter Levart wrote: >>>> Hi, >>>> >>>> I know that @CallerSensitive annotation was introduced to bring some order to JDK internal plumbings. It's scope was to support JDK internal usage, so it's use is limited to classes loaded by bootstrap or extension class-loaders. In JDK-internal code it is used mainly for implementing security-sensitive decisions. But since the sun.reflect.Reflection.getCallerClass(int) was public and unrestricted, it found it's way out into user code, where at least I know that it is used in two areas: >>>> >>>> 1 - to locate callers in the whole call-stack so that their location in class-path can be reported (Log4J is an example) >>>> 2 - to locate immediate caller so that some resources associated with it can be located and used (for example localization data in GUI applications) >>>> >>>> I don't know how wide-spread 1st usecase is, but the 2nd is common, since it's use enables APIs that need not explicitly pass-in the calling class in order to locate resources associated with it (and/or the class-loader of it). So it would be nice to have such supported API in JDK8 at least. >>>> >>>> I'm asking here, to hear any arguments against making such API supported and public. Are there any security or other issues? If there aren't, what steps should be taken to introduce such API in the JDK8 timeframe? I'm thinking of a no-arg method, say j.l.Class.getCaller() and moving @CallerSensitive to a supported package + enabling it to mark methods in any class (not just system and ext classes)... >>>> >>>> Regards, Peter >> From chris.hegarty at oracle.com Sun Jul 21 16:11:01 2013 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Sun, 21 Jul 2013 17:11:01 +0100 Subject: RFR [8020669] java.nio.file.Files.readAllBytes() does not read any data when Files.size() is 0 In-Reply-To: <51EB0BFF.3030106@oracle.com> References: <51E97416.20506@oracle.com> <51E98043.6030102@oracle.com> <51E9853E.8020409@redhat.com> <51E985AD.60401@redhat.com> <51EB0BFF.3030106@oracle.com> Message-ID: <293FF6B8-918A-4A2C-9541-A3B36629C9FB@oracle.com> [ cc'ing nio-dev ] On 20 Jul 2013, at 23:15, Ivan Gerasimov wrote: > Roger, David thanks for suggestions! > > Would you please take a look at an updated webrev? > http://cr.openjdk.java.net/~igerasim/8020669/1/webrev/ This looks much better to me. -Chris. > > - File size is used as an initial size of BAOS's buffer. > - BAOS avoids copying its buffer in toByteArray(), if size is correct . > > I don't want to initialize BAOS with a positive number if size happened to be zero. > Because zero could indicate that the file is really empty. > > Sincerely yours, > Ivan > > On 19.07.2013 22:30, David M. Lloyd wrote: >> My mistake, we're not talking about strings. Still you can subclass and determine whether the buffer size guess was right, and if so return the array as-is (swap in an empty array or something as needed). >> >> On 07/19/2013 01:28 PM, David M. Lloyd wrote: >>> It's trivial to subclass ByteArrayOutputStream and add a method which >>> converts its contents to a string using the two protected fields which >>> give you all the info you need to do so. So no extra copy is needed >>> that you aren't already doing. >>> >>> On 07/19/2013 01:06 PM, roger riggs wrote: >>>> Hi Ivan, >>>> >>>> I think this change takes too big a hit for the cases where the size is >>>> correct. >>>> >>>> No real file system can be wrong about the size of a file so this is a >>>> problem >>>> only for special file systems. If the problem is with size reporting zero >>>> then maybe using the incremental read only for size == would be a better >>>> fix. >>>> >>>> At least you could pass the size to the constructor for BAOS and avoid >>>> the thrashing for every re-size; but still it will allocate and create >>>> an extra copy >>>> of the every time. >>>> >>>> $.02, Roger >>>> >>>> >>>> On 7/19/2013 1:15 PM, Ivan Gerasimov wrote: >>>>> Hello everybody! >>>>> >>>>> Would you please review a fix for the problem with >>>>> j.n.f.Files.readAllBytes() function? >>>>> The current implementation relies on FileChannel.size() to preallocate >>>>> a buffer for the whole file's content. >>>>> However, some special filesystems can report a wrong size. >>>>> An example is procfs under Linux, which reports many files under /proc >>>>> to be zero sized. >>>>> >>>>> Thus it is proposed not to rely on the size() and instead continuously >>>>> read until EOF. >>>>> >>>>> The downside is reallocation and copying file content between buffers. >>>>> But taking into account that the doc says: "It is not intended for >>>>> reading in large files." it should not be a big problem. >>>>> >>>>> http://bugs.sun.com/view_bug.do?bug_id=8020669 >>>>> http://cr.openjdk.java.net/~igerasim/8020669/0/webrev/ >>>>> >>>>> The fix is for JDK8. If it is approved, it can be applied to JDK7 as >>>>> well. >>>>> >>>>> Sincerely yours, >>>>> Ivan Gerasimov > From peter.levart at gmail.com Sun Jul 21 18:57:56 2013 From: peter.levart at gmail.com (Peter Levart) Date: Sun, 21 Jul 2013 20:57:56 +0200 Subject: @CallerSensitive as public API ? In-Reply-To: <51E9EAE5.4070401@oracle.com> References: <51C9760F.7000007@gmail.com> <51E9EAE5.4070401@oracle.com> Message-ID: <51EC2F34.9050006@gmail.com> On 07/20/2013 03:41 AM, Mandy Chung wrote: > Peter, > > FYI. I have filed this RFE: > 8020968: Load resource files using the caller's class and class loader > http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8020968 > > Mandy Hi Mandy, I wonder what API you had in mind. Currently we have ClassLoader and Class instance methods to load resources which are quite low-level in the sense that they require full or relative path to the resource and they return either URL or InputStream. So they usually get wrapped by utilities implementing special search strategies and/or resource un-marshaling. For example, imagine one would like to locate resource using the caller class' ClassLoader using the resource path composed of the package name of the caller class replacing dots with slashes and specified resource name appended, then load the content of the resource into a BufferedImage and construct an Icon from it, wrapping any IOException thrown with some unchecked exception: package my.pkg; class MyClass { void someMethod() { // a static utility method: Icon saveIcon = Resources.getIcon("save-icon.png"); // that does the following: Icon saveIcon; try { saveIcon = new ImageIcon(ImageIO.read(MyClass.class.getResource("save-icon.png"))); } catch (IOException e) { throw new RuntimeException(e); } I don't suggest creating such APIs in the JDK, just enabling them. So what would it take for an API in ClassLoader or Class to enable creating an API like Resources.getIcon() presented above? I guess a static method like Class.getCallerClass() would do, but I have a feeling this is something that is flagged as sensitive by the security team, right? So what about Class.getCallerClassResource(String name)? This would not locate the resource on behalf of the directly calling class, but the class that is calling some method that is calling this method. Regards, Peter P.S. I still don't know why would method like Class.getCallerClass() be so security sensitive? In order for the getCallerClass() to succeed the method calling it would have to be annotated with @CallerSensitive annotation. If a method has such annotation, anyone deciding to call such method is warned in advance that this method is "extracting" the callers class and using it as it finds fit. There's no danger of untrusted code to sneak it's own @CallerSensitive methods so that unaware code calls them or is it? Does @CallerSensitive work on statically resolved methods or on runtime resolved methods? I mean, if there is some code in some security-sensitive class: Runnable r = .... r.run(); // where a Runnable instance is provided by untrusted code: class EvilRunnable implements Runnable { @Override @CallerSensitive public void run() { Class caller = Class.getCallerClass(); // do some things with caller.... } } Would @CallerSensitive have desired effect as it is implemented currently or would it work only if Runnable.run() interface method was annotated? > > On 6/25/2013 6:50 PM, Peter Levart wrote: >> Hi, >> >> I know that @CallerSensitive annotation was introduced to bring some >> order to JDK internal plumbings. It's scope was to support JDK >> internal usage, so it's use is limited to classes loaded by bootstrap >> or extension class-loaders. In JDK-internal code it is used mainly >> for implementing security-sensitive decisions. But since the >> sun.reflect.Reflection.getCallerClass(int) was public and >> unrestricted, it found it's way out into user code, where at least I >> know that it is used in two areas: >> >> 1 - to locate callers in the whole call-stack so that their location >> in class-path can be reported (Log4J is an example) >> 2 - to locate immediate caller so that some resources associated with >> it can be located and used (for example localization data in GUI >> applications) >> >> I don't know how wide-spread 1st usecase is, but the 2nd is common, >> since it's use enables APIs that need not explicitly pass-in the >> calling class in order to locate resources associated with it (and/or >> the class-loader of it). So it would be nice to have such supported >> API in JDK8 at least. >> >> I'm asking here, to hear any arguments against making such API >> supported and public. Are there any security or other issues? If >> there aren't, what steps should be taken to introduce such API in the >> JDK8 timeframe? I'm thinking of a no-arg method, say >> j.l.Class.getCaller() and moving @CallerSensitive to a supported >> package + enabling it to mark methods in any class (not just system >> and ext classes)... >> >> Regards, Peter >> > From blackdrag at gmx.org Mon Jul 22 07:37:51 2013 From: blackdrag at gmx.org (Jochen Theodorou) Date: Mon, 22 Jul 2013 09:37:51 +0200 Subject: problems with sun.reflect.Reflection.getCallerClass(int) In-Reply-To: <51E9EAAE.7010606@oracle.com> References: <51DE6B0A.1010207@gmx.org> <51E9EAAE.7010606@oracle.com> Message-ID: <51ECE14F.3050002@gmx.org> Am 20.07.2013 03:41, schrieb Mandy Chung: > Hi Jochen, > > I read through the thread in mlvm-dev [1] that has a good discussion > there. I have filed a RFE: > 8020785: caller-sensitive methods to skip dynamic generated frames > and look up the true caller > > This seems that java.lang.instrument might be an appropriate place for > this support. This certainly requires further investigation. > > Mandy > > [1] http://mail.openjdk.java.net/pipermail/mlvm-dev/2013-July/005387.html > [2] http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8020785 can you explain a little how instrumentation could help here? Of course I don't expect a full solution, but the idea would be helping. bye blackdrag -- Jochen "blackdrag" Theodorou - Groovy Project Tech Lead blog: http://blackdragsview.blogspot.com/ german groovy discussion newsgroup: de.comp.lang.misc For Groovy programming sources visit http://groovy-lang.org From mandy.chung at oracle.com Mon Jul 22 09:08:32 2013 From: mandy.chung at oracle.com (Mandy Chung) Date: Mon, 22 Jul 2013 17:08:32 +0800 Subject: @CallerSensitive as public API ? In-Reply-To: <51EC2F34.9050006@gmail.com> References: <51C9760F.7000007@gmail.com> <51E9EAE5.4070401@oracle.com> <51EC2F34.9050006@gmail.com> Message-ID: <51ECF690.1070700@oracle.com> Hi Peter, I have been very busy on other high priority works and didn't have time to look into this request. I filed 8020968 and 8020785 so that others can help follow up and follow up (I'll be on vacation this Wed). Class.getCallerClass and @CallerSensitive is clearly one option to replace sun.reflect.Reflection.getCallerClass. I'm not precluding this option at all. This would require further investigation and it's not a small task that includes spec work (might have impact to JVM spec), whether implementable by all Java SE implementation, JCK tests, security and there will be subtle issues to consider when defining the specification etc. It seems that this option requires more work than what we can take in jdk8. For your specific use case, the other option we can explore to satisfy your use case is to define a static method to use the caller's class to find the resources. You guessed what I have in mind. Take your example you use below, if the stack looks like this: Class.getCallerResource(name) Resources.getIcon(name) MyClass.someMethod Class.getCallerResource(String name) will be equivalent to calling: Class caller = sun.reflect.Reflection.getCallerClass(); caller.getResource(name); I'll need to find if there is anyone who can help look into these options. Your help and contribution is very welcome. Mandy On 7/22/2013 2:57 AM, Peter Levart wrote: > > Hi Mandy, > > I wonder what API you had in mind. Currently we have ClassLoader and > Class instance methods to load resources which are quite low-level in > the sense that they require full or relative path to the resource and > they return either URL or InputStream. So they usually get wrapped by > utilities implementing special search strategies and/or resource > un-marshaling. > > For example, imagine one would like to locate resource using the > caller class' ClassLoader using the resource path composed of the > package name of the caller class replacing dots with slashes and > specified resource name appended, then load the content of the > resource into a BufferedImage and construct an Icon from it, wrapping > any IOException thrown with some unchecked exception: > > package my.pkg; > class MyClass { > void someMethod() { > > // a static utility method: > Icon saveIcon = Resources.getIcon("save-icon.png"); > > // that does the following: > Icon saveIcon; > try { > saveIcon = new > ImageIcon(ImageIO.read(MyClass.class.getResource("save-icon.png"))); > } catch (IOException e) { > throw new RuntimeException(e); > } > > > I don't suggest creating such APIs in the JDK, just enabling them. So > what would it take for an API in ClassLoader or Class to enable > creating an API like Resources.getIcon() presented above? > > I guess a static method like Class.getCallerClass() would do, but I > have a feeling this is something that is flagged as sensitive by the > security team, right? > > So what about Class.getCallerClassResource(String name)? This would > not locate the resource on behalf of the directly calling class, but > the class that is calling some method that is calling this method. > > Regards, Peter > > P.S. I still don't know why would method like Class.getCallerClass() > be so security sensitive? In order for the getCallerClass() to succeed > the method calling it would have to be annotated with @CallerSensitive > annotation. If a method has such annotation, anyone deciding to call > such method is warned in advance that this method is "extracting" the > callers class and using it as it finds fit. There's no danger of > untrusted code to sneak it's own @CallerSensitive methods so that > unaware code calls them or is it? Does @CallerSensitive work on > statically resolved methods or on runtime resolved methods? I mean, if > there is some code in some security-sensitive class: > > Runnable r = .... > r.run(); > > // where a Runnable instance is provided by untrusted code: > > class EvilRunnable implements Runnable { > @Override > @CallerSensitive > public void run() { > Class caller = Class.getCallerClass(); > // do some things with caller.... > } > } > > > Would @CallerSensitive have desired effect as it is implemented > currently or would it work only if Runnable.run() interface method was > annotated? > > >> >> On 6/25/2013 6:50 PM, Peter Levart wrote: >>> Hi, >>> >>> I know that @CallerSensitive annotation was introduced to bring some >>> order to JDK internal plumbings. It's scope was to support JDK >>> internal usage, so it's use is limited to classes loaded by >>> bootstrap or extension class-loaders. In JDK-internal code it is >>> used mainly for implementing security-sensitive decisions. But since >>> the sun.reflect.Reflection.getCallerClass(int) was public and >>> unrestricted, it found it's way out into user code, where at least I >>> know that it is used in two areas: >>> >>> 1 - to locate callers in the whole call-stack so that their location >>> in class-path can be reported (Log4J is an example) >>> 2 - to locate immediate caller so that some resources associated >>> with it can be located and used (for example localization data in >>> GUI applications) >>> >>> I don't know how wide-spread 1st usecase is, but the 2nd is common, >>> since it's use enables APIs that need not explicitly pass-in the >>> calling class in order to locate resources associated with it >>> (and/or the class-loader of it). So it would be nice to have such >>> supported API in JDK8 at least. >>> >>> I'm asking here, to hear any arguments against making such API >>> supported and public. Are there any security or other issues? If >>> there aren't, what steps should be taken to introduce such API in >>> the JDK8 timeframe? I'm thinking of a no-arg method, say >>> j.l.Class.getCaller() and moving @CallerSensitive to a supported >>> package + enabling it to mark methods in any class (not just system >>> and ext classes)... >>> >>> Regards, Peter >>> >> > From mandy.chung at oracle.com Mon Jul 22 10:27:17 2013 From: mandy.chung at oracle.com (Mandy Chung) Date: Mon, 22 Jul 2013 18:27:17 +0800 Subject: problems with sun.reflect.Reflection.getCallerClass(int) In-Reply-To: <51ECE14F.3050002@gmx.org> References: <51DE6B0A.1010207@gmx.org> <51E9EAAE.7010606@oracle.com> <51ECE14F.3050002@gmx.org> Message-ID: <51ED0905.3050809@oracle.com> On 7/22/2013 3:37 PM, Jochen Theodorou wrote: > Am 20.07.2013 03:41, schrieb Mandy Chung: >> Hi Jochen, >> >> I read through the thread in mlvm-dev [1] that has a good discussion >> there. I have filed a RFE: >> 8020785: caller-sensitive methods to skip dynamic generated frames >> and look up the true caller >> >> This seems that java.lang.instrument might be an appropriate place for >> this support. This certainly requires further investigation. >> >> Mandy >> >> [1] >> http://mail.openjdk.java.net/pipermail/mlvm-dev/2013-July/005387.html >> [2] http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8020785 > > can you explain a little how instrumentation could help here? Of > course I don't expect a full solution, but the idea would be helping. As I understand your use case, what you need is to tell the system to skip some specific frames when a caller-sensitive method is looking up the caller which the functionality depends on (e.g. ResourceBundle.getBundle and Class.forName uses the caller's loader to find class/resource). You currently achieve this by walking the stack. I like Charles's suggestion to teach JVM about language-specific stack traces. Instrumentation agents probably do something similar to skip its own runtime classes / packages. The current hotspot implementation skips sun.reflect.* and a few other specific classes to determine the caller class. I think java.lang.instrument seems an appropriate place for this kind of functionality and provide a way to extend the whitelist to skip and pass it to the JVM. This is really just a rough idea and there may be issues to be investigated. I didn't have time to look into this RFE as I have been very busy on other high priority works. Whoever works on this RFE will certainly discuss the proposals in core-libs-dev and get feedbacks. Mandy From joel.franck at oracle.com Mon Jul 22 12:55:29 2013 From: joel.franck at oracle.com (Joel Borggren-Franck) Date: Mon, 22 Jul 2013 14:55:29 +0200 Subject: Order of annotation declarations In-Reply-To: References: Message-ID: <20130722125529.GM18147@jfranck-desktop.jrpg.bea.com> Hi, On 2013-07-19, Kasper Nielsen wrote: > Hi, > > I haven't been able to find any info on this. > but is [Class|AnnotatedMember].getAnnotations() required to return the > annotations is order of declaration? > > For example, if I have the following definition > @First > @Second > public class Foo{} > Will Foo.class.getAnnotations() always return > [First, Second] or is it allowed to return them in any order like > getMethods()? > I don't think it is strictly required, but we usually try to keep them in their natural order. cheers /Joel From amy.lu at oracle.com Mon Jul 22 13:12:41 2013 From: amy.lu at oracle.com (Amy Lu) Date: Mon, 22 Jul 2013 21:12:41 +0800 Subject: Code Review Request: More tests for 7184826: (reflect) Add support for Project Lambda concepts in core reflection In-Reply-To: <20130710141722.GA23047@jfranck-desktop.jrpg.bea.com> References: <519E2C52.20203@oracle.com> <51B91AA5.6090807@oracle.com> <20130710141722.GA23047@jfranck-desktop.jrpg.bea.com> Message-ID: <51ED2FC9.5040200@oracle.com> Thank you Joel for all the valuable feedback. Test have been refactored and here comes the updated version: https://dl.dropboxusercontent.com/u/5812451/yl153753/7184826/webrev.01/index.html Thanks, Amy On 7/10/13 10:17 PM, Joel Borggren-Franck wrote: > Hi Amy, Tristan, > > I'm not a Reviewer kind of reviewer, but I've started to look at the > code and can sponsor this. > > Some comments on test/java/lang/reflect/Method/invoke/DefaultStaticTest.java: > > As there are a lot of non-public top-level classes perhaps this test > should be in it own directory. > > It is very hard to read the data table: > > 292 {interface1.class, 1, 1, new Object1(), new Object[]{}, > 293 new Object[]{}, "interface1", null}, > > I believe you should move the methodsNum constant and the declMethods > num constant to an annotation on the interface/class in question. For > example: > > @MyTestData(numMethods=1, declMethods=1) > 41 interface interface1 { > 42 @DefaultMethod(isDefault = true) > 43 @StaticMethod(isStatic = false) > 44 @ReturnValue(value = "interface1.defaultMethod") > 45 default String defaultMethod(){ return "interface1.defaultMethod"; }; > 46 } > > That way it is much easier to inspect that the constants are right. > > The same can probably be done with the return values encoded. > > Instead of all these "new Objects[] {}" can't you create a field, > > Object [] EMPTY_PARAMETERS = new Object() {} > > and reuse it? > > That way it will be much easier to verify that the encoded test data is > correct. > > I'll comment on the other tests shortly. > > cheers > /Joel > > On 2013-06-13, Amy Lu wrote: >> This has been pending on review for long ... Please help to review. >> I also need a sponsor for this. >> >> Thank you very much. >> >> /Amy >> >> On 5/23/13 10:48 PM, Amy Lu wrote: >>> Please help to review: >>> >>> More tests for 7184826: (reflect) Add support for Project Lambda >>> concepts in core reflection >>> >>> This includes: >>> 1. improvement for existing tests with more situations >>> 2. Test for invoking interface default/static method by j.l.r.Method >>> 3. Test for invoking interface default/static method by MethodHandle >>> >>> https://dl.dropboxusercontent.com/u/5812451/yl153753/7184826/webrev.00/index.html >>> >>> >>> Thanks, >>> Amy >> From joel.franck at oracle.com Mon Jul 22 13:27:03 2013 From: joel.franck at oracle.com (Joel Borggren-Franck) Date: Mon, 22 Jul 2013 15:27:03 +0200 Subject: Code Review Request: More tests for 7184826: (reflect) Add support for Project Lambda concepts in core reflection In-Reply-To: <51ED2FC9.5040200@oracle.com> References: <519E2C52.20203@oracle.com> <51B91AA5.6090807@oracle.com> <20130710141722.GA23047@jfranck-desktop.jrpg.bea.com> <51ED2FC9.5040200@oracle.com> Message-ID: <20130722132703.GO18147@jfranck-desktop.jrpg.bea.com> Hi Amy, I'm happy with the current iteration. I'll help you find an official reviewer. cheers /Joel On 2013-07-22, Amy Lu wrote: > Thank you Joel for all the valuable feedback. > > Test have been refactored and here comes the updated version: > https://dl.dropboxusercontent.com/u/5812451/yl153753/7184826/webrev.01/index.html > > Thanks, > Amy > > > On 7/10/13 10:17 PM, Joel Borggren-Franck wrote: > >Hi Amy, Tristan, > > > >I'm not a Reviewer kind of reviewer, but I've started to look at the > >code and can sponsor this. > > > >Some comments on test/java/lang/reflect/Method/invoke/DefaultStaticTest.java: > > > >As there are a lot of non-public top-level classes perhaps this test > >should be in it own directory. > > > >It is very hard to read the data table: > > > >292 {interface1.class, 1, 1, new Object1(), new Object[]{}, > >293 new Object[]{}, "interface1", null}, > > > >I believe you should move the methodsNum constant and the declMethods > >num constant to an annotation on the interface/class in question. For > >example: > > > >@MyTestData(numMethods=1, declMethods=1) > >41 interface interface1 { > >42 @DefaultMethod(isDefault = true) > >43 @StaticMethod(isStatic = false) > >44 @ReturnValue(value = "interface1.defaultMethod") > >45 default String defaultMethod(){ return "interface1.defaultMethod"; }; > >46 } > > > >That way it is much easier to inspect that the constants are right. > > > >The same can probably be done with the return values encoded. > > > >Instead of all these "new Objects[] {}" can't you create a field, > > > >Object [] EMPTY_PARAMETERS = new Object() {} > > > >and reuse it? > > > >That way it will be much easier to verify that the encoded test data is > >correct. > > > >I'll comment on the other tests shortly. > > > >cheers > >/Joel > > > >On 2013-06-13, Amy Lu wrote: > >>This has been pending on review for long ... Please help to review. > >>I also need a sponsor for this. > >> > >>Thank you very much. > >> > >>/Amy > >> > >>On 5/23/13 10:48 PM, Amy Lu wrote: > >>>Please help to review: > >>> > >>>More tests for 7184826: (reflect) Add support for Project Lambda > >>>concepts in core reflection > >>> > >>>This includes: > >>>1. improvement for existing tests with more situations > >>>2. Test for invoking interface default/static method by j.l.r.Method > >>>3. Test for invoking interface default/static method by MethodHandle > >>> > >>>https://dl.dropboxusercontent.com/u/5812451/yl153753/7184826/webrev.00/index.html > >>> > >>> > >>>Thanks, > >>>Amy > >> > From chris.hegarty at oracle.com Mon Jul 22 14:27:04 2013 From: chris.hegarty at oracle.com (chris.hegarty at oracle.com) Date: Mon, 22 Jul 2013 14:27:04 +0000 Subject: hg: jdk8/tl/jdk: 2 new changesets Message-ID: <20130722142742.13EDF48264@hg.openjdk.java.net> Changeset: dcd89e60051a Author: khazra Date: 2013-07-22 15:24 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/dcd89e60051a 8020498: Crash when both libnet.so and libmawt.so are loaded Reviewed-by: chegar, dsamersoff ! src/share/native/java/net/net_util.c Changeset: a3a2889b1049 Author: dl Date: 2013-07-22 15:26 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/a3a2889b1049 8020976: Ensure consistent insertion for ConcurrentHashMap Reviewed-by: chegar ! src/share/classes/java/util/concurrent/ConcurrentHashMap.java From roger.riggs at oracle.com Mon Jul 22 16:03:36 2013 From: roger.riggs at oracle.com (roger riggs) Date: Mon, 22 Jul 2013 12:03:36 -0400 Subject: RFR [8020669] java.nio.file.Files.readAllBytes() does not read any data when Files.size() is 0 In-Reply-To: <51EB0BFF.3030106@oracle.com> References: <51E97416.20506@oracle.com> <51E98043.6030102@oracle.com> <51E9853E.8020409@redhat.com> <51E985AD.60401@redhat.com> <51EB0BFF.3030106@oracle.com> Message-ID: <51ED57D8.90001@oracle.com> Hi Ivan, I'm concerned about the change in behavior for the existing working cases. How many times are the bytes copied in your proposed implementation? How many arrays are allocated and discarded? Files.copy() uses an extra array for the copies. BAOS should only be used for size == 0; that would address the issue without changing the current behavior or allocations. Roger On 7/20/2013 6:15 PM, Ivan Gerasimov wrote: > Roger, David thanks for suggestions! > > Would you please take a look at an updated webrev? > http://cr.openjdk.java.net/~igerasim/8020669/1/webrev/ > > - File size is used as an initial size of BAOS's buffer. > - BAOS avoids copying its buffer in toByteArray(), if size is correct . > > I don't want to initialize BAOS with a positive number if size > happened to be zero. > Because zero could indicate that the file is really empty. > > Sincerely yours, > Ivan > > On 19.07.2013 22:30, David M. Lloyd wrote: >> My mistake, we're not talking about strings. Still you can subclass >> and determine whether the buffer size guess was right, and if so >> return the array as-is (swap in an empty array or something as needed). >> >> On 07/19/2013 01:28 PM, David M. Lloyd wrote: >>> It's trivial to subclass ByteArrayOutputStream and add a method which >>> converts its contents to a string using the two protected fields which >>> give you all the info you need to do so. So no extra copy is needed >>> that you aren't already doing. >>> >>> On 07/19/2013 01:06 PM, roger riggs wrote: >>>> Hi Ivan, >>>> >>>> I think this change takes too big a hit for the cases where the >>>> size is >>>> correct. >>>> >>>> No real file system can be wrong about the size of a file so this is a >>>> problem >>>> only for special file systems. If the problem is with size >>>> reporting zero >>>> then maybe using the incremental read only for size == would be a >>>> better >>>> fix. >>>> >>>> At least you could pass the size to the constructor for BAOS and avoid >>>> the thrashing for every re-size; but still it will allocate and create >>>> an extra copy >>>> of the every time. >>>> >>>> $.02, Roger >>>> >>>> >>>> On 7/19/2013 1:15 PM, Ivan Gerasimov wrote: >>>>> Hello everybody! >>>>> >>>>> Would you please review a fix for the problem with >>>>> j.n.f.Files.readAllBytes() function? >>>>> The current implementation relies on FileChannel.size() to >>>>> preallocate >>>>> a buffer for the whole file's content. >>>>> However, some special filesystems can report a wrong size. >>>>> An example is procfs under Linux, which reports many files under >>>>> /proc >>>>> to be zero sized. >>>>> >>>>> Thus it is proposed not to rely on the size() and instead >>>>> continuously >>>>> read until EOF. >>>>> >>>>> The downside is reallocation and copying file content between >>>>> buffers. >>>>> But taking into account that the doc says: "It is not intended for >>>>> reading in large files." it should not be a big problem. >>>>> >>>>> http://bugs.sun.com/view_bug.do?bug_id=8020669 >>>>> http://cr.openjdk.java.net/~igerasim/8020669/0/webrev/ >>>>> >>>>> The fix is for JDK8. If it is approved, it can be applied to JDK7 as >>>>> well. >>>>> >>>>> Sincerely yours, >>>>> Ivan Gerasimov >>>> >>> >>> >> >> > From martinrb at google.com Mon Jul 22 16:19:11 2013 From: martinrb at google.com (Martin Buchholz) Date: Mon, 22 Jul 2013 09:19:11 -0700 Subject: RFR [8020669] java.nio.file.Files.readAllBytes() does not read any data when Files.size() is 0 In-Reply-To: <51ED57D8.90001@oracle.com> References: <51E97416.20506@oracle.com> <51E98043.6030102@oracle.com> <51E9853E.8020409@redhat.com> <51E985AD.60401@redhat.com> <51EB0BFF.3030106@oracle.com> <51ED57D8.90001@oracle.com> Message-ID: On Mon, Jul 22, 2013 at 9:03 AM, roger riggs wrote: > Hi Ivan, > > I'm concerned about the change in behavior for the existing working cases. > > How many times are the bytes copied in your proposed implementation? > How many arrays are allocated and discarded? > Files.copy() uses an extra array for the copies. > > BAOS should only be used for size == 0; that would address the issue > without changing the current behavior or allocations. I also think we can do better, but we have to write the low-level code ourselves. copy creates an 8k buffer, which should be unnecessary. I think we can write correct code that treats the file size as purely a hint (or the file size may be changing concurrently), but does no extra allocation in the case where the hint is correct. You can detect end of file using InputStream.read(), but be prepared to handle the returned byte if there's unexpectedly more data. You probably have to special-case size 0, else the return from buffer read will be ambiguous 0. From pbenedict at apache.org Mon Jul 22 16:22:33 2013 From: pbenedict at apache.org (Paul Benedict) Date: Mon, 22 Jul 2013 11:22:33 -0500 Subject: @CallerSensitive as public API ? Message-ID: I find this issue tangentially related to some open source logging libraries. Some create a stack trace just so they can get the name of the calling Class instance. Example: Logger log = Logger.createLogger(); // for the current class Are there any thoughts to directly exposing sun.reflect.Reflection.getCallerClass() as a public API? -- Cheers, Paul From david.lloyd at redhat.com Mon Jul 22 16:48:32 2013 From: david.lloyd at redhat.com (David M. Lloyd) Date: Mon, 22 Jul 2013 11:48:32 -0500 Subject: @CallerSensitive as public API ? In-Reply-To: References: Message-ID: <51ED6260.3040208@redhat.com> On 07/22/2013 11:22 AM, Paul Benedict wrote: > I find this issue tangentially related to some open source logging > libraries. Some create a stack trace just so they can get the name of the > calling Class instance. > > Example: > Logger log = Logger.createLogger(); // for the current class > > Are there any thoughts to directly exposing > sun.reflect.Reflection.getCallerClass() as a public API? This is somewhat complicated by two factors: the sea of loggers-which-log-to-loggers, and the usage of the data acquired. The common practice is for the "outermost" layer to pass in its own class name, so that the "innermost" layer can search back on the call stack to find the last entry before the "outermost" layer, and use this entry to get not only the class (and method) name, but also the file name and line number from the stack trace entry. -- - DML From david.lloyd at redhat.com Mon Jul 22 16:50:32 2013 From: david.lloyd at redhat.com (David M. Lloyd) Date: Mon, 22 Jul 2013 11:50:32 -0500 Subject: RFR [8020669] java.nio.file.Files.readAllBytes() does not read any data when Files.size() is 0 In-Reply-To: References: <51E97416.20506@oracle.com> <51E98043.6030102@oracle.com> <51E9853E.8020409@redhat.com> <51E985AD.60401@redhat.com> <51EB0BFF.3030106@oracle.com> <51ED57D8.90001@oracle.com> Message-ID: <51ED62D8.3030205@redhat.com> On 07/22/2013 11:19 AM, Martin Buchholz wrote: > On Mon, Jul 22, 2013 at 9:03 AM, roger riggs wrote: > >> Hi Ivan, >> >> I'm concerned about the change in behavior for the existing working cases. >> >> How many times are the bytes copied in your proposed implementation? >> How many arrays are allocated and discarded? >> Files.copy() uses an extra array for the copies. >> >> BAOS should only be used for size == 0; that would address the issue >> without changing the current behavior or allocations. > > > I also think we can do better, but we have to write the low-level code > ourselves. > copy creates an 8k buffer, which should be unnecessary. > I think we can write correct code that treats the file size as purely a > hint (or the file size may be changing concurrently), but does no extra > allocation in the case where the hint is correct. > You can detect end of file using InputStream.read(), but be prepared to > handle the returned byte if there's unexpectedly more data. > You probably have to special-case size 0, else the return from buffer read > will be ambiguous 0. It should be very simple; frankly I'm surprised that there has been this much discussion around it. :) -- - DML From roger.riggs at oracle.com Mon Jul 22 17:16:19 2013 From: roger.riggs at oracle.com (roger riggs) Date: Mon, 22 Jul 2013 13:16:19 -0400 Subject: RFR [8020669] java.nio.file.Files.readAllBytes() does not read any data when Files.size() is 0 In-Reply-To: <51ED62D8.3030205@redhat.com> References: <51E97416.20506@oracle.com> <51E98043.6030102@oracle.com> <51E9853E.8020409@redhat.com> <51E985AD.60401@redhat.com> <51EB0BFF.3030106@oracle.com> <51ED57D8.90001@oracle.com> <51ED62D8.3030205@redhat.com> Message-ID: <51ED68E3.3090106@oracle.com> Hi, All I was thinking was: if (size == 0) { use BAOS... code from 1st webrev. } else { current code } But I am curious why fixing the size() method is not a better fix; if FileChannel can return incorrect values that seems like a more serious flaw in the implementation. And it will contaminate code that uses it with the uncertainty about the true size. Roger On 7/22/2013 12:50 PM, David M. Lloyd wrote: > On 07/22/2013 11:19 AM, Martin Buchholz wrote: >> On Mon, Jul 22, 2013 at 9:03 AM, roger riggs >> wrote: >> >>> Hi Ivan, >>> >>> I'm concerned about the change in behavior for the existing working >>> cases. >>> >>> How many times are the bytes copied in your proposed implementation? >>> How many arrays are allocated and discarded? >>> Files.copy() uses an extra array for the copies. >>> >>> BAOS should only be used for size == 0; that would address the issue >>> without changing the current behavior or allocations. >> >> >> I also think we can do better, but we have to write the low-level code >> ourselves. >> copy creates an 8k buffer, which should be unnecessary. >> I think we can write correct code that treats the file size as purely a >> hint (or the file size may be changing concurrently), but does no extra >> allocation in the case where the hint is correct. >> You can detect end of file using InputStream.read(), but be prepared to >> handle the returned byte if there's unexpectedly more data. >> You probably have to special-case size 0, else the return from buffer >> read >> will be ambiguous 0. > > It should be very simple; frankly I'm surprised that there has been > this much discussion around it. :) From pbenedict at apache.org Mon Jul 22 17:48:28 2013 From: pbenedict at apache.org (Paul Benedict) Date: Mon, 22 Jul 2013 12:48:28 -0500 Subject: @CallerSensitive as public API ? Message-ID: That's true David. I concur with your description. I was just more interested in the fact that Java has the calling Class available, but there's no API that exposes it. Many developers kind of groan they always have to explicitly specify the current class name through the language. private static Logger = Logger.getLogger(MyClass.class); Some wish this language enhancement: private static Logger = Logger.getLogger(class); But if a runtime solution could be provided where the calling Class is accessible, that's just as handy. Cheers, Paul From martinrb at google.com Mon Jul 22 18:58:05 2013 From: martinrb at google.com (Martin Buchholz) Date: Mon, 22 Jul 2013 11:58:05 -0700 Subject: RFR [8020669] java.nio.file.Files.readAllBytes() does not read any data when Files.size() is 0 In-Reply-To: <51ED68E3.3090106@oracle.com> References: <51E97416.20506@oracle.com> <51E98043.6030102@oracle.com> <51E9853E.8020409@redhat.com> <51E985AD.60401@redhat.com> <51EB0BFF.3030106@oracle.com> <51ED57D8.90001@oracle.com> <51ED62D8.3030205@redhat.com> <51ED68E3.3090106@oracle.com> Message-ID: On Mon, Jul 22, 2013 at 10:16 AM, roger riggs wrote: > Hi, > > All I was thinking was: > > if (size == 0) { > use BAOS... code from 1st webrev. > More efficient would be to dip your toe in the water with int c = read() and recover if you don't get back -1. > } else { > current code > } > > But I am curious why fixing the size() method is not a better fix; if > FileChannel > can return incorrect values that seems like a more serious flaw in the > implementation. > And it will contaminate code that uses it with the uncertainty about the > true size. It's the OS/filesystem implementer deciding to return a bogus number. More accurate would be to count by reading all the bytes, but that is impractical and/or impossible (e.g. don't try reading "all the bytes" from /dev/null) A middle ground would be to mistrust specifically file sizes of zero, testing via int c = read() but then what? Check for /proc bug on Linux? From mike.duigou at oracle.com Mon Jul 22 19:24:34 2013 From: mike.duigou at oracle.com (Mike Duigou) Date: Mon, 22 Jul 2013 12:24:34 -0700 Subject: RFR : 6799426 : (xs) Add constructor PriorityQueue(Comparator) Message-ID: Hello all; A simple rewiew for the addition of another constructor to PriorityQueue. Currently if you wish to specify a Comparator you must also supply a size. This addition allows use of the default size which is good for two reason; you don't have to specify a fixed value and the implementation can change it's default as appropriate. http://cr.openjdk.java.net/~mduigou/JDK-6799426/0/webrev/ Mike From Lance.Andersen at oracle.com Mon Jul 22 19:42:38 2013 From: Lance.Andersen at oracle.com (Lance Andersen - Oracle) Date: Mon, 22 Jul 2013 15:42:38 -0400 Subject: RFR : 6799426 : (xs) Add constructor PriorityQueue(Comparator) In-Reply-To: References: Message-ID: looks fine Mike Best Lance On Jul 22, 2013, at 3:24 PM, Mike Duigou wrote: > Hello all; > > A simple rewiew for the addition of another constructor to PriorityQueue. Currently if you wish to specify a Comparator you must also supply a size. This addition allows use of the default size which is good for two reason; you don't have to specify a fixed value and the implementation can change it's default as appropriate. > > http://cr.openjdk.java.net/~mduigou/JDK-6799426/0/webrev/ > > Mike -------------- next part -------------- Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 Oracle Java Engineering 1 Network Drive Burlington, MA 01803 Lance.Andersen at oracle.com From mike.duigou at oracle.com Mon Jul 22 19:58:06 2013 From: mike.duigou at oracle.com (Mike Duigou) Date: Mon, 22 Jul 2013 12:58:06 -0700 Subject: RFR: 8019840 : (s) Spec updates to java.util.function package Message-ID: Hello all; This is a minor update to the java.util.function package. There is only one normative change, Consumer.chain() -> Consumer.andThen() but many textual improvements. http://cr.openjdk.java.net/~mduigou/JDK-8019840/0/webrev/ One change to note: I have reverted the change to the block code sample which was introduced in 8020948. An {@code block was used to avoid having to use HTML entities & < etc. I don't see the rationale for removing the {@code} and it doesn't seem to cause a doclint error. I can switch back to the 8020948 before commit as necessary (but really don't want to). Mike From forax at univ-mlv.fr Mon Jul 22 20:15:01 2013 From: forax at univ-mlv.fr (Remi Forax) Date: Mon, 22 Jul 2013 22:15:01 +0200 Subject: RFR : 6799426 : (xs) Add constructor PriorityQueue(Comparator) In-Reply-To: References: Message-ID: <51ED92C5.40307@univ-mlv.fr> On 07/22/2013 09:42 PM, Lance Andersen - Oracle wrote: > looks fine Mike > > Best > Lance Yes, fine for me too. R?mi > On Jul 22, 2013, at 3:24 PM, Mike Duigou wrote: > >> Hello all; >> >> A simple rewiew for the addition of another constructor to PriorityQueue. Currently if you wish to specify a Comparator you must also supply a size. This addition allows use of the default size which is good for two reason; you don't have to specify a fixed value and the implementation can change it's default as appropriate. >> >> http://cr.openjdk.java.net/~mduigou/JDK-6799426/0/webrev/ >> >> Mike > > > Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 > Oracle Java Engineering > 1 Network Drive > Burlington, MA 01803 > Lance.Andersen at oracle.com > From chris.hegarty at oracle.com Mon Jul 22 21:00:12 2013 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Mon, 22 Jul 2013 22:00:12 +0100 Subject: RFR : 6799426 : (xs) Add constructor PriorityQueue(Comparator) In-Reply-To: References: Message-ID: <51ED9D5C.6080706@oracle.com> On 22/07/2013 20:24, Mike Duigou wrote: > Hello all; > > A simple rewiew for the addition of another constructor to PriorityQueue. Currently if you wish to specify a Comparator you must also supply a size. This addition allows use of the default size which is good for two reason; you don't have to specify a fixed value and the implementation can change it's default as appropriate. > > http://cr.openjdk.java.net/~mduigou/JDK-6799426/0/webrev/ Looks fine to me Mike. -Chris. > > Mike From pbenedict at apache.org Mon Jul 22 21:00:13 2013 From: pbenedict at apache.org (Paul Benedict) Date: Mon, 22 Jul 2013 16:00:13 -0500 Subject: RFR : 6799426 : (xs) Add constructor PriorityQueue(Comparator) Message-ID: Mike, I know the description is pulled from the previous constructor, but both sound a bit awkward. Both can probably benefit from an improvement. Currently: "Creates a {@code PriorityQueue} with the default initial capacity that orders its elements according to the specified comparator." Depending on one's spoken emphasis, it can sound as if the capacity is the one causing the elements to be ordered. Suggestion: "Creates a {@code PriorityQueue} with the default initial capacity and whose elements are ordered according to the specified comparator." Cheers, Paul From mike.duigou at oracle.com Mon Jul 22 21:04:03 2013 From: mike.duigou at oracle.com (mike.duigou at oracle.com) Date: Mon, 22 Jul 2013 21:04:03 +0000 Subject: hg: jdk8/tl/jdk: 6799426: Adds constructor PriorityQueue(Comparator) Message-ID: <20130722210415.583074827A@hg.openjdk.java.net> Changeset: a6cbb9808e4b Author: mduigou Date: 2013-07-22 12:59 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/a6cbb9808e4b 6799426: Adds constructor PriorityQueue(Comparator) Reviewed-by: lancea ! src/share/classes/java/util/PriorityQueue.java From mike.duigou at oracle.com Mon Jul 22 21:21:32 2013 From: mike.duigou at oracle.com (Mike Duigou) Date: Mon, 22 Jul 2013 14:21:32 -0700 Subject: RFR : 6799426 : (xs) Add constructor PriorityQueue(Comparator) In-Reply-To: References: Message-ID: <75147DB4-1F7B-414C-9571-AFA1CB5B7E58@oracle.com> Reasonable comment but unfortunately missed my push by mere seconds. I've made a note to correct the docs but will likely wait for some other issue to incorporate it. Mike On Jul 22 2013, at 14:00 , Paul Benedict wrote: > Mike, > > I know the description is pulled from the previous constructor, but both > sound a bit awkward. Both can probably benefit from an improvement. > > Currently: > "Creates a {@code PriorityQueue} with the default initial capacity that > orders its elements according to the specified comparator." > > Depending on one's spoken emphasis, it can sound as if the capacity is the > one causing the elements to be ordered. > > Suggestion: > "Creates a {@code PriorityQueue} with the default initial capacity and > whose elements are ordered according to the specified comparator." > > Cheers, > Paul From john.r.rose at oracle.com Mon Jul 22 21:41:38 2013 From: john.r.rose at oracle.com (John Rose) Date: Mon, 22 Jul 2013 14:41:38 -0700 Subject: RFR: 8019840 : (s) Spec updates to java.util.function package In-Reply-To: References: Message-ID: <1EA308F2-4BCF-4017-BE02-F424D29FF758@oracle.com> Good; 'andThen' is a more productive[1] term than 'chain'. [1]: http://en.wikipedia.org/wiki/Productivity_(linguistics) ? John From brian.burkhalter at oracle.com Mon Jul 22 23:47:55 2013 From: brian.burkhalter at oracle.com (Brian Burkhalter) Date: Mon, 22 Jul 2013 16:47:55 -0700 Subject: Java 8 RFR 6476168: (fmt) Inconsistency formatting subnormal doubles with hexadecimal conversion In-Reply-To: <51E9DBED.2040204@oracle.com> References: <23721DCA-F2A2-4B97-9CC0-56151ACD7E95@oracle.com> <51E77DA2.1050304@oracle.com> <8D0EE76E-9C2E-4D5F-B687-E7D154AE4A30@oracle.com> <51E9DBED.2040204@oracle.com> Message-ID: An updated webrev is in the same location: http://cr.openjdk.java.net/~bpb/6476168/. On Jul 19, 2013, at 5:38 PM, Joseph Darcy wrote: > A spec quibble "decimal separator" isn't really the appropriate term for the hex formatting. I've changed this in the verbiage on lines 613 and 1376 of Formatter. The other usages of "decimal separator" are unchanged. > I think some more test cases and needed: > > * Subnormal result rounding up to normal range under reduced precision. Something like nextDown(Double.MIN_NORMAL) (a subnormal value) rounded to between 1 and 11 digits of precision. Added as Basic-X line 1360. > * Double.MAX_VALUE rounded to fewer than 12 digits. Offhand, I'm not sure what the implementation will do here; returning infinity or a hex string with an extra big exponent are both defensible. Added as Basic-X line 1361. The returned value for %1.9a is 0x1.000000000p1024. Thanks, Brian From joe.darcy at oracle.com Tue Jul 23 01:13:01 2013 From: joe.darcy at oracle.com (Joseph Darcy) Date: Mon, 22 Jul 2013 18:13:01 -0700 Subject: Java 8 RFR 6476168: (fmt) Inconsistency formatting subnormal doubles with hexadecimal conversion In-Reply-To: References: <23721DCA-F2A2-4B97-9CC0-56151ACD7E95@oracle.com> <51E77DA2.1050304@oracle.com> <8D0EE76E-9C2E-4D5F-B687-E7D154AE4A30@oracle.com> <51E9DBED.2040204@oracle.com> Message-ID: <51EDD89D.9070309@oracle.com> Hi Brian, Almost there! A few additional comments. On 7/22/2013 4:47 PM, Brian Burkhalter wrote: > An updated webrev is in the same location: http://cr.openjdk.java.net/~bpb/6476168/. > > On Jul 19, 2013, at 5:38 PM, Joseph Darcy wrote: > >> A spec quibble "decimal separator" isn't really the appropriate term for the hex formatting. > I've changed this in the verbiage on lines 613 and 1376 of Formatter. The other usages of "decimal separator" are unchanged. > >> I think some more test cases and needed: >> >> * Subnormal result rounding up to normal range under reduced precision. Something like nextDown(Double.MIN_NORMAL) (a subnormal value) rounded to between 1 and 11 digits of precision. The changes in that block include 1353 // 6476168: subnormal formatting and precision It is not customary, and usually not desirable, to include the bug id. Additionally, the new block of test cases tests for subnormal as well as underflow the comment is not accurate. It is not necessary to write Double.parseDouble("0x0.123p-1022") you can just write 0x0.123p-1022 using the hexadecimal notation for a floating-point literal. I'd like to see a few more test cases that probe at boundaries, such as Double.MAX_VALUE rounding to 9, 6, 2, 1, digits of precision. There are also cases of interest to make sure the round to nearest even rounding policy is being used. If a value like 0.123xxxxxxxxxxxx is rounded to three digits, the value of xxxxxxxxxxxx will determine whether or not an increment occurs. > Added as Basic-X line 1360. > >> * Double.MAX_VALUE rounded to fewer than 12 digits. Offhand, I'm not sure what the implementation will do here; returning infinity or a hex string with an extra big exponent are both defensible. > Added as Basic-X line 1361. The returned value for %1.9a is 0x1.000000000p1024. Of the two options, that value is preferable. Thanks, -Joe > > Thanks, > > Brian From joe.darcy at oracle.com Tue Jul 23 05:12:03 2013 From: joe.darcy at oracle.com (joe.darcy at oracle.com) Date: Tue, 23 Jul 2013 05:12:03 +0000 Subject: hg: jdk8/tl/jdk: 8021109: Add serialVersionUID to LambdaConversionException.java Message-ID: <20130723051217.A34E548288@hg.openjdk.java.net> Changeset: 7716beb127d4 Author: darcy Date: 2013-07-22 22:11 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/7716beb127d4 8021109: Add serialVersionUID to LambdaConversionException.java Reviewed-by: jrose ! src/share/classes/java/lang/invoke/LambdaConversionException.java From paul.sandoz at oracle.com Tue Jul 23 08:54:49 2013 From: paul.sandoz at oracle.com (Paul Sandoz) Date: Tue, 23 Jul 2013 09:54:49 +0100 Subject: RFR: 8016846: Pattern.splitAsStream tests required In-Reply-To: <51E5998E.8040409@oracle.com> References: <51E5998E.8040409@oracle.com> Message-ID: On Jul 16, 2013, at 8:05 PM, Henry Jen wrote: > Hi, > > Please review the webrev at, > > http://cr.openjdk.java.net/~henryjen/tl/8016846/0/webrev/ > > The test is mostly contributed by Ben Evans. > Looks OK to me. Paul. From ivan.gerasimov at oracle.com Tue Jul 23 10:06:36 2013 From: ivan.gerasimov at oracle.com (Ivan Gerasimov) Date: Tue, 23 Jul 2013 14:06:36 +0400 Subject: RFR [8020669] java.nio.file.Files.readAllBytes() does not read any data when Files.size() is 0 In-Reply-To: <51ED57D8.90001@oracle.com> References: <51E97416.20506@oracle.com> <51E98043.6030102@oracle.com> <51E9853E.8020409@redhat.com> <51E985AD.60401@redhat.com> <51EB0BFF.3030106@oracle.com> <51ED57D8.90001@oracle.com> Message-ID: <51EE55AC.5000902@oracle.com> Hi Roger! This is how my implementation behaves: - allocate 'size' bytes in BAOS - allocate 8k for temp buffer - in cycle read 8k or less bytes from input stream and copy them into BAOS - if capacity of BAOS isn't sufficient (file had grown), its buffer will be reallocated Thus, 1 reallocation and 1 copying of already read data on each 8k piece of additional bytes. In normal case, i.e. when fc.size() is correct, we have overhead of 1 allocation and copying 'size' bytes in size/8k iterations. And this is how current implementation does - allocate 'size' bytes - allocate 'size' bytes of native memory for temp buffer in IOUtil.read() - read the whole file into temp buffer - copy the temp buffer back into our buffer In common when fc.size() is right, we have 1 allocation and copying 'size' bytes from temp buffer back. So there is a difference in allocations/copying, but in my opinion it's not that significant for this particular task. Sincerely yours, Ivan On 22.07.2013 20:03, roger riggs wrote: > Hi Ivan, > > I'm concerned about the change in behavior for the existing working > cases. > > How many times are the bytes copied in your proposed implementation? > How many arrays are allocated and discarded? > Files.copy() uses an extra array for the copies. > > BAOS should only be used for size == 0; that would address the issue > without changing the current behavior or allocations. > > Roger > > > > > On 7/20/2013 6:15 PM, Ivan Gerasimov wrote: >> Roger, David thanks for suggestions! >> >> Would you please take a look at an updated webrev? >> http://cr.openjdk.java.net/~igerasim/8020669/1/webrev/ >> >> - File size is used as an initial size of BAOS's buffer. >> - BAOS avoids copying its buffer in toByteArray(), if size is correct . >> >> I don't want to initialize BAOS with a positive number if size >> happened to be zero. >> Because zero could indicate that the file is really empty. >> >> Sincerely yours, >> Ivan >> >> On 19.07.2013 22:30, David M. Lloyd wrote: >>> My mistake, we're not talking about strings. Still you can subclass >>> and determine whether the buffer size guess was right, and if so >>> return the array as-is (swap in an empty array or something as needed). >>> >>> On 07/19/2013 01:28 PM, David M. Lloyd wrote: >>>> It's trivial to subclass ByteArrayOutputStream and add a method which >>>> converts its contents to a string using the two protected fields which >>>> give you all the info you need to do so. So no extra copy is needed >>>> that you aren't already doing. >>>> >>>> On 07/19/2013 01:06 PM, roger riggs wrote: >>>>> Hi Ivan, >>>>> >>>>> I think this change takes too big a hit for the cases where the >>>>> size is >>>>> correct. >>>>> >>>>> No real file system can be wrong about the size of a file so this >>>>> is a >>>>> problem >>>>> only for special file systems. If the problem is with size >>>>> reporting zero >>>>> then maybe using the incremental read only for size == would be a >>>>> better >>>>> fix. >>>>> >>>>> At least you could pass the size to the constructor for BAOS and >>>>> avoid >>>>> the thrashing for every re-size; but still it will allocate and >>>>> create >>>>> an extra copy >>>>> of the every time. >>>>> >>>>> $.02, Roger >>>>> >>>>> >>>>> On 7/19/2013 1:15 PM, Ivan Gerasimov wrote: >>>>>> Hello everybody! >>>>>> >>>>>> Would you please review a fix for the problem with >>>>>> j.n.f.Files.readAllBytes() function? >>>>>> The current implementation relies on FileChannel.size() to >>>>>> preallocate >>>>>> a buffer for the whole file's content. >>>>>> However, some special filesystems can report a wrong size. >>>>>> An example is procfs under Linux, which reports many files under >>>>>> /proc >>>>>> to be zero sized. >>>>>> >>>>>> Thus it is proposed not to rely on the size() and instead >>>>>> continuously >>>>>> read until EOF. >>>>>> >>>>>> The downside is reallocation and copying file content between >>>>>> buffers. >>>>>> But taking into account that the doc says: "It is not intended for >>>>>> reading in large files." it should not be a big problem. >>>>>> >>>>>> http://bugs.sun.com/view_bug.do?bug_id=8020669 >>>>>> http://cr.openjdk.java.net/~igerasim/8020669/0/webrev/ >>>>>> >>>>>> The fix is for JDK8. If it is approved, it can be applied to JDK7 as >>>>>> well. >>>>>> >>>>>> Sincerely yours, >>>>>> Ivan Gerasimov >>>>> >>>> >>>> >>> >>> >> > > > From daniel.fuchs at oracle.com Tue Jul 23 13:08:48 2013 From: daniel.fuchs at oracle.com (Daniel Fuchs) Date: Tue, 23 Jul 2013 15:08:48 +0200 Subject: RFR: 8019948: java/util/logging/bundlesearch/ResourceBundleSearchTest.java is failing intermitently Message-ID: <51EE8060.2060105@oracle.com> Hi, Please find below a changeset for fixing 8019948: java/util/logging/bundlesearch/ResourceBundleSearchTest.java is failing intermittently [1] This appears to be a test bug due to a bizarre use of synchronization in the test. The test was failing regularly before the fix (= often enough), but I haven't managed to reproduce since I changed lr.wait() into lr.join(); http://cr.openjdk.java.net/~dfuchs/webrev_8019948/webrev.00/ best regards, -- daniel [1] https://jbs.oracle.com/bugs/browse/JDK-8019948 From david.lloyd at redhat.com Tue Jul 23 14:09:30 2013 From: david.lloyd at redhat.com (David M. Lloyd) Date: Tue, 23 Jul 2013 09:09:30 -0500 Subject: RFR [8020669] java.nio.file.Files.readAllBytes() does not read any data when Files.size() is 0 In-Reply-To: <51EE55AC.5000902@oracle.com> References: <51E97416.20506@oracle.com> <51E98043.6030102@oracle.com> <51E9853E.8020409@redhat.com> <51E985AD.60401@redhat.com> <51EB0BFF.3030106@oracle.com> <51ED57D8.90001@oracle.com> <51EE55AC.5000902@oracle.com> Message-ID: <51EE8E9A.6040806@redhat.com> Here's how it should behave: - allocate 'size' byte byte array - if size > 0: - use simple old I/O to read into the array - do a one-byte read(), if not EOF then expand the array, using a simple growth pattern like 3/2 (with a special case for 0), and continue reading until EOF - if the array matches the size of the file, return the array, else use copyOf() to shrink it This way you only ever copy the array size() was wrong. On 07/23/2013 05:06 AM, Ivan Gerasimov wrote: > Hi Roger! > > This is how my implementation behaves: > - allocate 'size' bytes in BAOS > - allocate 8k for temp buffer > - in cycle read 8k or less bytes from input stream and copy them into BAOS > - if capacity of BAOS isn't sufficient (file had grown), its buffer will > be reallocated > Thus, 1 reallocation and 1 copying of already read data on each 8k piece > of additional bytes. > > In normal case, i.e. when fc.size() is correct, we have overhead of 1 > allocation and copying 'size' bytes in size/8k iterations. > > And this is how current implementation does > - allocate 'size' bytes > - allocate 'size' bytes of native memory for temp buffer in IOUtil.read() > - read the whole file into temp buffer > - copy the temp buffer back into our buffer > > In common when fc.size() is right, we have 1 allocation and copying > 'size' bytes from temp buffer back. > > So there is a difference in allocations/copying, but in my opinion it's > not that significant for this particular task. > > Sincerely yours, > Ivan > > On 22.07.2013 20:03, roger riggs wrote: >> Hi Ivan, >> >> I'm concerned about the change in behavior for the existing working >> cases. >> >> How many times are the bytes copied in your proposed implementation? >> How many arrays are allocated and discarded? >> Files.copy() uses an extra array for the copies. >> >> BAOS should only be used for size == 0; that would address the issue >> without changing the current behavior or allocations. >> >> Roger >> >> >> >> >> On 7/20/2013 6:15 PM, Ivan Gerasimov wrote: >>> Roger, David thanks for suggestions! >>> >>> Would you please take a look at an updated webrev? >>> http://cr.openjdk.java.net/~igerasim/8020669/1/webrev/ >>> >>> - File size is used as an initial size of BAOS's buffer. >>> - BAOS avoids copying its buffer in toByteArray(), if size is correct . >>> >>> I don't want to initialize BAOS with a positive number if size >>> happened to be zero. >>> Because zero could indicate that the file is really empty. >>> >>> Sincerely yours, >>> Ivan >>> >>> On 19.07.2013 22:30, David M. Lloyd wrote: >>>> My mistake, we're not talking about strings. Still you can subclass >>>> and determine whether the buffer size guess was right, and if so >>>> return the array as-is (swap in an empty array or something as needed). >>>> >>>> On 07/19/2013 01:28 PM, David M. Lloyd wrote: >>>>> It's trivial to subclass ByteArrayOutputStream and add a method which >>>>> converts its contents to a string using the two protected fields which >>>>> give you all the info you need to do so. So no extra copy is needed >>>>> that you aren't already doing. >>>>> >>>>> On 07/19/2013 01:06 PM, roger riggs wrote: >>>>>> Hi Ivan, >>>>>> >>>>>> I think this change takes too big a hit for the cases where the >>>>>> size is >>>>>> correct. >>>>>> >>>>>> No real file system can be wrong about the size of a file so this >>>>>> is a >>>>>> problem >>>>>> only for special file systems. If the problem is with size >>>>>> reporting zero >>>>>> then maybe using the incremental read only for size == would be a >>>>>> better >>>>>> fix. >>>>>> >>>>>> At least you could pass the size to the constructor for BAOS and >>>>>> avoid >>>>>> the thrashing for every re-size; but still it will allocate and >>>>>> create >>>>>> an extra copy >>>>>> of the every time. >>>>>> >>>>>> $.02, Roger >>>>>> >>>>>> >>>>>> On 7/19/2013 1:15 PM, Ivan Gerasimov wrote: >>>>>>> Hello everybody! >>>>>>> >>>>>>> Would you please review a fix for the problem with >>>>>>> j.n.f.Files.readAllBytes() function? >>>>>>> The current implementation relies on FileChannel.size() to >>>>>>> preallocate >>>>>>> a buffer for the whole file's content. >>>>>>> However, some special filesystems can report a wrong size. >>>>>>> An example is procfs under Linux, which reports many files under >>>>>>> /proc >>>>>>> to be zero sized. >>>>>>> >>>>>>> Thus it is proposed not to rely on the size() and instead >>>>>>> continuously >>>>>>> read until EOF. >>>>>>> >>>>>>> The downside is reallocation and copying file content between >>>>>>> buffers. >>>>>>> But taking into account that the doc says: "It is not intended for >>>>>>> reading in large files." it should not be a big problem. >>>>>>> >>>>>>> http://bugs.sun.com/view_bug.do?bug_id=8020669 >>>>>>> http://cr.openjdk.java.net/~igerasim/8020669/0/webrev/ >>>>>>> >>>>>>> The fix is for JDK8. If it is approved, it can be applied to JDK7 as >>>>>>> well. >>>>>>> >>>>>>> Sincerely yours, >>>>>>> Ivan Gerasimov >>>>>> >>>>> >>>>> >>>> >>>> >>> >> >> >> > -- - DML From ivan.gerasimov at oracle.com Tue Jul 23 14:14:06 2013 From: ivan.gerasimov at oracle.com (Ivan Gerasimov) Date: Tue, 23 Jul 2013 18:14:06 +0400 Subject: RFR [8016838] java/lang/instrument/RedefineBigClass.sh needs modification In-Reply-To: <51DD399E.4030105@oracle.com> References: <51D45B8C.7010109@oracle.com> <51D595ED.7050902@oracle.com> <51D5AEB6.3060608@oracle.com> <51D5B4C5.7060402@oracle.com> <51D61A66.5010001@oracle.com> <51D64D15.2090105@oracle.com> <51D6A59A.1060703@oracle.com> <51D6B1ED.9090709@oracle.com> <51DAEF13.8010000@oracle.com> <51DAF69C.3000404@oracle.com> <51DC0B8C.9010804@oracle.com> <51DD2638.9070801@oracle.com> <51DD399E.4030105@oracle.com> Message-ID: <51EE8FAE.90808@oracle.com> Hello Daniel! Can we please move forward with this issue? I've just checked how the tests run against the latest jdk build (which is 99), and the leak is still there. Thus the proposed change (including ProblemList modifications) is still actual. Here's a link to the latest webrev: http://cr.openjdk.java.net/~igerasim/8016838/3/webrev/ I've also run jprt job to check how it works on all other platforms: http://prt-web.us.oracle.com//archive/2013/07/2013-07-22-143846.igerasim.jdk/logs/ On all the platforms (including 32-bit Linux) the tests passed as expected, on the Linux-x64 both tests were skipped. Virtual memory growth across {fastdebug,product}-{c1,c2} targets was in range from 1188K to 2584K which is less than the chosen threshold of 32M. Sincerely yours, Ivan Gerasimov On 10.07.2013 14:38, Ivan Gerasimov wrote: > Yes, I forgot to include the most important thing - a link to webrev! > Your link is correct. > http://cr.openjdk.java.net/~igerasim/8016838/3/webrev/ > > The tests fail on linux-x64 only, linux-i586 is fine. > Here's the link to the logs of the tests run by Daniel Daugherty: > http://prt-web.us.oracle.com//archive/2013/07/2013-07-05-045326.ddaugher.8016838_exp/logs/ > > > Thus the memory leak seems to be specific to 64-bit Linux. > > Sincerely yours, > Ivan > > On 10.07.2013 13:15, Se?n Coffey wrote: >> Ivan, >> >> I'll assume this is the latest webrev : >> http://cr.openjdk.java.net/~igerasim/8016838/3/webrev/ >> >> >> One comment - should the test be excluded for all linux variants >> (i.e. linux-all) ? >> >> regards, >> Sean. >> >> On 09/07/2013 14:09, Ivan Gerasimov wrote: >>> Please have a chance to review an updated webrev. >>> It now includes a change to ProblemList.txt, so both modified tests >>> are ignored for linux-x64. >>> >>> Sincerely yours, >>> Ivan Gersimov >>> >>> On 08.07.2013 21:27, Se?n Coffey wrote: >>>> >>>> On 08/07/13 17:55, Ivan Gerasimov wrote: >>>>> Thanks, Se?n! >>>>> >>>>> I located the build in which the memleak was first introduced -- >>>>> it is jdk8-b69 (hs25-b13). >>>>> I've updated the bug >>>>> http://bugs.sun.com/view_bug.do?bug_id=8019845 with this. >>>>> >>>>> So what is the correct procedure to go forward now? >>>>> Should I update the webrev to include changes to the problem list? >>>>> I believe I shouldn't -- this list seems to be a sensitive stuff. >>>> I'd suggest updating the webrev with the ProblemList >>>> modification/addition. It's best not to add a test to testruns if >>>> it's knowingly failing. The test can be removed from ProblemList >>>> when the jdk8 regression is fixed. >>>> >>>> regards, >>>> Sean. >>>> >>>>> >>>>> Sincerely yours, >>>>> Ivan >>>>> >>>>> >>>>> On 05.07.2013 15:45, Se?n Coffey wrote: >>>>>> Nice work indeed Ivan. Good to have a reliable testcase to catch >>>>>> leaks in this area. >>>>>> >>>>>> I'd also suggest that this test goes on the ProblemList until the >>>>>> new leak is sorted out for jdk8. The goal of JPRT runs is to have >>>>>> clean runs. If it's on the problemList, then it's a known issue >>>>>> and is normally tagged with the relevant bug ID so that the >>>>>> responsible engineer knows the current state. >>>>>> >>>>>> regards, >>>>>> Sean. >>>>>> >>>>>> On 05/07/2013 11:53, Ivan Gerasimov wrote: >>>>>>> >>>>>>> On 05.07.2013 8:35, Daniel D. Daugherty wrote: >>>>>>>> Ivan, >>>>>>>> >>>>>>>> The changes look fine, I can sponsor your commit, looks like your >>>>>>>> OpenJDK user name is 'igerasim', but I need to know a little bit >>>>>>>> more about your testing of these fixes. Did you do a test JPRT >>>>>>>> job to run the JLI tests (or just the two tests themselves)? >>>>>>>> >>>>>>> I've only run test from java/lang/instrument when checked the >>>>>>> change with JDK6u60 (all passed) and with JDK6u51 (the test >>>>>>> failed as expected, since the leak had still been there.) >>>>>>> >>>>>>>> Based on e-mail about this bug fix, I believe you've found a new >>>>>>>> leak in JDK8/HSX-25 with test >>>>>>>> java/lang/instrument/RedefineBigClass.sh. >>>>>>> Right. The test shown a memleak with the the latest jdk8. >>>>>>> I filed a bug 8019845 about this leak. >>>>>>> Stefan Karlsson guessed that this may be related to 8003419 >>>>>>> (NPG: Clean up metadata created during class loading if failure) >>>>>>> Then I've checked the builds b57 (test failed) and b58 (test >>>>>>> passed), so I confirmed that it may be the reason of the leak >>>>>>> being observed now. >>>>>>> But now I think that the reason may be different. >>>>>>> It just turns out that the test shows failures for (at least) >>>>>>> three different leaks - the one you, Daniel, solved (7121600), >>>>>>> the one Stefan wrote about (8003419) and the one currently >>>>>>> observed (8019845). >>>>>>> >>>>>>>> That's a good thing, but I think Alan and company would be a bit >>>>>>>> grumpy with me if I pushed a test that failed as soon as someone >>>>>>>> ran it. :-) Do you know if the revised RetransformBigClass.sh also >>>>>>>> finds a new memory leak in JDK8/HSX-25? >>>>>>>> >>>>>>>> The way to deal with that is to put the test on the Problem.list >>>>>>>> as part of the same changeset. However, the T&L folks might not >>>>>>>> like >>>>>>>> that either... >>>>>>> >>>>>>> Well, the leak is there, and why not have a failing test as a >>>>>>> reminder to have it fixed? >>>>>>> >>>>>>> Sincerely yours, >>>>>>> Ivan Gerasimov >>>>>>> >>>>>>>> >>>>>>>> Dan >>>>>>>> >>>>>>>> >>>>>>>> On 7/4/13 6:59 PM, Ivan Gerasimov wrote: >>>>>>>>> Thank you, Daniel! >>>>>>>>> >>>>>>>>> Please find an updated webrev at >>>>>>>>> http://cr.openjdk.java.net/~igerasim/8016838/2/webrev/. >>>>>>>>> It now includes the RetransformBigClass test modified in the >>>>>>>>> same way as RedefineBigClass >>>>>>>>> If the changes look fine, may I ask you to sponsor the commit, >>>>>>>>> as I'm not a committer? >>>>>>>>> Here's a link to hg export: >>>>>>>>> http://cr.openjdk.java.net/~igerasim/2commit/8016838-jdk8-ReBigClass-improved.patch >>>>>>>>> >>>>>>>>> >>>>>>>>> Thanks in advance, >>>>>>>>> Ivan >>>>>>>>> >>>>>>>>> On 04.07.2013 21:45, Daniel D. Daugherty wrote: >>>>>>>>>> On 7/4/13 11:19 AM, Ivan Gerasimov wrote: >>>>>>>>>>> Daniel, thank you for review! >>>>>>>>>>> >>>>>>>>>>> Here's the updated with all all your suggestions adopted. >>>>>>>>>>> http://cr.openjdk.java.net/~igerasim/8016838/1/webrev/ >>>>>>>>>> >>>>>>>>>> Looks good. >>>>>>>>>> >>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> I haven't yet considered applying the approach to >>>>>>>>>>> RetransformBigClass. >>>>>>>>>>> Do you want me to include this into this same change set or >>>>>>>>>>> should I make it separately? >>>>>>>>>> >>>>>>>>>> I would include it in the same changeset. >>>>>>>>>> >>>>>>>>>> Dan >>>>>>>>>> >>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> Sincerely yours, >>>>>>>>>>> Ivan >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> On 04.07.2013 19:34, Daniel D. Daugherty wrote: >>>>>>>>>>>> On 7/3/13 11:12 AM, Ivan Gerasimov wrote: >>>>>>>>>>>>> Hello everybody! >>>>>>>>>>>>> >>>>>>>>>>>>> We have a request to improve jtreg test. >>>>>>>>>>>>> The test had been written to verify fix for memory leak >>>>>>>>>>>>> during class redefinition. >>>>>>>>>>>>> The problem is that it always is reported as PASSED even >>>>>>>>>>>>> in the presence of the leak. >>>>>>>>>>>>> >>>>>>>>>>>>> The proposed change is platform specific. >>>>>>>>>>>>> It allows memory leak detection only on Linux. >>>>>>>>>>>>> This is because the memory leak was in native code, so >>>>>>>>>>>>> there's no easy way to detect it from within Java code. >>>>>>>>>>>>> >>>>>>>>>>>>> Here's the webrev for JDK8 repository: >>>>>>>>>>>>> http://cr.openjdk.java.net/~igerasim/8016838/0/webrev/ >>>>>>>>>>>> >>>>>>>>>>>> Very nicely done! The logic in RedefineBigClass.sh only >>>>>>>>>>>> catches a >>>>>>>>>>>> leak big enough to cause an Exception to be thrown. >>>>>>>>>>>> >>>>>>>>>>>> When I originally wrote this test and its companion: >>>>>>>>>>>> >>>>>>>>>>>> test/java/lang/instrument/RetransformBigClass* >>>>>>>>>>>> >>>>>>>>>>>> I could not come up with a platform independent way to put >>>>>>>>>>>> a small >>>>>>>>>>>> upper limit on memory growth. It never dawned on me that >>>>>>>>>>>> putting in >>>>>>>>>>>> something on one platform (Linux) was better than nothing. >>>>>>>>>>>> >>>>>>>>>>>> Are you planning to add this same logic to >>>>>>>>>>>> RetransformBigClass*? >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> test/java/lang/instrument/RedefineBigClass.sh >>>>>>>>>>>> No comments. >>>>>>>>>>>> >>>>>>>>>>>> test/java/lang/instrument/RedefineBigClassApp.java >>>>>>>>>>>> line 48: final long MEM_LEAK_THRESHOLD = 32 * 1024; // >>>>>>>>>>>> 32Mb >>>>>>>>>>>> Would be better at the top of RedefineBigClassApp >>>>>>>>>>>> rather than >>>>>>>>>>>> "buried" down here. >>>>>>>>>>>> >>>>>>>>>>>> line 51: Long.valueOf(vmMemDelta) >>>>>>>>>>>> There are several places where a long is passed to >>>>>>>>>>>> Long.valueOf(). >>>>>>>>>>>> Is there some reason you're not passing them >>>>>>>>>>>> directly to println()? >>>>>>>>>>>> >>>>>>>>>>>> line 54: } else { >>>>>>>>>>>> The "else" is redundant due to the "System.exit(1)" >>>>>>>>>>>> call above it. >>>>>>>>>>>> You can drop the "else {" and "}" and shift that >>>>>>>>>>>> last println() to >>>>>>>>>>>> the left. >>>>>>>>>>>> >>>>>>>>>>>> line 71: return Long.parseLong(line.split(" ")[22]) / >>>>>>>>>>>> 1024; >>>>>>>>>>>> How about at least a comment referring to the Linux >>>>>>>>>>>> proc(5) >>>>>>>>>>>> man page... and the fact that the 23rd field is: >>>>>>>>>>>> >>>>>>>>>>>> vsize %lu Virtual memory size in bytes. >>>>>>>>>>>> >>>>>>>>>>>> Again, very nicely done! >>>>>>>>>>>> >>>>>>>>>>>> Dan >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>> The surprising thing is that modified test detected the >>>>>>>>>>>>> leak with the latest JDK8! >>>>>>>>>>>>> Latest 6 and 7 are fine, so it might be regression in JDK8. >>>>>>>>>>>>> >>>>>>>>>>>>> I've filled a bug >>>>>>>>>>>>> http://bugs.sun.com/view_bug.do?bug_id=8019845 "Memory >>>>>>>>>>>>> leak during class redefenition" (not yet available.) >>>>>>>>>>>>> >>>>>>>>>>>>> Sincerely yours, >>>>>>>>>>>>> Ivan Gerasimov >>>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>> >>>>>> >>>>>> >>>>>> >>>>> >>>> >>>> >>>> >>> >> >> >> > > > From daniel.daugherty at oracle.com Tue Jul 23 14:50:16 2013 From: daniel.daugherty at oracle.com (Daniel D. Daugherty) Date: Tue, 23 Jul 2013 08:50:16 -0600 Subject: RFR [8016838] java/lang/instrument/RedefineBigClass.sh needs modification In-Reply-To: <51EE8FAE.90808@oracle.com> References: <51D45B8C.7010109@oracle.com> <51D595ED.7050902@oracle.com> <51D5AEB6.3060608@oracle.com> <51D5B4C5.7060402@oracle.com> <51D61A66.5010001@oracle.com> <51D64D15.2090105@oracle.com> <51D6A59A.1060703@oracle.com> <51D6B1ED.9090709@oracle.com> <51DAEF13.8010000@oracle.com> <51DAF69C.3000404@oracle.com> <51DC0B8C.9010804@oracle.com> <51DD2638.9070801@oracle.com> <51DD399E.4030105@oracle.com> <51EE8FAE.90808@oracle.com> Message-ID: <51EE9828.4070200@oracle.com> Ivan, Sorry for forgetting about this issue... On 7/23/13 8:14 AM, Ivan Gerasimov wrote: > Hello Daniel! > > Can we please move forward with this issue? Yes. Do you have a pointer to the committed patch file? If so, I'll take care of getting the fix into JDK8-T&L. Dan > I've just checked how the tests run against the latest jdk build > (which is 99), and the leak is still there. > Thus the proposed change (including ProblemList modifications) is > still actual. > > Here's a link to the latest webrev: > http://cr.openjdk.java.net/~igerasim/8016838/3/webrev/ > > I've also run jprt job to check how it works on all other platforms: > http://prt-web.us.oracle.com//archive/2013/07/2013-07-22-143846.igerasim.jdk/logs/ > > > On all the platforms (including 32-bit Linux) the tests passed as > expected, on the Linux-x64 both tests were skipped. > > Virtual memory growth across {fastdebug,product}-{c1,c2} targets was > in range from 1188K to 2584K which is less than the chosen threshold > of 32M. > > Sincerely yours, > Ivan Gerasimov > > > On 10.07.2013 14:38, Ivan Gerasimov wrote: >> Yes, I forgot to include the most important thing - a link to webrev! >> Your link is correct. >> http://cr.openjdk.java.net/~igerasim/8016838/3/webrev/ >> >> The tests fail on linux-x64 only, linux-i586 is fine. >> Here's the link to the logs of the tests run by Daniel Daugherty: >> http://prt-web.us.oracle.com//archive/2013/07/2013-07-05-045326.ddaugher.8016838_exp/logs/ >> >> >> Thus the memory leak seems to be specific to 64-bit Linux. >> >> Sincerely yours, >> Ivan >> >> On 10.07.2013 13:15, Se?n Coffey wrote: >>> Ivan, >>> >>> I'll assume this is the latest webrev : >>> http://cr.openjdk.java.net/~igerasim/8016838/3/webrev/ >>> >>> >>> One comment - should the test be excluded for all linux variants >>> (i.e. linux-all) ? >>> >>> regards, >>> Sean. >>> >>> On 09/07/2013 14:09, Ivan Gerasimov wrote: >>>> Please have a chance to review an updated webrev. >>>> It now includes a change to ProblemList.txt, so both modified tests >>>> are ignored for linux-x64. >>>> >>>> Sincerely yours, >>>> Ivan Gersimov >>>> >>>> On 08.07.2013 21:27, Se?n Coffey wrote: >>>>> >>>>> On 08/07/13 17:55, Ivan Gerasimov wrote: >>>>>> Thanks, Se?n! >>>>>> >>>>>> I located the build in which the memleak was first introduced -- >>>>>> it is jdk8-b69 (hs25-b13). >>>>>> I've updated the bug >>>>>> http://bugs.sun.com/view_bug.do?bug_id=8019845 with this. >>>>>> >>>>>> So what is the correct procedure to go forward now? >>>>>> Should I update the webrev to include changes to the problem list? >>>>>> I believe I shouldn't -- this list seems to be a sensitive stuff. >>>>> I'd suggest updating the webrev with the ProblemList >>>>> modification/addition. It's best not to add a test to testruns if >>>>> it's knowingly failing. The test can be removed from ProblemList >>>>> when the jdk8 regression is fixed. >>>>> >>>>> regards, >>>>> Sean. >>>>> >>>>>> >>>>>> Sincerely yours, >>>>>> Ivan >>>>>> >>>>>> >>>>>> On 05.07.2013 15:45, Se?n Coffey wrote: >>>>>>> Nice work indeed Ivan. Good to have a reliable testcase to catch >>>>>>> leaks in this area. >>>>>>> >>>>>>> I'd also suggest that this test goes on the ProblemList until >>>>>>> the new leak is sorted out for jdk8. The goal of JPRT runs is to >>>>>>> have clean runs. If it's on the problemList, then it's a known >>>>>>> issue and is normally tagged with the relevant bug ID so that >>>>>>> the responsible engineer knows the current state. >>>>>>> >>>>>>> regards, >>>>>>> Sean. >>>>>>> >>>>>>> On 05/07/2013 11:53, Ivan Gerasimov wrote: >>>>>>>> >>>>>>>> On 05.07.2013 8:35, Daniel D. Daugherty wrote: >>>>>>>>> Ivan, >>>>>>>>> >>>>>>>>> The changes look fine, I can sponsor your commit, looks like your >>>>>>>>> OpenJDK user name is 'igerasim', but I need to know a little bit >>>>>>>>> more about your testing of these fixes. Did you do a test JPRT >>>>>>>>> job to run the JLI tests (or just the two tests themselves)? >>>>>>>>> >>>>>>>> I've only run test from java/lang/instrument when checked the >>>>>>>> change with JDK6u60 (all passed) and with JDK6u51 (the test >>>>>>>> failed as expected, since the leak had still been there.) >>>>>>>> >>>>>>>>> Based on e-mail about this bug fix, I believe you've found a new >>>>>>>>> leak in JDK8/HSX-25 with test >>>>>>>>> java/lang/instrument/RedefineBigClass.sh. >>>>>>>> Right. The test shown a memleak with the the latest jdk8. >>>>>>>> I filed a bug 8019845 about this leak. >>>>>>>> Stefan Karlsson guessed that this may be related to 8003419 >>>>>>>> (NPG: Clean up metadata created during class loading if failure) >>>>>>>> Then I've checked the builds b57 (test failed) and b58 (test >>>>>>>> passed), so I confirmed that it may be the reason of the leak >>>>>>>> being observed now. >>>>>>>> But now I think that the reason may be different. >>>>>>>> It just turns out that the test shows failures for (at least) >>>>>>>> three different leaks - the one you, Daniel, solved (7121600), >>>>>>>> the one Stefan wrote about (8003419) and the one currently >>>>>>>> observed (8019845). >>>>>>>> >>>>>>>>> That's a good thing, but I think Alan and company would be a bit >>>>>>>>> grumpy with me if I pushed a test that failed as soon as someone >>>>>>>>> ran it. :-) Do you know if the revised RetransformBigClass.sh >>>>>>>>> also >>>>>>>>> finds a new memory leak in JDK8/HSX-25? >>>>>>>>> >>>>>>>>> The way to deal with that is to put the test on the Problem.list >>>>>>>>> as part of the same changeset. However, the T&L folks might >>>>>>>>> not like >>>>>>>>> that either... >>>>>>>> >>>>>>>> Well, the leak is there, and why not have a failing test as a >>>>>>>> reminder to have it fixed? >>>>>>>> >>>>>>>> Sincerely yours, >>>>>>>> Ivan Gerasimov >>>>>>>> >>>>>>>>> >>>>>>>>> Dan >>>>>>>>> >>>>>>>>> >>>>>>>>> On 7/4/13 6:59 PM, Ivan Gerasimov wrote: >>>>>>>>>> Thank you, Daniel! >>>>>>>>>> >>>>>>>>>> Please find an updated webrev at >>>>>>>>>> http://cr.openjdk.java.net/~igerasim/8016838/2/webrev/. >>>>>>>>>> It now includes the RetransformBigClass test modified in the >>>>>>>>>> same way as RedefineBigClass >>>>>>>>>> If the changes look fine, may I ask you to sponsor the >>>>>>>>>> commit, as I'm not a committer? >>>>>>>>>> Here's a link to hg export: >>>>>>>>>> http://cr.openjdk.java.net/~igerasim/2commit/8016838-jdk8-ReBigClass-improved.patch >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> Thanks in advance, >>>>>>>>>> Ivan >>>>>>>>>> >>>>>>>>>> On 04.07.2013 21:45, Daniel D. Daugherty wrote: >>>>>>>>>>> On 7/4/13 11:19 AM, Ivan Gerasimov wrote: >>>>>>>>>>>> Daniel, thank you for review! >>>>>>>>>>>> >>>>>>>>>>>> Here's the updated with all all your suggestions adopted. >>>>>>>>>>>> http://cr.openjdk.java.net/~igerasim/8016838/1/webrev/ >>>>>>>>>>> >>>>>>>>>>> Looks good. >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> I haven't yet considered applying the approach to >>>>>>>>>>>> RetransformBigClass. >>>>>>>>>>>> Do you want me to include this into this same change set or >>>>>>>>>>>> should I make it separately? >>>>>>>>>>> >>>>>>>>>>> I would include it in the same changeset. >>>>>>>>>>> >>>>>>>>>>> Dan >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> Sincerely yours, >>>>>>>>>>>> Ivan >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> On 04.07.2013 19:34, Daniel D. Daugherty wrote: >>>>>>>>>>>>> On 7/3/13 11:12 AM, Ivan Gerasimov wrote: >>>>>>>>>>>>>> Hello everybody! >>>>>>>>>>>>>> >>>>>>>>>>>>>> We have a request to improve jtreg test. >>>>>>>>>>>>>> The test had been written to verify fix for memory leak >>>>>>>>>>>>>> during class redefinition. >>>>>>>>>>>>>> The problem is that it always is reported as PASSED even >>>>>>>>>>>>>> in the presence of the leak. >>>>>>>>>>>>>> >>>>>>>>>>>>>> The proposed change is platform specific. >>>>>>>>>>>>>> It allows memory leak detection only on Linux. >>>>>>>>>>>>>> This is because the memory leak was in native code, so >>>>>>>>>>>>>> there's no easy way to detect it from within Java code. >>>>>>>>>>>>>> >>>>>>>>>>>>>> Here's the webrev for JDK8 repository: >>>>>>>>>>>>>> http://cr.openjdk.java.net/~igerasim/8016838/0/webrev/ >>>>>>>>>>>>> >>>>>>>>>>>>> Very nicely done! The logic in RedefineBigClass.sh only >>>>>>>>>>>>> catches a >>>>>>>>>>>>> leak big enough to cause an Exception to be thrown. >>>>>>>>>>>>> >>>>>>>>>>>>> When I originally wrote this test and its companion: >>>>>>>>>>>>> >>>>>>>>>>>>> test/java/lang/instrument/RetransformBigClass* >>>>>>>>>>>>> >>>>>>>>>>>>> I could not come up with a platform independent way to put >>>>>>>>>>>>> a small >>>>>>>>>>>>> upper limit on memory growth. It never dawned on me that >>>>>>>>>>>>> putting in >>>>>>>>>>>>> something on one platform (Linux) was better than nothing. >>>>>>>>>>>>> >>>>>>>>>>>>> Are you planning to add this same logic to >>>>>>>>>>>>> RetransformBigClass*? >>>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>> test/java/lang/instrument/RedefineBigClass.sh >>>>>>>>>>>>> No comments. >>>>>>>>>>>>> >>>>>>>>>>>>> test/java/lang/instrument/RedefineBigClassApp.java >>>>>>>>>>>>> line 48: final long MEM_LEAK_THRESHOLD = 32 * 1024; // >>>>>>>>>>>>> 32Mb >>>>>>>>>>>>> Would be better at the top of RedefineBigClassApp >>>>>>>>>>>>> rather than >>>>>>>>>>>>> "buried" down here. >>>>>>>>>>>>> >>>>>>>>>>>>> line 51: Long.valueOf(vmMemDelta) >>>>>>>>>>>>> There are several places where a long is passed to >>>>>>>>>>>>> Long.valueOf(). >>>>>>>>>>>>> Is there some reason you're not passing them >>>>>>>>>>>>> directly to println()? >>>>>>>>>>>>> >>>>>>>>>>>>> line 54: } else { >>>>>>>>>>>>> The "else" is redundant due to the >>>>>>>>>>>>> "System.exit(1)" call above it. >>>>>>>>>>>>> You can drop the "else {" and "}" and shift that >>>>>>>>>>>>> last println() to >>>>>>>>>>>>> the left. >>>>>>>>>>>>> >>>>>>>>>>>>> line 71: return Long.parseLong(line.split(" ")[22]) / >>>>>>>>>>>>> 1024; >>>>>>>>>>>>> How about at least a comment referring to the >>>>>>>>>>>>> Linux proc(5) >>>>>>>>>>>>> man page... and the fact that the 23rd field is: >>>>>>>>>>>>> >>>>>>>>>>>>> vsize %lu Virtual memory size in bytes. >>>>>>>>>>>>> >>>>>>>>>>>>> Again, very nicely done! >>>>>>>>>>>>> >>>>>>>>>>>>> Dan >>>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>>> >>>>>>>>>>>>>> The surprising thing is that modified test detected the >>>>>>>>>>>>>> leak with the latest JDK8! >>>>>>>>>>>>>> Latest 6 and 7 are fine, so it might be regression in JDK8. >>>>>>>>>>>>>> >>>>>>>>>>>>>> I've filled a bug >>>>>>>>>>>>>> http://bugs.sun.com/view_bug.do?bug_id=8019845 "Memory >>>>>>>>>>>>>> leak during class redefenition" (not yet available.) >>>>>>>>>>>>>> >>>>>>>>>>>>>> Sincerely yours, >>>>>>>>>>>>>> Ivan Gerasimov >>>>>>>>>>>>>> >>>>>>>>>>>>>> >>>>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>> >>>>> >>>>> >>>>> >>>> >>> >>> >>> >> >> >> > From ivan.gerasimov at oracle.com Tue Jul 23 15:06:12 2013 From: ivan.gerasimov at oracle.com (Ivan Gerasimov) Date: Tue, 23 Jul 2013 19:06:12 +0400 Subject: RFR [8016838] java/lang/instrument/RedefineBigClass.sh needs modification In-Reply-To: <51EE9828.4070200@oracle.com> References: <51D45B8C.7010109@oracle.com> <51D595ED.7050902@oracle.com> <51D5AEB6.3060608@oracle.com> <51D5B4C5.7060402@oracle.com> <51D61A66.5010001@oracle.com> <51D64D15.2090105@oracle.com> <51D6A59A.1060703@oracle.com> <51D6B1ED.9090709@oracle.com> <51DAEF13.8010000@oracle.com> <51DAF69C.3000404@oracle.com> <51DC0B8C.9010804@oracle.com> <51DD2638.9070801@oracle.com> <51DD399E.4030105@oracle.com> <51EE8FAE.90808@oracle.com> <51EE9828.4070200@oracle.com> Message-ID: <51EE9BE4.6020908@oracle.com> On 23.07.2013 18:50, Daniel D. Daugherty wrote: > Yes. Do you have a pointer to the committed patch file? > If so, I'll take care of getting the fix into JDK8-T&L. Thanks a lot! I really appreciate it. Here's the link: http://cr.openjdk.java.net/~igerasim/2commit/8016838-jdk8-ReBigClass-improved.patch I've just updated the file to include the latest changes. Sincerely yours, Ivan > Dan > > >> I've just checked how the tests run against the latest jdk build >> (which is 99), and the leak is still there. >> Thus the proposed change (including ProblemList modifications) is >> still actual. >> >> Here's a link to the latest webrev: >> http://cr.openjdk.java.net/~igerasim/8016838/3/webrev/ >> >> I've also run jprt job to check how it works on all other platforms: >> http://prt-web.us.oracle.com//archive/2013/07/2013-07-22-143846.igerasim.jdk/logs/ >> >> >> On all the platforms (including 32-bit Linux) the tests passed as >> expected, on the Linux-x64 both tests were skipped. >> >> Virtual memory growth across {fastdebug,product}-{c1,c2} targets was >> in range from 1188K to 2584K which is less than the chosen threshold >> of 32M. >> >> Sincerely yours, >> Ivan Gerasimov >> >> >> On 10.07.2013 14:38, Ivan Gerasimov wrote: >>> Yes, I forgot to include the most important thing - a link to webrev! >>> Your link is correct. >>> http://cr.openjdk.java.net/~igerasim/8016838/3/webrev/ >>> >>> The tests fail on linux-x64 only, linux-i586 is fine. >>> Here's the link to the logs of the tests run by Daniel Daugherty: >>> http://prt-web.us.oracle.com//archive/2013/07/2013-07-05-045326.ddaugher.8016838_exp/logs/ >>> >>> >>> Thus the memory leak seems to be specific to 64-bit Linux. >>> >>> Sincerely yours, >>> Ivan >>> >>> On 10.07.2013 13:15, Se?n Coffey wrote: >>>> Ivan, >>>> >>>> I'll assume this is the latest webrev : >>>> http://cr.openjdk.java.net/~igerasim/8016838/3/webrev/ >>>> >>>> >>>> One comment - should the test be excluded for all linux variants >>>> (i.e. linux-all) ? >>>> >>>> regards, >>>> Sean. >>>> >>>> On 09/07/2013 14:09, Ivan Gerasimov wrote: >>>>> Please have a chance to review an updated webrev. >>>>> It now includes a change to ProblemList.txt, so both modified >>>>> tests are ignored for linux-x64. >>>>> >>>>> Sincerely yours, >>>>> Ivan Gersimov >>>>> >>>>> On 08.07.2013 21:27, Se?n Coffey wrote: >>>>>> >>>>>> On 08/07/13 17:55, Ivan Gerasimov wrote: >>>>>>> Thanks, Se?n! >>>>>>> >>>>>>> I located the build in which the memleak was first introduced -- >>>>>>> it is jdk8-b69 (hs25-b13). >>>>>>> I've updated the bug >>>>>>> http://bugs.sun.com/view_bug.do?bug_id=8019845 with this. >>>>>>> >>>>>>> So what is the correct procedure to go forward now? >>>>>>> Should I update the webrev to include changes to the problem list? >>>>>>> I believe I shouldn't -- this list seems to be a sensitive stuff. >>>>>> I'd suggest updating the webrev with the ProblemList >>>>>> modification/addition. It's best not to add a test to testruns if >>>>>> it's knowingly failing. The test can be removed from ProblemList >>>>>> when the jdk8 regression is fixed. >>>>>> >>>>>> regards, >>>>>> Sean. >>>>>> >>>>>>> >>>>>>> Sincerely yours, >>>>>>> Ivan >>>>>>> >>>>>>> >>>>>>> On 05.07.2013 15:45, Se?n Coffey wrote: >>>>>>>> Nice work indeed Ivan. Good to have a reliable testcase to >>>>>>>> catch leaks in this area. >>>>>>>> >>>>>>>> I'd also suggest that this test goes on the ProblemList until >>>>>>>> the new leak is sorted out for jdk8. The goal of JPRT runs is >>>>>>>> to have clean runs. If it's on the problemList, then it's a >>>>>>>> known issue and is normally tagged with the relevant bug ID so >>>>>>>> that the responsible engineer knows the current state. >>>>>>>> >>>>>>>> regards, >>>>>>>> Sean. >>>>>>>> >>>>>>>> On 05/07/2013 11:53, Ivan Gerasimov wrote: >>>>>>>>> >>>>>>>>> On 05.07.2013 8:35, Daniel D. Daugherty wrote: >>>>>>>>>> Ivan, >>>>>>>>>> >>>>>>>>>> The changes look fine, I can sponsor your commit, looks like >>>>>>>>>> your >>>>>>>>>> OpenJDK user name is 'igerasim', but I need to know a little bit >>>>>>>>>> more about your testing of these fixes. Did you do a test JPRT >>>>>>>>>> job to run the JLI tests (or just the two tests themselves)? >>>>>>>>>> >>>>>>>>> I've only run test from java/lang/instrument when checked the >>>>>>>>> change with JDK6u60 (all passed) and with JDK6u51 (the test >>>>>>>>> failed as expected, since the leak had still been there.) >>>>>>>>> >>>>>>>>>> Based on e-mail about this bug fix, I believe you've found a new >>>>>>>>>> leak in JDK8/HSX-25 with test >>>>>>>>>> java/lang/instrument/RedefineBigClass.sh. >>>>>>>>> Right. The test shown a memleak with the the latest jdk8. >>>>>>>>> I filed a bug 8019845 about this leak. >>>>>>>>> Stefan Karlsson guessed that this may be related to 8003419 >>>>>>>>> (NPG: Clean up metadata created during class loading if failure) >>>>>>>>> Then I've checked the builds b57 (test failed) and b58 (test >>>>>>>>> passed), so I confirmed that it may be the reason of the leak >>>>>>>>> being observed now. >>>>>>>>> But now I think that the reason may be different. >>>>>>>>> It just turns out that the test shows failures for (at least) >>>>>>>>> three different leaks - the one you, Daniel, solved (7121600), >>>>>>>>> the one Stefan wrote about (8003419) and the one currently >>>>>>>>> observed (8019845). >>>>>>>>> >>>>>>>>>> That's a good thing, but I think Alan and company would be a bit >>>>>>>>>> grumpy with me if I pushed a test that failed as soon as someone >>>>>>>>>> ran it. :-) Do you know if the revised RetransformBigClass.sh >>>>>>>>>> also >>>>>>>>>> finds a new memory leak in JDK8/HSX-25? >>>>>>>>>> >>>>>>>>>> The way to deal with that is to put the test on the Problem.list >>>>>>>>>> as part of the same changeset. However, the T&L folks might >>>>>>>>>> not like >>>>>>>>>> that either... >>>>>>>>> >>>>>>>>> Well, the leak is there, and why not have a failing test as a >>>>>>>>> reminder to have it fixed? >>>>>>>>> >>>>>>>>> Sincerely yours, >>>>>>>>> Ivan Gerasimov >>>>>>>>> >>>>>>>>>> >>>>>>>>>> Dan >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> On 7/4/13 6:59 PM, Ivan Gerasimov wrote: >>>>>>>>>>> Thank you, Daniel! >>>>>>>>>>> >>>>>>>>>>> Please find an updated webrev at >>>>>>>>>>> http://cr.openjdk.java.net/~igerasim/8016838/2/webrev/. >>>>>>>>>>> It now includes the RetransformBigClass test modified in the >>>>>>>>>>> same way as RedefineBigClass >>>>>>>>>>> If the changes look fine, may I ask you to sponsor the >>>>>>>>>>> commit, as I'm not a committer? >>>>>>>>>>> Here's a link to hg export: >>>>>>>>>>> http://cr.openjdk.java.net/~igerasim/2commit/8016838-jdk8-ReBigClass-improved.patch >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> Thanks in advance, >>>>>>>>>>> Ivan >>>>>>>>>>> >>>>>>>>>>> On 04.07.2013 21:45, Daniel D. Daugherty wrote: >>>>>>>>>>>> On 7/4/13 11:19 AM, Ivan Gerasimov wrote: >>>>>>>>>>>>> Daniel, thank you for review! >>>>>>>>>>>>> >>>>>>>>>>>>> Here's the updated with all all your suggestions adopted. >>>>>>>>>>>>> http://cr.openjdk.java.net/~igerasim/8016838/1/webrev/ >>>>>>>>>>>> >>>>>>>>>>>> Looks good. >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>> I haven't yet considered applying the approach to >>>>>>>>>>>>> RetransformBigClass. >>>>>>>>>>>>> Do you want me to include this into this same change set >>>>>>>>>>>>> or should I make it separately? >>>>>>>>>>>> >>>>>>>>>>>> I would include it in the same changeset. >>>>>>>>>>>> >>>>>>>>>>>> Dan >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>> Sincerely yours, >>>>>>>>>>>>> Ivan >>>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>> On 04.07.2013 19:34, Daniel D. Daugherty wrote: >>>>>>>>>>>>>> On 7/3/13 11:12 AM, Ivan Gerasimov wrote: >>>>>>>>>>>>>>> Hello everybody! >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> We have a request to improve jtreg test. >>>>>>>>>>>>>>> The test had been written to verify fix for memory leak >>>>>>>>>>>>>>> during class redefinition. >>>>>>>>>>>>>>> The problem is that it always is reported as PASSED even >>>>>>>>>>>>>>> in the presence of the leak. >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> The proposed change is platform specific. >>>>>>>>>>>>>>> It allows memory leak detection only on Linux. >>>>>>>>>>>>>>> This is because the memory leak was in native code, so >>>>>>>>>>>>>>> there's no easy way to detect it from within Java code. >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> Here's the webrev for JDK8 repository: >>>>>>>>>>>>>>> http://cr.openjdk.java.net/~igerasim/8016838/0/webrev/ >>>>>>>>>>>>>> >>>>>>>>>>>>>> Very nicely done! The logic in RedefineBigClass.sh only >>>>>>>>>>>>>> catches a >>>>>>>>>>>>>> leak big enough to cause an Exception to be thrown. >>>>>>>>>>>>>> >>>>>>>>>>>>>> When I originally wrote this test and its companion: >>>>>>>>>>>>>> >>>>>>>>>>>>>> test/java/lang/instrument/RetransformBigClass* >>>>>>>>>>>>>> >>>>>>>>>>>>>> I could not come up with a platform independent way to >>>>>>>>>>>>>> put a small >>>>>>>>>>>>>> upper limit on memory growth. It never dawned on me that >>>>>>>>>>>>>> putting in >>>>>>>>>>>>>> something on one platform (Linux) was better than nothing. >>>>>>>>>>>>>> >>>>>>>>>>>>>> Are you planning to add this same logic to >>>>>>>>>>>>>> RetransformBigClass*? >>>>>>>>>>>>>> >>>>>>>>>>>>>> >>>>>>>>>>>>>> >>>>>>>>>>>>>> test/java/lang/instrument/RedefineBigClass.sh >>>>>>>>>>>>>> No comments. >>>>>>>>>>>>>> >>>>>>>>>>>>>> test/java/lang/instrument/RedefineBigClassApp.java >>>>>>>>>>>>>> line 48: final long MEM_LEAK_THRESHOLD = 32 * 1024; >>>>>>>>>>>>>> // 32Mb >>>>>>>>>>>>>> Would be better at the top of RedefineBigClassApp >>>>>>>>>>>>>> rather than >>>>>>>>>>>>>> "buried" down here. >>>>>>>>>>>>>> >>>>>>>>>>>>>> line 51: Long.valueOf(vmMemDelta) >>>>>>>>>>>>>> There are several places where a long is passed >>>>>>>>>>>>>> to Long.valueOf(). >>>>>>>>>>>>>> Is there some reason you're not passing them >>>>>>>>>>>>>> directly to println()? >>>>>>>>>>>>>> >>>>>>>>>>>>>> line 54: } else { >>>>>>>>>>>>>> The "else" is redundant due to the >>>>>>>>>>>>>> "System.exit(1)" call above it. >>>>>>>>>>>>>> You can drop the "else {" and "}" and shift that >>>>>>>>>>>>>> last println() to >>>>>>>>>>>>>> the left. >>>>>>>>>>>>>> >>>>>>>>>>>>>> line 71: return Long.parseLong(line.split(" ")[22]) / >>>>>>>>>>>>>> 1024; >>>>>>>>>>>>>> How about at least a comment referring to the >>>>>>>>>>>>>> Linux proc(5) >>>>>>>>>>>>>> man page... and the fact that the 23rd field is: >>>>>>>>>>>>>> >>>>>>>>>>>>>> vsize %lu Virtual memory size in bytes. >>>>>>>>>>>>>> >>>>>>>>>>>>>> Again, very nicely done! >>>>>>>>>>>>>> >>>>>>>>>>>>>> Dan >>>>>>>>>>>>>> >>>>>>>>>>>>>> >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> The surprising thing is that modified test detected the >>>>>>>>>>>>>>> leak with the latest JDK8! >>>>>>>>>>>>>>> Latest 6 and 7 are fine, so it might be regression in JDK8. >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> I've filled a bug >>>>>>>>>>>>>>> http://bugs.sun.com/view_bug.do?bug_id=8019845 "Memory >>>>>>>>>>>>>>> leak during class redefenition" (not yet available.) >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> Sincerely yours, >>>>>>>>>>>>>>> Ivan Gerasimov >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> >>>>>>>>>>>>>> >>>>>>>>>>>>>> >>>>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>> >>>>>> >>>>>> >>>>>> >>>>> >>>> >>>> >>>> >>> >>> >>> >> > > > From christos at zoulas.com Tue Jul 23 15:31:23 2013 From: christos at zoulas.com (Christos Zoulas) Date: Tue, 23 Jul 2013 11:31:23 -0400 Subject: RFR [8020669] java.nio.file.Files.readAllBytes() does not read any data when Files.size() is 0 In-Reply-To: from Martin Buchholz (Jul 22, 11:58am) Message-ID: <20130723153123.2D11B97129@rebar.astron.com> On Jul 22, 11:58am, martinrb at google.com (Martin Buchholz) wrote: -- Subject: Re: RFR [8020669] java.nio.file.Files.readAllBytes() does not rea | It's the OS/filesystem implementer deciding to return a bogus number. | | More accurate would be to count by reading all the bytes, but that is | impractical and/or impossible (e.g. don't try reading "all the bytes" from | /dev/null) | | A middle ground would be to mistrust specifically file sizes of zero, | testing via | int c = read() | but then what? Check for /proc bug on Linux? The only sure way to read all the data from a file in Unix is to attempt to read(2) until it returns 0 (or -1 on error). If you think you can trust the size stat(2) returns what does it return for /dev/zero? :-) christos From daniel.daugherty at oracle.com Tue Jul 23 15:39:44 2013 From: daniel.daugherty at oracle.com (daniel.daugherty at oracle.com) Date: Tue, 23 Jul 2013 15:39:44 +0000 Subject: hg: jdk8/tl/jdk: 8016838: improvement of RedefineBigClass and RetransformBigClass tests Message-ID: <20130723154031.60C6C482A3@hg.openjdk.java.net> Changeset: 6f3b940fe9f8 Author: igerasim Date: 2013-07-23 18:57 +0400 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/6f3b940fe9f8 8016838: improvement of RedefineBigClass and RetransformBigClass tests Reviewed-by: dcubed ! test/ProblemList.txt ! test/java/lang/instrument/RedefineBigClass.sh ! test/java/lang/instrument/RedefineBigClassApp.java ! test/java/lang/instrument/RetransformBigClass.sh ! test/java/lang/instrument/RetransformBigClassApp.java From david.lloyd at redhat.com Tue Jul 23 15:43:33 2013 From: david.lloyd at redhat.com (David M. Lloyd) Date: Tue, 23 Jul 2013 10:43:33 -0500 Subject: RFR [8020669] java.nio.file.Files.readAllBytes() does not read any data when Files.size() is 0 In-Reply-To: <20130723153123.2D11B97129@rebar.astron.com> References: <20130723153123.2D11B97129@rebar.astron.com> Message-ID: <51EEA4A5.7080101@redhat.com> On 07/23/2013 10:31 AM, Christos Zoulas wrote: > On Jul 22, 11:58am, martinrb at google.com (Martin Buchholz) wrote: > -- Subject: Re: RFR [8020669] java.nio.file.Files.readAllBytes() does not rea > > | It's the OS/filesystem implementer deciding to return a bogus number. > | > | More accurate would be to count by reading all the bytes, but that is > | impractical and/or impossible (e.g. don't try reading "all the bytes" from > | /dev/null) > | > | A middle ground would be to mistrust specifically file sizes of zero, > | testing via > | int c = read() > | but then what? Check for /proc bug on Linux? > > The only sure way to read all the data from a file in Unix is to attempt > to read(2) until it returns 0 (or -1 on error). If you think you can trust > the size stat(2) returns what does it return for /dev/zero? :-) Indeed, that's a good point. It would probably be a good idea to provide a variant that specifies a hard maximum number of bytes (something less than 2GB anyway - the only thing worse than failing to allocate such a large array is *succeeding* in allocating such a large array when you don't want it). -- - DML From mandy.chung at oracle.com Tue Jul 23 16:07:17 2013 From: mandy.chung at oracle.com (Mandy Chung) Date: Wed, 24 Jul 2013 00:07:17 +0800 Subject: RFR: 8019948: java/util/logging/bundlesearch/ResourceBundleSearchTest.java is failing intermitently In-Reply-To: <51EE8060.2060105@oracle.com> References: <51EE8060.2060105@oracle.com> Message-ID: <51EEAA35.4090009@oracle.com> On 7/23/2013 9:08 PM, Daniel Fuchs wrote: > Hi, > > Please find below a changeset for fixing > 8019948: java/util/logging/bundlesearch/ResourceBundleSearchTest.java > is failing intermittently [1] > > This appears to be a test bug due to a bizarre use of synchronization > in the test. The test was failing regularly before the fix (= often > enough), but I haven't managed to reproduce since I changed > lr.wait() into lr.join(); > > http://cr.openjdk.java.net/~dfuchs/webrev_8019948/webrev.00/ Looks okay. All traces have this call: newDate(System.currentTimeMillis()) Maybe simply move System.currentTimeMillis() to the newDate method instead of calling it in the parameter. Mandy From daniel.fuchs at oracle.com Tue Jul 23 16:32:56 2013 From: daniel.fuchs at oracle.com (Daniel Fuchs) Date: Tue, 23 Jul 2013 18:32:56 +0200 Subject: RFR: 8019948: java/util/logging/bundlesearch/ResourceBundleSearchTest.java is failing intermitently In-Reply-To: <51EEAA35.4090009@oracle.com> References: <51EE8060.2060105@oracle.com> <51EEAA35.4090009@oracle.com> Message-ID: <51EEB038.3090503@oracle.com> On 7/23/13 6:07 PM, Mandy Chung wrote: > On 7/23/2013 9:08 PM, Daniel Fuchs wrote: >> Hi, >> >> Please find below a changeset for fixing >> 8019948: java/util/logging/bundlesearch/ResourceBundleSearchTest.java >> is failing intermittently [1] >> >> This appears to be a test bug due to a bizarre use of synchronization >> in the test. The test was failing regularly before the fix (= often >> enough), but I haven't managed to reproduce since I changed >> lr.wait() into lr.join(); >> >> http://cr.openjdk.java.net/~dfuchs/webrev_8019948/webrev.00/ > > Looks okay. All traces have this call: > > newDate(System.currentTimeMillis()) > > Maybe simply move System.currentTimeMillis() to the newDate method > instead of calling it in the parameter. Right. Will do - and maybe rename newDate() into getTimeStamp() while I'm at it. I should have cleaned it up before sending the review... Thanks Mandy! -- daniel > > Mandy From christos at zoulas.com Tue Jul 23 17:21:08 2013 From: christos at zoulas.com (Christos Zoulas) Date: Tue, 23 Jul 2013 13:21:08 -0400 Subject: RFR [8020669] java.nio.file.Files.readAllBytes() does not read any data when Files.size() is 0 In-Reply-To: <51EEA4A5.7080101@redhat.com> from "David M. Lloyd" (Jul 23, 10:43am) Message-ID: <20130723172108.E9C5A97129@rebar.astron.com> On Jul 23, 10:43am, david.lloyd at redhat.com ("David M. Lloyd") wrote: -- Subject: Re: RFR [8020669] java.nio.file.Files.readAllBytes() does not rea | > The only sure way to read all the data from a file in Unix is to attempt | > to read(2) until it returns 0 (or -1 on error). If you think you can trust | > the size stat(2) returns what does it return for /dev/zero? :-) | | Indeed, that's a good point. It would probably be a good idea to | provide a variant that specifies a hard maximum number of bytes | (something less than 2GB anyway - the only thing worse than failing to | allocate such a large array is *succeeding* in allocating such a large | array when you don't want it). I guess one can always use a multiple of: blksize_t st_blksize preferred I/O block size (fs-specific) And if 0/unavailable, a multiple of page size. Letting the array grow too big will end up hurting performance anyway. christos From jeremymanson at google.com Tue Jul 23 18:37:32 2013 From: jeremymanson at google.com (Jeremy Manson) Date: Tue, 23 Jul 2013 11:37:32 -0700 Subject: RFR - Changes to address CCC 8014135: Support for statically linked agents In-Reply-To: <0F64EB55-B38C-416E-93D1-92BA8F5D43C7@oracle.com> References: <51D494E9.2020200@oracle.com> <51DDB632.4050805@oracle.com> <0F64EB55-B38C-416E-93D1-92BA8F5D43C7@oracle.com> Message-ID: Okay, Bob, thanks for the explanation. I may not agree with it, but I can certainly see where you're coming from. Jeremy On Tue, Jul 16, 2013 at 2:44 PM, Bob Vandette wrote: > Thanks for the suggestion Jeremy but the JVMTI agent change is being > implemented as part of the > original JNI static library implementation where we explicitly prohibited > dynamic libraries to be loaded > if a static library of the same name is baked into the launcher. > > "If a library L is statically linked then it will be prohibited to link a > library of the same name dynamically." > > The primary motivation for requiring this for the -agentpath as well as > the java.lang.System.load API is to > minimize changes to java source code. You can statically or dynamically > link a library without changing > any of the code that attempts to use the library. The only thing that > changes is the OnLoad name in the library > and the link options. > > If you'd like to optionally use different implementations, you can end up > with the same behavior by using a > System property which alters the String of the name of the library. > > Bob. > > > On Jul 10, 2013, at 3:29 PM, BILL PITTORE wrote: > > On 7/3/2013 6:32 PM, Jeremy Manson wrote: > > I know that this is mentioned in the JEP, but does it really make sense to > have -agentpath work here, rather than just -agentlib? I would think that > specifying a full pathname and getting the library loaded out of the > launcher would be a little surprising to people who are basically saying > "please load this agent from the given path". > > > Also, in practice, we do something very similar at Google, and, when > testing, I find it occasionally useful to be able to say "please load this > agent on the command line via the agentpath I gave you, rather than loading > the one with the same name I baked into the launcher". > > > (FWIW, when we did this internally at Google, we added a special -XX flag > for when the agent is in the launcher. I know that you don't want to go > that way, though.) > > > Thanks for the comments. I would say the thinking here is that we want > this to be as transparent as possible to the end user. In our view of the > end user is someone perhaps using an IDE and the actual execution of the VM > with agent arguments is hidden. In your case it sounds like you are > actually developing agents which is a whole different ball game. I could > certainly see adding a -XX argument that forces agentpath to load the > external library which would be good for agent development and debugging. > No need to relink the entire VM with the new agent. Our tech lead is out on > vacation this week so I'll bring this up when he's back. > > bill > > > On Wed, Jul 3, 2013 at 2:17 PM, BILL PITTORE mailto:bill.pittore at oracle.com >> wrote: > > > These changes address bug 8014135 which adds support for > > statically linked agents in the VM. This is a followup to the > > recent JNI spec changes that addressed statically linked JNI > > libraries( 8005716). > > The JEP for this change is the same JEP as the JNI changes: > > http://openjdk.java.net/jeps/178 > > > Webrevs are here: > > > http://cr.openjdk.java.net/~bpittore/8014135/jdk/webrev.00/ > > > > http://cr.openjdk.java.net/~bpittore/8014135/hotspot/webrev.00/ > > > > > The changes to jvmti.xml can also be seen in the output file that > > I placed here: > > > http://cr.openjdk.java.net/~bpittore/8014135/hotspot/webrev.00/jvmti.html > > < > http://cr.openjdk.java.net/%7Ebpittore/8014135/hotspot/webrev.00/jvmti.html > > > > > Thanks, > > bill > > > > > > > From brian.burkhalter at oracle.com Tue Jul 23 19:09:17 2013 From: brian.burkhalter at oracle.com (Brian Burkhalter) Date: Tue, 23 Jul 2013 12:09:17 -0700 Subject: Java 8 RFR 6476168: (fmt) Inconsistency formatting subnormal doubles with hexadecimal conversion In-Reply-To: <51EDD89D.9070309@oracle.com> References: <23721DCA-F2A2-4B97-9CC0-56151ACD7E95@oracle.com> <51E77DA2.1050304@oracle.com> <8D0EE76E-9C2E-4D5F-B687-E7D154AE4A30@oracle.com> <51E9DBED.2040204@oracle.com> <51EDD89D.9070309@oracle.com> Message-ID: Hi Joe, The webrev http://cr.openjdk.java.net/~bpb/6476168/ is updated per the following. On Jul 22, 2013, at 6:13 PM, Joseph Darcy wrote: > The changes in that block include > > 1353 // 6476168: subnormal formatting and precision > > It is not customary, and usually not desirable, to include the bug id. Additionally, the new block of test cases tests for subnormal as well as underflow the comment is not accurate. Comment expunged. > It is not necessary to write > > Double.parseDouble("0x0.123p-1022") > > you can just write > > 0x0.123p-1022 > > using the hexadecimal notation for a floating-point literal. Changed in the cases I added and in the preexisting cases. > I'd like to see a few more test cases that probe at boundaries, such as Double.MAX_VALUE rounding to 9, 6, 2, 1, digits of precision. Please see lines 1372-1379 of Basic-X. > There are also cases of interest to make sure the round to nearest even rounding policy is being used. If a value like 0.123xxxxxxxxxxxx is rounded to three digits, the value of xxxxxxxxxxxx will determine whether or not an increment occurs. Please see lines 1355-1368 of Basic-X. >> Added as Basic-X line 1360. >> >>> * Double.MAX_VALUE rounded to fewer than 12 digits. Offhand, I'm not sure what the implementation will do here; returning infinity or a hex string with an extra big exponent are both defensible. >> Added as Basic-X line 1361. The returned value for %1.9a is 0x1.000000000p1024. > > Of the two options, that value is preferable. Interestingly the C stdio library printf("%1.9a\n", 1.7976931348623157e+308) prints 0x2.000000000p+1023 on Mac OS 10.7.5. Thanks, Brian From sundararajan.athijegannathan at oracle.com Tue Jul 23 18:15:19 2013 From: sundararajan.athijegannathan at oracle.com (sundararajan.athijegannathan at oracle.com) Date: Tue, 23 Jul 2013 18:15:19 +0000 Subject: hg: jdk8/tl/nashorn: 10 new changesets Message-ID: <20130723181528.83B96482AE@hg.openjdk.java.net> Changeset: e1d19f9fd5a9 Author: jlaskey Date: 2013-07-16 17:40 -0300 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/e1d19f9fd5a9 8017585: Exclude two failing tests from Nashorn CC run Reviewed-by: jlaskey, sundar, attila Contributed-by: konstantin.shefov at oracle.com + exclude/exclude_list.txt + exclude/exclude_list_cc.txt ! make/build.xml Changeset: 71cfe4e66bcb Author: jlaskey Date: 2013-07-17 11:53 -0300 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/71cfe4e66bcb 8020596: Initialization of white space strings in scanner should be done with \u strings Reviewed-by: attila, hannesw Contributed-by: james.laskey at oracle.com ! src/jdk/nashorn/internal/parser/Lexer.java Changeset: 3d6f6b8d8bc8 Author: hannesw Date: 2013-07-17 18:20 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/3d6f6b8d8bc8 8020356: ClassCastException Undefined->Scope on spiltter class generated for a large switch statement Reviewed-by: jlaskey, attila ! src/jdk/nashorn/internal/codegen/CodeGenerator.java ! src/jdk/nashorn/internal/codegen/Label.java ! src/jdk/nashorn/internal/codegen/Splitter.java ! src/jdk/nashorn/internal/codegen/WeighNodes.java ! src/jdk/nashorn/internal/ir/Block.java ! src/jdk/nashorn/internal/ir/FunctionNode.java ! src/jdk/nashorn/internal/ir/LexicalContext.java + test/script/basic/JDK-8020356.js + test/script/basic/JDK-8020356.js.EXPECTED Changeset: e3307f1a30e5 Author: sundar Date: 2013-07-18 18:08 +0530 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/e3307f1a30e5 8020731: Revisit checkPermission calls in Context class Reviewed-by: attila, hannesw ! src/jdk/nashorn/api/scripting/NashornScriptEngine.java ! src/jdk/nashorn/api/scripting/ScriptObjectMirror.java ! src/jdk/nashorn/internal/objects/Global.java ! src/jdk/nashorn/internal/runtime/Context.java ! src/jdk/nashorn/internal/runtime/NativeJavaPackage.java ! src/jdk/nashorn/internal/runtime/ScriptRuntime.java ! src/jdk/nashorn/internal/runtime/WithObject.java ! src/jdk/nashorn/internal/runtime/linker/JavaAdapterBytecodeGenerator.java ! src/jdk/nashorn/internal/runtime/linker/JavaAdapterClassLoader.java - src/jdk/nashorn/internal/runtime/linker/JavaAdapterGeneratorBase.java Changeset: 624f8be5c3fe Author: attila Date: 2013-07-18 16:22 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/624f8be5c3fe 8020809: Java adapter should not allow overriding of caller sensitive methods Reviewed-by: jlaskey, sundar ! src/jdk/nashorn/internal/runtime/linker/JavaAdapterBytecodeGenerator.java + test/script/trusted/JDK-8020809.js + test/script/trusted/JDK-8020809.js.EXPECTED Changeset: 4b06441b7624 Author: attila Date: 2013-07-18 16:47 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/4b06441b7624 8020820: Limit access to static members of reflective classes Reviewed-by: jlaskey, sundar ! make/build.xml ! src/jdk/nashorn/internal/runtime/linker/NashornStaticClassLinker.java ! test/script/basic/JDK-8010946-2.js ! test/script/basic/JDK-8010946-2.js.EXPECTED ! test/script/basic/NASHORN-473.js + test/script/basic/classloader.js + test/script/basic/classloader.js.EXPECTED ! test/script/basic/javaarray.js ! test/script/sandbox/classloader.js.EXPECTED ! test/script/sandbox/reflection.js ! test/src/jdk/nashorn/api/javaaccess/BooleanAccessTest.java ! test/src/jdk/nashorn/api/javaaccess/NumberAccessTest.java ! test/src/jdk/nashorn/api/javaaccess/ObjectAccessTest.java ! test/src/jdk/nashorn/api/javaaccess/StringAccessTest.java Changeset: 0cfa27ed82fe Author: sundar Date: 2013-07-23 18:17 +0530 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/0cfa27ed82fe 8021122: Not all callables are handled for toString and other function valued properties Reviewed-by: attila, hannesw, jlaskey ! src/jdk/nashorn/internal/ir/debug/ASTWriter.java ! src/jdk/nashorn/internal/objects/Global.java ! src/jdk/nashorn/internal/objects/NativeArray.java ! src/jdk/nashorn/internal/objects/NativeDate.java ! src/jdk/nashorn/internal/objects/NativeJSON.java ! src/jdk/nashorn/internal/objects/NativeObject.java ! src/jdk/nashorn/internal/runtime/Context.java ! src/jdk/nashorn/internal/runtime/ListAdapter.java ! src/jdk/nashorn/internal/runtime/ScriptRuntime.java ! src/jdk/nashorn/internal/runtime/arrays/IteratorAction.java ! src/jdk/nashorn/internal/runtime/linker/Bootstrap.java ! src/jdk/nashorn/internal/runtime/linker/JavaAdapterBytecodeGenerator.java ! src/jdk/nashorn/internal/runtime/linker/NashornBottomLinker.java + test/script/basic/JDK-8021122.js + test/script/basic/JDK-8021122.js.EXPECTED Changeset: e86b297d26aa Author: jlaskey Date: 2013-07-23 12:00 -0300 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/e86b297d26aa 8021130: Comments need to be tokens Reviewed-by: lagergren, attila Contributed-by: james.laskey at oracle.com ! src/jdk/nashorn/internal/parser/AbstractParser.java ! src/jdk/nashorn/internal/parser/Lexer.java ! src/jdk/nashorn/internal/parser/TokenType.java Changeset: ccbea9172aa5 Author: sundar Date: 2013-07-23 21:45 +0530 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/ccbea9172aa5 8021164: REGRESSION: test262 failures after JDK-8021122 Reviewed-by: jlaskey, hannesw ! src/jdk/nashorn/internal/runtime/linker/Bootstrap.java Changeset: 4cb1780bc385 Author: sundar Date: 2013-07-23 21:51 +0530 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/4cb1780bc385 Merge - src/jdk/nashorn/internal/runtime/linker/JavaAdapterGeneratorBase.java From philip.hodges at bluewin.ch Tue Jul 23 19:43:47 2013 From: philip.hodges at bluewin.ch (ph) Date: Tue, 23 Jul 2013 12:43:47 -0700 (PDT) Subject: StringJoiner: detect or fix delimiter collision? In-Reply-To: <51673A45.8060908@oracle.com> References: <51673A45.8060908@oracle.com> Message-ID: <1374608627412-145039.post@n7.nabble.com> didn't see delimiter collision mentioned anywhere - are you really offering an interface that only joins a list of entries without escaping or quoting or even checking for separators (or escape or quote sequences) that might occur in the entries? -- View this message in context: http://openjdk.5641.n7.nabble.com/RFR-String-join-StringJoiner-additions-tp127375p145039.html Sent from the OpenJDK Core Libraries mailing list archive at Nabble.com. From mike.duigou at oracle.com Tue Jul 23 20:09:12 2013 From: mike.duigou at oracle.com (Mike Duigou) Date: Tue, 23 Jul 2013 13:09:12 -0700 Subject: StringJoiner: detect or fix delimiter collision? In-Reply-To: <1374608627412-145039.post@n7.nabble.com> References: <51673A45.8060908@oracle.com> <1374608627412-145039.post@n7.nabble.com> Message-ID: On Jul 23 2013, at 12:43 , ph wrote: > didn't see delimiter collision mentioned anywhere - are you really offering > an interface that only joins a list of entries without escaping or quoting > or even checking for separators (or escape or quote sequences) that might > occur in the entries? Correct. StringJoiner makes no effort to address escaping/quoting. Doing so would add a lot of complexity that would not useful interesting to most users and probably still wouldn't satisfy everyone. If you wish some form of escaping or quoting you can pre-processed entries however you like before joining them. Mike From philip.hodges at bluewin.ch Tue Jul 23 20:37:54 2013 From: philip.hodges at bluewin.ch (ph) Date: Tue, 23 Jul 2013 13:37:54 -0700 (PDT) Subject: StringJoiner: detect or fix delimiter collision? In-Reply-To: References: <51673A45.8060908@oracle.com> <1374608627412-145039.post@n7.nabble.com> Message-ID: <1374611874568-145045.post@n7.nabble.com> The omission of that very complexity is a copious source of bugs that breaks applications in production, and is extremely useful and interesting to the black hat community. It should not be possible to call a joiner without escaping or quoting or catching an exception or explicitly waiving the complexity. Of course there will still be some users who roll their own, blissfully unaware of the existence of StringJoiner. But for those who do discover it, the important value to add is not convenience, but safety. Maybe you could even retrofit it to Arrays.toString(), which is exactly such a toy interface only good for things like logging where delimiter collision doesn't usually matter. At the very least can you please cover it in the examples so that people can't completely overlook it? -- View this message in context: http://openjdk.5641.n7.nabble.com/RFR-String-join-StringJoiner-additions-tp127375p145045.html Sent from the OpenJDK Core Libraries mailing list archive at Nabble.com. From stevenschlansker at gmail.com Tue Jul 23 20:56:34 2013 From: stevenschlansker at gmail.com (Steven Schlansker) Date: Tue, 23 Jul 2013 13:56:34 -0700 Subject: StringJoiner: detect or fix delimiter collision? In-Reply-To: <1374611874568-145045.post@n7.nabble.com> References: <51673A45.8060908@oracle.com> <1374608627412-145039.post@n7.nabble.com> <1374611874568-145045.post@n7.nabble.com> Message-ID: <3C8910F7-981A-4DE9-B4FC-95EC59FAC3FF@gmail.com> On Jul 23, 2013, at 1:37 PM, ph wrote: > The omission of that very complexity is a copious source of bugs that breaks > applications in production, and is extremely useful and interesting to the > black hat community. > It should not be possible to call a joiner without escaping or quoting or > catching an exception or explicitly waiving the complexity. Of course there > will still be some users who roll their own, blissfully unaware of the > existence of StringJoiner. But for those who do discover it, the important > value to add is not convenience, but safety. > Maybe you could even retrofit it to Arrays.toString(), which is exactly such > a toy interface only good for things like logging where delimiter collision > doesn't usually matter. > At the very least can you please cover it in the examples so that people > can't completely overlook it? Hi, If you are expecting to read the data back in a structured manner, I would expect you to use a proper structured format e.g. CSV or JSON, not a simple string joiner. String joining seems to work the same in every language I see (Python, Ruby, Javascript at least) and given that it takes arbitrary (potentially multi-character) delimiters I'm not even sure what behavior you'd expect that could make sense with any given delimiter. The current behavior is similar to other languages, simple to understand, and seems to not be "surprising" to most people. Why would you not write your data out as e.g. JSON? Then all of the tricky cases are handled correctly for you. Best, Steven From mike.duigou at oracle.com Tue Jul 23 20:32:27 2013 From: mike.duigou at oracle.com (mike.duigou at oracle.com) Date: Tue, 23 Jul 2013 20:32:27 +0000 Subject: hg: jdk8/tl/jdk: 2 new changesets Message-ID: <20130723203305.B1E3C482BE@hg.openjdk.java.net> Changeset: 8156630c1ed3 Author: mduigou Date: 2013-07-23 13:20 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/8156630c1ed3 8019840: Spec updates for java.util.function Reviewed-by: mduigou, chegar Contributed-by: brian.goetz at oracle.com ! src/share/classes/java/util/function/BiConsumer.java ! src/share/classes/java/util/function/BiFunction.java ! src/share/classes/java/util/function/BiPredicate.java ! src/share/classes/java/util/function/BinaryOperator.java ! src/share/classes/java/util/function/BooleanSupplier.java ! src/share/classes/java/util/function/Consumer.java ! src/share/classes/java/util/function/DoubleBinaryOperator.java ! src/share/classes/java/util/function/DoubleConsumer.java ! src/share/classes/java/util/function/DoubleFunction.java ! src/share/classes/java/util/function/DoublePredicate.java ! src/share/classes/java/util/function/DoubleSupplier.java ! src/share/classes/java/util/function/DoubleToIntFunction.java ! src/share/classes/java/util/function/DoubleToLongFunction.java ! src/share/classes/java/util/function/DoubleUnaryOperator.java ! src/share/classes/java/util/function/Function.java ! src/share/classes/java/util/function/IntBinaryOperator.java ! src/share/classes/java/util/function/IntConsumer.java ! src/share/classes/java/util/function/IntFunction.java ! src/share/classes/java/util/function/IntPredicate.java ! src/share/classes/java/util/function/IntSupplier.java ! src/share/classes/java/util/function/IntToDoubleFunction.java ! src/share/classes/java/util/function/IntToLongFunction.java ! src/share/classes/java/util/function/IntUnaryOperator.java ! src/share/classes/java/util/function/LongBinaryOperator.java ! src/share/classes/java/util/function/LongConsumer.java ! src/share/classes/java/util/function/LongFunction.java ! src/share/classes/java/util/function/LongPredicate.java ! src/share/classes/java/util/function/LongSupplier.java ! src/share/classes/java/util/function/LongToDoubleFunction.java ! src/share/classes/java/util/function/LongToIntFunction.java ! src/share/classes/java/util/function/LongUnaryOperator.java ! src/share/classes/java/util/function/ObjDoubleConsumer.java ! src/share/classes/java/util/function/ObjIntConsumer.java ! src/share/classes/java/util/function/ObjLongConsumer.java ! src/share/classes/java/util/function/Predicate.java ! src/share/classes/java/util/function/Supplier.java ! src/share/classes/java/util/function/ToDoubleBiFunction.java ! src/share/classes/java/util/function/ToDoubleFunction.java ! src/share/classes/java/util/function/ToIntBiFunction.java ! src/share/classes/java/util/function/ToIntFunction.java ! src/share/classes/java/util/function/ToLongBiFunction.java ! src/share/classes/java/util/function/ToLongFunction.java ! src/share/classes/java/util/function/UnaryOperator.java ! src/share/classes/java/util/function/package-info.java Changeset: 012996e9259f Author: mduigou Date: 2013-07-23 13:21 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/012996e9259f Merge From daniel.smith at oracle.com Tue Jul 23 21:12:56 2013 From: daniel.smith at oracle.com (Dan Smith) Date: Tue, 23 Jul 2013 15:12:56 -0600 Subject: Code Review Request: More tests for 7184826: (reflect) Add support for Project Lambda concepts in core reflection In-Reply-To: <51ED2FC9.5040200@oracle.com> References: <519E2C52.20203@oracle.com> <51B91AA5.6090807@oracle.com> <20130710141722.GA23047@jfranck-desktop.jrpg.bea.com> <51ED2FC9.5040200@oracle.com> Message-ID: <0805A1F1-E808-428B-ABFE-EC5764A81044@oracle.com> Hi. Per a request from Joel, I've taken a look at DefaultStaticTestData. I don't really have the full context here, but I'm assuming that the annotations get translated into tests that guarantee 1) the result of Class.getMethods is exactly (no more -- excepting Object methods -- and no less) those methods named by MethodDesc annotations; and 2) the result of Class.getDeclaredMethods is exactly (no more, no less) those methods that are marked "declared=YES". The expected results seem accurate. I would personally focus testing more on different inheritance shapes and less on different combinations of (unrelated) method declarations or presence/absence type variables (!?), but it's a valid test in any case. There ought to be some testing for scenarios that javac won't generate, like conflicting default method declarations. It's not clear to me why we're generating classes with lambda methods (TestIF16) and then not testing that reflection sees those methods. Presumably they get filtered out by the testing logic. But, if so... what's the point of testing? Really, I don't think lambdas belong here at all -- it's a completely orthogonal feature. (Note: I'm not a Reviewer either, but don't mind providing feedback, especially on spec-related questions.) ?Dan On Jul 22, 2013, at 7:12 AM, Amy Lu wrote: > Thank you Joel for all the valuable feedback. > > Test have been refactored and here comes the updated version: > https://dl.dropboxusercontent.com/u/5812451/yl153753/7184826/webrev.01/index.html > > Thanks, > Amy > > > On 7/10/13 10:17 PM, Joel Borggren-Franck wrote: >> Hi Amy, Tristan, >> >> I'm not a Reviewer kind of reviewer, but I've started to look at the >> code and can sponsor this. >> >> Some comments on test/java/lang/reflect/Method/invoke/DefaultStaticTest.java: >> >> As there are a lot of non-public top-level classes perhaps this test >> should be in it own directory. >> >> It is very hard to read the data table: >> >> 292 {interface1.class, 1, 1, new Object1(), new Object[]{}, >> 293 new Object[]{}, "interface1", null}, >> >> I believe you should move the methodsNum constant and the declMethods >> num constant to an annotation on the interface/class in question. For >> example: >> >> @MyTestData(numMethods=1, declMethods=1) >> 41 interface interface1 { >> 42 @DefaultMethod(isDefault = true) >> 43 @StaticMethod(isStatic = false) >> 44 @ReturnValue(value = "interface1.defaultMethod") >> 45 default String defaultMethod(){ return "interface1.defaultMethod"; }; >> 46 } >> >> That way it is much easier to inspect that the constants are right. >> >> The same can probably be done with the return values encoded. >> >> Instead of all these "new Objects[] {}" can't you create a field, >> >> Object [] EMPTY_PARAMETERS = new Object() {} >> >> and reuse it? >> >> That way it will be much easier to verify that the encoded test data is >> correct. >> >> I'll comment on the other tests shortly. >> >> cheers >> /Joel >> >> On 2013-06-13, Amy Lu wrote: >>> This has been pending on review for long ... Please help to review. >>> I also need a sponsor for this. >>> >>> Thank you very much. >>> >>> /Amy >>> >>> On 5/23/13 10:48 PM, Amy Lu wrote: >>>> Please help to review: >>>> >>>> More tests for 7184826: (reflect) Add support for Project Lambda >>>> concepts in core reflection >>>> >>>> This includes: >>>> 1. improvement for existing tests with more situations >>>> 2. Test for invoking interface default/static method by j.l.r.Method >>>> 3. Test for invoking interface default/static method by MethodHandle >>>> >>>> https://dl.dropboxusercontent.com/u/5812451/yl153753/7184826/webrev.00/index.html >>>> >>>> >>>> Thanks, >>>> Amy >>> > From philip.hodges at bluewin.ch Tue Jul 23 21:57:57 2013 From: philip.hodges at bluewin.ch (ph) Date: Tue, 23 Jul 2013 14:57:57 -0700 (PDT) Subject: StringJoiner: detect or fix delimiter collision? In-Reply-To: <3C8910F7-981A-4DE9-B4FC-95EC59FAC3FF@gmail.com> References: <51673A45.8060908@oracle.com> <1374608627412-145039.post@n7.nabble.com> <1374611874568-145045.post@n7.nabble.com> <3C8910F7-981A-4DE9-B4FC-95EC59FAC3FF@gmail.com> Message-ID: <1374616677631-145058.post@n7.nabble.com> Nothing against a "simple" joiner that forces users to catch or rule out a DelimiterCollisionException, and realise that simple is not good enough. Everything against a stupid joiner that silently assists users in creating bugs. "Seems to work" means not tested thoroughly. People will be tempted into using this joiner to write csv files, and of course it will break as soon as a comma or semicolon delimiter turns up in a text field. They will use it to put br line break elements into HTML files, without checking for HTML syntax characters in each line. They will use it to separate SQL column values with commas, instead of binding them, or calling mysql_real_escape_string, which is a pain to use because it needs a database connection at runtime to find out exactly which characters need escaping depending on which SQL mode is configured. By all means use a "proper structured format", so long as the delimiting is properly specified and the parser and generator are fully tested. That might well be the case for JSON and XML, but it typically is not for CSV and HTML or properties files. Just because other languages may happen to have something similar does not automatically make it easy to use safely. The current behaviour encourages SQL injection. How hard is that to understand? There are some very good features coming in this release, but this joiner is not one of them; it is actually dangerous. -- View this message in context: http://openjdk.5641.n7.nabble.com/RFR-String-join-StringJoiner-additions-tp127375p145058.html Sent from the OpenJDK Core Libraries mailing list archive at Nabble.com. From Alan.Bateman at oracle.com Tue Jul 23 22:01:17 2013 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Tue, 23 Jul 2013 15:01:17 -0700 Subject: RFR : 8017566 : Backout 8000450 - Cannot access to com.sun.corba.se.impl.orb.ORBImpl In-Reply-To: <51E3AF62.8030209@oracle.com> References: <51E0013A.4070301@oracle.com> <51E07700.1080103@oracle.com> <51E3AF62.8030209@oracle.com> Message-ID: <51EEFD2D.2000800@oracle.com> On 15/07/2013 01:14, Se?n Coffey wrote: > Mandy, > >> >> Looks fine to me. I agree that we should back it out for 7u40. I >> would think we want to leave the change in jdk8 and continue the >> investigation and resolving the JCK failures for jdk8. Is that what >> you are thinking? If so, we don't need to back it out from jdk8. > I was hoping to back out the fix for both jdk7u40 and jdk8. The setup > to reproduce is quite simple (modify package list in java.security) > and I think it's not necessary to have JCK failures in jdk8 for the > short to medium term as a result. Have you created a new bug to track doing a more complete fix? It looks like ORB.init should be straight-forward to fix to work even if the package for the default implementation is on the restricted list. -Alan From joe.darcy at oracle.com Tue Jul 23 22:27:20 2013 From: joe.darcy at oracle.com (Joe Darcy) Date: Tue, 23 Jul 2013 15:27:20 -0700 Subject: Java 8 RFR 6476168: (fmt) Inconsistency formatting subnormal doubles with hexadecimal conversion In-Reply-To: References: <23721DCA-F2A2-4B97-9CC0-56151ACD7E95@oracle.com> <51E77DA2.1050304@oracle.com> <8D0EE76E-9C2E-4D5F-B687-E7D154AE4A30@oracle.com> <51E9DBED.2040204@oracle.com> <51EDD89D.9070309@oracle.com> Message-ID: <51EF0348.5020704@oracle.com> Hi Brian, This version looks fine; thanks, -Joe On 7/23/2013 12:09 PM, Brian Burkhalter wrote: > Hi Joe, > > The webrev http://cr.openjdk.java.net/~bpb/6476168/ is updated per the following. > > On Jul 22, 2013, at 6:13 PM, Joseph Darcy wrote: > >> The changes in that block include >> >> 1353 // 6476168: subnormal formatting and precision >> >> It is not customary, and usually not desirable, to include the bug id. Additionally, the new block of test cases tests for subnormal as well as underflow the comment is not accurate. > Comment expunged. > >> It is not necessary to write >> >> Double.parseDouble("0x0.123p-1022") >> >> you can just write >> >> 0x0.123p-1022 >> >> using the hexadecimal notation for a floating-point literal. > Changed in the cases I added and in the preexisting cases. > >> I'd like to see a few more test cases that probe at boundaries, such as Double.MAX_VALUE rounding to 9, 6, 2, 1, digits of precision. > Please see lines 1372-1379 of Basic-X. > >> There are also cases of interest to make sure the round to nearest even rounding policy is being used. If a value like 0.123xxxxxxxxxxxx is rounded to three digits, the value of xxxxxxxxxxxx will determine whether or not an increment occurs. > Please see lines 1355-1368 of Basic-X. > >>> Added as Basic-X line 1360. >>> >>>> * Double.MAX_VALUE rounded to fewer than 12 digits. Offhand, I'm not sure what the implementation will do here; returning infinity or a hex string with an extra big exponent are both defensible. >>> Added as Basic-X line 1361. The returned value for %1.9a is 0x1.000000000p1024. >> Of the two options, that value is preferable. > Interestingly the C stdio library > > printf("%1.9a\n", 1.7976931348623157e+308) > > prints > > 0x2.000000000p+1023 > > on Mac OS 10.7.5. > > Thanks, > > Brian From forax at univ-mlv.fr Tue Jul 23 22:32:58 2013 From: forax at univ-mlv.fr (Remi Forax) Date: Wed, 24 Jul 2013 00:32:58 +0200 Subject: StringJoiner: detect or fix delimiter collision? In-Reply-To: <1374616677631-145058.post@n7.nabble.com> References: <51673A45.8060908@oracle.com> <1374608627412-145039.post@n7.nabble.com> <1374611874568-145045.post@n7.nabble.com> <3C8910F7-981A-4DE9-B4FC-95EC59FAC3FF@gmail.com> <1374616677631-145058.post@n7.nabble.com> Message-ID: <51EF049A.1030608@univ-mlv.fr> On 07/23/2013 11:57 PM, ph wrote: > Nothing against a "simple" joiner that forces users to catch or rule out a > DelimiterCollisionException, and realise that simple is not good enough. > Everything against a stupid joiner that silently assists users in creating > bugs. > > "Seems to work" means not tested thoroughly. People will be tempted into > using this joiner to write csv files, and of course it will break as soon as > a comma or semicolon delimiter turns up in a text field. They will use it to > put br line break elements into HTML files, without checking for HTML syntax > characters in each line. They will use it to separate SQL column values with > commas, instead of binding them, or calling mysql_real_escape_string, which > is a pain to use because it needs a database connection at runtime to find > out exactly which characters need escaping depending on which SQL mode is > configured. > > By all means use a "proper structured format", so long as the delimiting is > properly specified and the parser and generator are fully tested. That might > well be the case for JSON and XML, but it typically is not for CSV and HTML > or properties files. > > Just because other languages may happen to have something similar does not > automatically make it easy to use safely. > > The current behaviour encourages SQL injection. How hard is that to > understand? There are some very good features coming in this release, but > this joiner is not one of them; it is actually dangerous. Java is not PHP, data are represented by objects not Strings so escaping (if needed*) is done by the API not by the users. R?mi * sql drivers in Java often use binary protocols not textual one. From jonathan.gibbons at oracle.com Tue Jul 23 23:06:37 2013 From: jonathan.gibbons at oracle.com (jonathan.gibbons at oracle.com) Date: Tue, 23 Jul 2013 23:06:37 +0000 Subject: hg: jdk8/tl/langtools: 8021215: javac gives incorrect doclint warnings on normal package statements Message-ID: <20130723230640.439AB482C9@hg.openjdk.java.net> Changeset: 129751018061 Author: jjg Date: 2013-07-23 16:06 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/129751018061 8021215: javac gives incorrect doclint warnings on normal package statements Reviewed-by: darcy ! src/share/classes/com/sun/tools/doclint/Checker.java ! src/share/classes/com/sun/tools/doclint/DocLint.java ! test/tools/doclint/packageTests/bad/Test.java + test/tools/doclint/packageTests/bad/Test.javac.out ! test/tools/doclint/packageTests/bad/Test.out ! test/tools/doclint/packageTests/bad/package-info.java + test/tools/doclint/packageTests/bad/package-info.javac.out ! test/tools/doclint/packageTests/bad/package-info.out ! test/tools/doclint/packageTests/good/Test.java ! test/tools/doclint/packageTests/good/package-info.java From ivan.gerasimov at oracle.com Wed Jul 24 00:09:39 2013 From: ivan.gerasimov at oracle.com (Ivan Gerasimov) Date: Wed, 24 Jul 2013 04:09:39 +0400 Subject: RFR [8020669] java.nio.file.Files.readAllBytes() does not read any data when Files.size() is 0 In-Reply-To: <51EE8E9A.6040806@redhat.com> References: <51E97416.20506@oracle.com> <51E98043.6030102@oracle.com> <51E9853E.8020409@redhat.com> <51E985AD.60401@redhat.com> <51EB0BFF.3030106@oracle.com> <51ED57D8.90001@oracle.com> <51EE55AC.5000902@oracle.com> <51EE8E9A.6040806@redhat.com> Message-ID: <51EF1B43.9030200@oracle.com> Would you please take a look at the updated webrev? http://cr.openjdk.java.net/~igerasim/8020669/2/webrev/ readAllBytes() was recently (in b93) changed by Alan Bateman to fix 8014928. Here's what I've done: - reverted readAllBytes() to its implementation prior b93. - modified it to address both 8020669 and 8014928. http://bugs.sun.com/view_bug.do?bug_id=8020669 http://bugs.sun.com/view_bug.do?bug_id=8014928 Sincerely yours, Ivan On 23.07.2013 18:09, David M. Lloyd wrote: > Here's how it should behave: > > - allocate 'size' byte byte array > - if size > 0: > - use simple old I/O to read into the array > - do a one-byte read(), if not EOF then expand the array, using a > simple growth pattern like 3/2 (with a special case for 0), and > continue reading until EOF > - if the array matches the size of the file, return the array, else > use copyOf() to shrink it > > This way you only ever copy the array size() was wrong. > > On 07/23/2013 05:06 AM, Ivan Gerasimov wrote: >> Hi Roger! >> >> This is how my implementation behaves: >> - allocate 'size' bytes in BAOS >> - allocate 8k for temp buffer >> - in cycle read 8k or less bytes from input stream and copy them into >> BAOS >> - if capacity of BAOS isn't sufficient (file had grown), its buffer will >> be reallocated >> Thus, 1 reallocation and 1 copying of already read data on each 8k piece >> of additional bytes. >> >> In normal case, i.e. when fc.size() is correct, we have overhead of 1 >> allocation and copying 'size' bytes in size/8k iterations. >> >> And this is how current implementation does >> - allocate 'size' bytes >> - allocate 'size' bytes of native memory for temp buffer in >> IOUtil.read() >> - read the whole file into temp buffer >> - copy the temp buffer back into our buffer >> >> In common when fc.size() is right, we have 1 allocation and copying >> 'size' bytes from temp buffer back. >> >> So there is a difference in allocations/copying, but in my opinion it's >> not that significant for this particular task. >> >> Sincerely yours, >> Ivan >> >> On 22.07.2013 20:03, roger riggs wrote: >>> Hi Ivan, >>> >>> I'm concerned about the change in behavior for the existing working >>> cases. >>> >>> How many times are the bytes copied in your proposed implementation? >>> How many arrays are allocated and discarded? >>> Files.copy() uses an extra array for the copies. >>> >>> BAOS should only be used for size == 0; that would address the issue >>> without changing the current behavior or allocations. >>> >>> Roger >>> >>> >>> >>> >>> On 7/20/2013 6:15 PM, Ivan Gerasimov wrote: >>>> Roger, David thanks for suggestions! >>>> >>>> Would you please take a look at an updated webrev? >>>> http://cr.openjdk.java.net/~igerasim/8020669/1/webrev/ >>>> >>>> - File size is used as an initial size of BAOS's buffer. >>>> - BAOS avoids copying its buffer in toByteArray(), if size is >>>> correct . >>>> >>>> I don't want to initialize BAOS with a positive number if size >>>> happened to be zero. >>>> Because zero could indicate that the file is really empty. >>>> >>>> Sincerely yours, >>>> Ivan >>>> >>>> On 19.07.2013 22:30, David M. Lloyd wrote: >>>>> My mistake, we're not talking about strings. Still you can subclass >>>>> and determine whether the buffer size guess was right, and if so >>>>> return the array as-is (swap in an empty array or something as >>>>> needed). >>>>> >>>>> On 07/19/2013 01:28 PM, David M. Lloyd wrote: >>>>>> It's trivial to subclass ByteArrayOutputStream and add a method >>>>>> which >>>>>> converts its contents to a string using the two protected fields >>>>>> which >>>>>> give you all the info you need to do so. So no extra copy is needed >>>>>> that you aren't already doing. >>>>>> >>>>>> On 07/19/2013 01:06 PM, roger riggs wrote: >>>>>>> Hi Ivan, >>>>>>> >>>>>>> I think this change takes too big a hit for the cases where the >>>>>>> size is >>>>>>> correct. >>>>>>> >>>>>>> No real file system can be wrong about the size of a file so this >>>>>>> is a >>>>>>> problem >>>>>>> only for special file systems. If the problem is with size >>>>>>> reporting zero >>>>>>> then maybe using the incremental read only for size == would be a >>>>>>> better >>>>>>> fix. >>>>>>> >>>>>>> At least you could pass the size to the constructor for BAOS and >>>>>>> avoid >>>>>>> the thrashing for every re-size; but still it will allocate and >>>>>>> create >>>>>>> an extra copy >>>>>>> of the every time. >>>>>>> >>>>>>> $.02, Roger >>>>>>> >>>>>>> >>>>>>> On 7/19/2013 1:15 PM, Ivan Gerasimov wrote: >>>>>>>> Hello everybody! >>>>>>>> >>>>>>>> Would you please review a fix for the problem with >>>>>>>> j.n.f.Files.readAllBytes() function? >>>>>>>> The current implementation relies on FileChannel.size() to >>>>>>>> preallocate >>>>>>>> a buffer for the whole file's content. >>>>>>>> However, some special filesystems can report a wrong size. >>>>>>>> An example is procfs under Linux, which reports many files under >>>>>>>> /proc >>>>>>>> to be zero sized. >>>>>>>> >>>>>>>> Thus it is proposed not to rely on the size() and instead >>>>>>>> continuously >>>>>>>> read until EOF. >>>>>>>> >>>>>>>> The downside is reallocation and copying file content between >>>>>>>> buffers. >>>>>>>> But taking into account that the doc says: "It is not intended for >>>>>>>> reading in large files." it should not be a big problem. >>>>>>>> >>>>>>>> http://bugs.sun.com/view_bug.do?bug_id=8020669 >>>>>>>> http://cr.openjdk.java.net/~igerasim/8020669/0/webrev/ >>>>>>>> >>>>>>>> The fix is for JDK8. If it is approved, it can be applied to >>>>>>>> JDK7 as >>>>>>>> well. >>>>>>>> >>>>>>>> Sincerely yours, >>>>>>>> Ivan Gerasimov >>>>>>> >>>>>> >>>>>> >>>>> >>>>> >>>> >>> >>> >>> >> > > From Alan.Bateman at oracle.com Wed Jul 24 00:26:43 2013 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Tue, 23 Jul 2013 17:26:43 -0700 Subject: RFR : 6799426 : (xs) Add constructor PriorityQueue(Comparator) In-Reply-To: References: Message-ID: <51EF1F43.70307@oracle.com> On 22/07/2013 12:24, Mike Duigou wrote: > Hello all; > > A simple rewiew for the addition of another constructor to PriorityQueue. Currently if you wish to specify a Comparator you must also supply a size. This addition allows use of the default size which is good for two reason; you don't have to specify a fixed value and the implementation can change it's default as appropriate. > > http://cr.openjdk.java.net/~mduigou/JDK-6799426/0/webrev/ > > Mike Is there a test that could be updated to exercise the new constructor? -Alan. From david.lloyd at redhat.com Wed Jul 24 00:26:47 2013 From: david.lloyd at redhat.com (David M. Lloyd) Date: Tue, 23 Jul 2013 19:26:47 -0500 Subject: RFR [8020669] java.nio.file.Files.readAllBytes() does not read any data when Files.size() is 0 In-Reply-To: <51EF1B43.9030200@oracle.com> References: <51E97416.20506@oracle.com> <51E98043.6030102@oracle.com> <51E9853E.8020409@redhat.com> <51E985AD.60401@redhat.com> <51EB0BFF.3030106@oracle.com> <51ED57D8.90001@oracle.com> <51EE55AC.5000902@oracle.com> <51EE8E9A.6040806@redhat.com> <51EF1B43.9030200@oracle.com> Message-ID: <51EF1F47.9000606@redhat.com> @@ -2965,6 +2965,46 @@ } /** + * Read all the bytes from an input stream. The {@code initialSize} + * parameter indicates the initial size of the byte[] to allocate. + */ + private static byte[] read(InputStream source, int initialSize) + throws IOException + { + int capacity = initialSize; + byte[] buf = new byte[capacity]; + byte[] b = new byte[1]; I assume this is because of... @@ -2989,22 +3029,13 @@ * method is invoked to check read access to the file. */ public static byte[] readAllBytes(Path path) throws IOException { - try (FileChannel fc = FileChannel.open(path)) { + try (FileChannel fc = FileChannel.open(path); + InputStream fis = Channels.newInputStream(fc)) { long size = fc.size(); if (size > (long)Integer.MAX_VALUE) throw new OutOfMemoryError("Required array size too large"); It would be nice if there was a way to get a plain old FileInputStream here (though I don't see any way to do it at first glance). On 07/23/2013 07:09 PM, Ivan Gerasimov wrote: > Would you please take a look at the updated webrev? > http://cr.openjdk.java.net/~igerasim/8020669/2/webrev/ > > readAllBytes() was recently (in b93) changed by Alan Bateman to fix 8014928. > > Here's what I've done: > - reverted readAllBytes() to its implementation prior b93. > - modified it to address both 8020669 and 8014928. > > http://bugs.sun.com/view_bug.do?bug_id=8020669 > > http://bugs.sun.com/view_bug.do?bug_id=8014928 > > Sincerely yours, > Ivan > > On 23.07.2013 18:09, David M. Lloyd wrote: >> Here's how it should behave: >> >> - allocate 'size' byte byte array >> - if size > 0: >> - use simple old I/O to read into the array >> - do a one-byte read(), if not EOF then expand the array, using a >> simple growth pattern like 3/2 (with a special case for 0), and >> continue reading until EOF >> - if the array matches the size of the file, return the array, else >> use copyOf() to shrink it >> >> This way you only ever copy the array size() was wrong. >> >> On 07/23/2013 05:06 AM, Ivan Gerasimov wrote: >>> Hi Roger! >>> >>> This is how my implementation behaves: >>> - allocate 'size' bytes in BAOS >>> - allocate 8k for temp buffer >>> - in cycle read 8k or less bytes from input stream and copy them into >>> BAOS >>> - if capacity of BAOS isn't sufficient (file had grown), its buffer will >>> be reallocated >>> Thus, 1 reallocation and 1 copying of already read data on each 8k piece >>> of additional bytes. >>> >>> In normal case, i.e. when fc.size() is correct, we have overhead of 1 >>> allocation and copying 'size' bytes in size/8k iterations. >>> >>> And this is how current implementation does >>> - allocate 'size' bytes >>> - allocate 'size' bytes of native memory for temp buffer in >>> IOUtil.read() >>> - read the whole file into temp buffer >>> - copy the temp buffer back into our buffer >>> >>> In common when fc.size() is right, we have 1 allocation and copying >>> 'size' bytes from temp buffer back. >>> >>> So there is a difference in allocations/copying, but in my opinion it's >>> not that significant for this particular task. >>> >>> Sincerely yours, >>> Ivan >>> >>> On 22.07.2013 20:03, roger riggs wrote: >>>> Hi Ivan, >>>> >>>> I'm concerned about the change in behavior for the existing working >>>> cases. >>>> >>>> How many times are the bytes copied in your proposed implementation? >>>> How many arrays are allocated and discarded? >>>> Files.copy() uses an extra array for the copies. >>>> >>>> BAOS should only be used for size == 0; that would address the issue >>>> without changing the current behavior or allocations. >>>> >>>> Roger >>>> >>>> >>>> >>>> >>>> On 7/20/2013 6:15 PM, Ivan Gerasimov wrote: >>>>> Roger, David thanks for suggestions! >>>>> >>>>> Would you please take a look at an updated webrev? >>>>> http://cr.openjdk.java.net/~igerasim/8020669/1/webrev/ >>>>> >>>>> - File size is used as an initial size of BAOS's buffer. >>>>> - BAOS avoids copying its buffer in toByteArray(), if size is >>>>> correct . >>>>> >>>>> I don't want to initialize BAOS with a positive number if size >>>>> happened to be zero. >>>>> Because zero could indicate that the file is really empty. >>>>> >>>>> Sincerely yours, >>>>> Ivan >>>>> >>>>> On 19.07.2013 22:30, David M. Lloyd wrote: >>>>>> My mistake, we're not talking about strings. Still you can subclass >>>>>> and determine whether the buffer size guess was right, and if so >>>>>> return the array as-is (swap in an empty array or something as >>>>>> needed). >>>>>> >>>>>> On 07/19/2013 01:28 PM, David M. Lloyd wrote: >>>>>>> It's trivial to subclass ByteArrayOutputStream and add a method >>>>>>> which >>>>>>> converts its contents to a string using the two protected fields >>>>>>> which >>>>>>> give you all the info you need to do so. So no extra copy is needed >>>>>>> that you aren't already doing. >>>>>>> >>>>>>> On 07/19/2013 01:06 PM, roger riggs wrote: >>>>>>>> Hi Ivan, >>>>>>>> >>>>>>>> I think this change takes too big a hit for the cases where the >>>>>>>> size is >>>>>>>> correct. >>>>>>>> >>>>>>>> No real file system can be wrong about the size of a file so this >>>>>>>> is a >>>>>>>> problem >>>>>>>> only for special file systems. If the problem is with size >>>>>>>> reporting zero >>>>>>>> then maybe using the incremental read only for size == would be a >>>>>>>> better >>>>>>>> fix. >>>>>>>> >>>>>>>> At least you could pass the size to the constructor for BAOS and >>>>>>>> avoid >>>>>>>> the thrashing for every re-size; but still it will allocate and >>>>>>>> create >>>>>>>> an extra copy >>>>>>>> of the every time. >>>>>>>> >>>>>>>> $.02, Roger >>>>>>>> >>>>>>>> >>>>>>>> On 7/19/2013 1:15 PM, Ivan Gerasimov wrote: >>>>>>>>> Hello everybody! >>>>>>>>> >>>>>>>>> Would you please review a fix for the problem with >>>>>>>>> j.n.f.Files.readAllBytes() function? >>>>>>>>> The current implementation relies on FileChannel.size() to >>>>>>>>> preallocate >>>>>>>>> a buffer for the whole file's content. >>>>>>>>> However, some special filesystems can report a wrong size. >>>>>>>>> An example is procfs under Linux, which reports many files under >>>>>>>>> /proc >>>>>>>>> to be zero sized. >>>>>>>>> >>>>>>>>> Thus it is proposed not to rely on the size() and instead >>>>>>>>> continuously >>>>>>>>> read until EOF. >>>>>>>>> >>>>>>>>> The downside is reallocation and copying file content between >>>>>>>>> buffers. >>>>>>>>> But taking into account that the doc says: "It is not intended for >>>>>>>>> reading in large files." it should not be a big problem. >>>>>>>>> >>>>>>>>> http://bugs.sun.com/view_bug.do?bug_id=8020669 >>>>>>>>> http://cr.openjdk.java.net/~igerasim/8020669/0/webrev/ >>>>>>>>> >>>>>>>>> The fix is for JDK8. If it is approved, it can be applied to >>>>>>>>> JDK7 as >>>>>>>>> well. >>>>>>>>> >>>>>>>>> Sincerely yours, >>>>>>>>> Ivan Gerasimov >>>>>>>> >>>>>>> >>>>>>> >>>>>> >>>>>> >>>>> >>>> >>>> >>>> >>> >> >> > -- - DML From eric.mccorkle at oracle.com Wed Jul 24 00:44:03 2013 From: eric.mccorkle at oracle.com (eric.mccorkle at oracle.com) Date: Wed, 24 Jul 2013 00:44:03 +0000 Subject: hg: jdk8/tl/langtools: 8016880: 42 tests in annot102* fail with compile-time errors. Message-ID: <20130724004410.DD60C482CB@hg.openjdk.java.net> Changeset: 558fe98d1ac0 Author: emc Date: 2013-07-23 20:42 -0400 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/558fe98d1ac0 8016880: 42 tests in annot102* fail with compile-time errors. Summary: Fixes error in type equality when bounds of type variables have annotations. Reviewed-by: jjg, mcimadamore ! src/share/classes/com/sun/tools/javac/code/Types.java + test/tools/javac/annotations/typeAnnotations/ErasureTest.java From amy.lu at oracle.com Wed Jul 24 01:30:26 2013 From: amy.lu at oracle.com (Amy Lu) Date: Wed, 24 Jul 2013 09:30:26 +0800 Subject: Code Review Request: More tests for 7184826: (reflect) Add support for Project Lambda concepts in core reflection In-Reply-To: <0805A1F1-E808-428B-ABFE-EC5764A81044@oracle.com> References: <519E2C52.20203@oracle.com> <51B91AA5.6090807@oracle.com> <20130710141722.GA23047@jfranck-desktop.jrpg.bea.com> <51ED2FC9.5040200@oracle.com> <0805A1F1-E808-428B-ABFE-EC5764A81044@oracle.com> Message-ID: <51EF2E32.5080301@oracle.com> Thank you Dan ! Please see my comments inline... On 7/24/13 5:12 AM, Dan Smith wrote: > Hi. > > Per a request from Joel, I've taken a look at DefaultStaticTestData. I don't really have the full context here, but I'm assuming that the annotations get translated into tests that guarantee 1) the result of Class.getMethods is exactly (no more -- excepting Object methods -- and no less) those methods named by MethodDesc annotations; and 2) the result of Class.getDeclaredMethods is exactly (no more, no less) those methods that are marked "declared=YES". > > The expected results seem accurate. I would personally focus testing more on different inheritance shapes and less on different combinations of (unrelated) method declarations or presence/absence type variables (!?), but it's a valid test in any case. > > There ought to be some testing for scenarios that javac won't generate, like conflicting default method declarations. Testing on "javac" is out of this scope, it's covered by langtools tests, say test/tools/javac/defaultMethods/ > > > It's not clear to me why we're generating classes with lambda methods (TestIF16) and then not testing that reflection sees those methods. Presumably they get filtered out by the testing logic. But, if so... what's the point of testing? Really, I don't think lambdas belong here at all -- it's a completely orthogonal feature. This testing focus on the locating and invoking the default and static methods by core reflection API. Test case with lambda expression in default method is trying to test that the "default" method won't be broken by the lambda expression (it should be found and invokable as normal). Testing on the Lambda expression itself is covered by other tests. Thanks, Amy > > > (Note: I'm not a Reviewer either, but don't mind providing feedback, especially on spec-related questions.) > > ?Dan > > On Jul 22, 2013, at 7:12 AM, Amy Lu wrote: > >> Thank you Joel for all the valuable feedback. >> >> Test have been refactored and here comes the updated version: >> https://dl.dropboxusercontent.com/u/5812451/yl153753/7184826/webrev.01/index.html >> >> Thanks, >> Amy >> >> >> On 7/10/13 10:17 PM, Joel Borggren-Franck wrote: >>> Hi Amy, Tristan, >>> >>> I'm not a Reviewer kind of reviewer, but I've started to look at the >>> code and can sponsor this. >>> >>> Some comments on test/java/lang/reflect/Method/invoke/DefaultStaticTest.java: >>> >>> As there are a lot of non-public top-level classes perhaps this test >>> should be in it own directory. >>> >>> It is very hard to read the data table: >>> >>> 292 {interface1.class, 1, 1, new Object1(), new Object[]{}, >>> 293 new Object[]{}, "interface1", null}, >>> >>> I believe you should move the methodsNum constant and the declMethods >>> num constant to an annotation on the interface/class in question. For >>> example: >>> >>> @MyTestData(numMethods=1, declMethods=1) >>> 41 interface interface1 { >>> 42 @DefaultMethod(isDefault = true) >>> 43 @StaticMethod(isStatic = false) >>> 44 @ReturnValue(value = "interface1.defaultMethod") >>> 45 default String defaultMethod(){ return "interface1.defaultMethod"; }; >>> 46 } >>> >>> That way it is much easier to inspect that the constants are right. >>> >>> The same can probably be done with the return values encoded. >>> >>> Instead of all these "new Objects[] {}" can't you create a field, >>> >>> Object [] EMPTY_PARAMETERS = new Object() {} >>> >>> and reuse it? >>> >>> That way it will be much easier to verify that the encoded test data is >>> correct. >>> >>> I'll comment on the other tests shortly. >>> >>> cheers >>> /Joel >>> >>> On 2013-06-13, Amy Lu wrote: >>>> This has been pending on review for long ... Please help to review. >>>> I also need a sponsor for this. >>>> >>>> Thank you very much. >>>> >>>> /Amy >>>> >>>> On 5/23/13 10:48 PM, Amy Lu wrote: >>>>> Please help to review: >>>>> >>>>> More tests for 7184826: (reflect) Add support for Project Lambda >>>>> concepts in core reflection >>>>> >>>>> This includes: >>>>> 1. improvement for existing tests with more situations >>>>> 2. Test for invoking interface default/static method by j.l.r.Method >>>>> 3. Test for invoking interface default/static method by MethodHandle >>>>> >>>>> https://dl.dropboxusercontent.com/u/5812451/yl153753/7184826/webrev.00/index.html >>>>> >>>>> >>>>> Thanks, >>>>> Amy >>>> >> > From huizhe.wang at oracle.com Wed Jul 24 02:01:58 2013 From: huizhe.wang at oracle.com (huizhe wang) Date: Tue, 23 Jul 2013 19:01:58 -0700 Subject: RFR: JAXP in JDK8/7u40 : 8021148 Regression in SAXParserImpl in 7u40 b34 (NPE) Message-ID: <51EF3596.7010602@oracle.com> Hi Lance, Chris, Looking at the affected class [1], and the error stack trace [2] , it appeared that in SAXParserImpl$JAXPSAXParser , line 545, fSAXParser.fSecurityPropertyMgr is null when setProperty is called. fSecurityPropertyMgr was instantiated in SAXParserImpl's constructor after JAXPSAXParser was. I can see a chance where the NetBeans got a copy of JAXPSAXParser instance with fSecurityPropertyMgr not initialized. The fix is to remove the reference of fSecurityPropertyMgr in JAXPSAXParser, and pass it in when JAXPSAXParser is created. Here is the webrev: http://cr.openjdk.java.net/~joehw/7u40/8021148/webrev/ [1] http://cr.openjdk.java.net/~joehw/7u40/8021148/webrev/src/com/sun/org/apache/xerces/internal/jaxp/SAXParserImpl.java.html [2] Caused by: java.lang.NullPointerException at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.access$300(SAXParserImpl.java:69) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.setProperty(SAXParserImpl.java:545) at com.sun.org.apache.xml.internal.utils.XMLReaderManager.getXMLReader(XMLReaderManager.java:161) at com.sun.org.apache.xml.internal.dtm.ref.DTMManagerDefault.getXMLReader(DTMManagerDefault.java:613) at com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager.getDTM(XSLTCDTMManager.java:401) at com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager.getDTM(XSLTCDTMManager.java:252) at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.getDOM(TransformerImpl.java:559) ... 43 more --------- javax.xml.transform.TransformerException: java.lang.NullPointerException at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.getDOM(TransformerImpl.java:581) at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:742) at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:353) at org.netbeans.spi.project.support.ant.GeneratedFilesHelper$1$1.run(GeneratedFilesHelper.java:332) Thanks, Joe From Alan.Bateman at oracle.com Wed Jul 24 02:26:30 2013 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Tue, 23 Jul 2013 19:26:30 -0700 Subject: RFR: 8017513: Support for closeable streams In-Reply-To: <51DDD261.5050406@oracle.com> References: <51DDD261.5050406@oracle.com> Message-ID: <51EF3B56.7040509@oracle.com> On 10/07/2013 14:30, Henry Jen wrote: > Hi, > > Please review webrev at > http://cr.openjdk.java.net/~henryjen/ccc/8017513/0/webrev/index.html > > This webrev improve resource release experience on Streams by > eliminating CloseableStream, instead, fold close capability into Stream. > > A new interface, java.util.MayHoldCloseableResource, indicates an > implementation may or may not hold a resource need to be closed. > Annotation {@link HoldsResource} may be used to guide users/static > analysis tools that a MHCR instance that definitely hold a Closeable > resource. > Overall this looks very reasonable to me. A small point on Files.lines is that it could catch any IOException thrown by br.close and add it as a suppressed exception. In XXXStream.concat then maybe it should be "are invoked" instead of "is invoked". MayHoldCloseableResource needs an @since, also I assume the copyright data should be 2013. FilesLambdaTest seems to overlap with Files/StreamsTest - do you need we need both? The sqeutil directory is a bit odd, is this used by other tests that are coming soon? -Alan. From daniel.fuchs at oracle.com Wed Jul 24 06:00:56 2013 From: daniel.fuchs at oracle.com (Daniel Fuchs) Date: Wed, 24 Jul 2013 08:00:56 +0200 Subject: RFR: JAXP in JDK8/7u40 : 8021148 Regression in SAXParserImpl in 7u40 b34 (NPE) In-Reply-To: <51EF3596.7010602@oracle.com> References: <51EF3596.7010602@oracle.com> Message-ID: <51EF6D98.4030804@oracle.com> Hi Joe, This looks reasonable. Out of curiosity - could it be that it was fSAXParser that was null, and not fSecurityPropertyMgr? JAXPSAXParser has a no arg public constructor that could have lead to that... I have only one remark: It looks as if fSecurityPropertyMgr could be declared final in both classes - and I think it would be better if it were: it would make it clear that it's never replaced in fSAXParser and that therefore your new code is strictly equivalent to the old in that respect. best regards, -- daniel On 7/24/13 4:01 AM, huizhe wang wrote: > Hi Lance, Chris, > > Looking at the affected class [1], and the error stack trace [2] , it > appeared that in SAXParserImpl$JAXPSAXParser , line 545, > fSAXParser.fSecurityPropertyMgr is null when setProperty is called. > fSecurityPropertyMgr was instantiated in SAXParserImpl's constructor > after JAXPSAXParser was. I can see a chance where the NetBeans got a > copy of JAXPSAXParser instance with fSecurityPropertyMgr not > initialized. The fix is to remove the reference of > fSecurityPropertyMgr in JAXPSAXParser, and pass it in when > JAXPSAXParser is created. > > Here is the webrev: > http://cr.openjdk.java.net/~joehw/7u40/8021148/webrev/ > > [1] > http://cr.openjdk.java.net/~joehw/7u40/8021148/webrev/src/com/sun/org/apache/xerces/internal/jaxp/SAXParserImpl.java.html > [2] > > Caused by: java.lang.NullPointerException > at > com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.access$300(SAXParserImpl.java:69) > at > com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.setProperty(SAXParserImpl.java:545) > at > com.sun.org.apache.xml.internal.utils.XMLReaderManager.getXMLReader(XMLReaderManager.java:161) > at > com.sun.org.apache.xml.internal.dtm.ref.DTMManagerDefault.getXMLReader(DTMManagerDefault.java:613) > at > com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager.getDTM(XSLTCDTMManager.java:401) > at > com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager.getDTM(XSLTCDTMManager.java:252) > at > com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.getDOM(TransformerImpl.java:559) > ... 43 more > --------- > javax.xml.transform.TransformerException: java.lang.NullPointerException > at > com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.getDOM(TransformerImpl.java:581) > at > com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:742) > at > com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:353) > at > org.netbeans.spi.project.support.ant.GeneratedFilesHelper$1$1.run(GeneratedFilesHelper.java:332) > > Thanks, > Joe > From huizhe.wang at oracle.com Wed Jul 24 06:59:04 2013 From: huizhe.wang at oracle.com (huizhe wang) Date: Tue, 23 Jul 2013 23:59:04 -0700 Subject: RFR: JAXP in JDK8/7u40 : 8021148 Regression in SAXParserImpl in 7u40 b34 (NPE) In-Reply-To: <51EF6D98.4030804@oracle.com> References: <51EF3596.7010602@oracle.com> <51EF6D98.4030804@oracle.com> Message-ID: <51EF7B38.4080903@oracle.com> On 7/23/2013 11:00 PM, Daniel Fuchs wrote: > Hi Joe, > > This looks reasonable. > Out of curiosity - could it be that it was fSAXParser that was null, > and not fSecurityPropertyMgr? > JAXPSAXParser has a no arg public constructor that could have lead to > that... That was my suspicion as well. I thought NetBeans was referencing the internal class directly since the new JAXPSAXParser(this) inside SAXParserImpl was the only call in the entire jaxp code. I was therefore thinking it really should have been a private class. Of course, once NetBeans bugzilla became accessible (it was down at the time), I was able to get the error stacktrace. There is still something strange since XMLReaderManager.getXMLReader calls XMLReaderFactory which should have returned SAXParser since it's hardcoded default. In a manual test, I could only get a JAXPSAXParser if I intentionally set "org.xml.sax.driver" to a "bogus parser". I'm asking the NetBeans reporter and haven't heard from him yet. > > I have only one remark: > > It looks as if fSecurityPropertyMgr could be declared final in both > classes - and I think it > would be better if it were: it would make it clear that it's never > replaced in fSAXParser > and that therefore your new code is strictly equivalent to the old in > that respect. Make sense. Thanks, Joe > > best regards, > > -- daniel > > On 7/24/13 4:01 AM, huizhe wang wrote: >> Hi Lance, Chris, >> >> Looking at the affected class [1], and the error stack trace [2] , it >> appeared that in SAXParserImpl$JAXPSAXParser , line 545, >> fSAXParser.fSecurityPropertyMgr is null when setProperty is called. >> fSecurityPropertyMgr was instantiated in SAXParserImpl's constructor >> after JAXPSAXParser was. I can see a chance where the NetBeans got a >> copy of JAXPSAXParser instance with fSecurityPropertyMgr not >> initialized. The fix is to remove the reference of >> fSecurityPropertyMgr in JAXPSAXParser, and pass it in when >> JAXPSAXParser is created. >> >> Here is the webrev: >> http://cr.openjdk.java.net/~joehw/7u40/8021148/webrev/ >> >> [1] >> http://cr.openjdk.java.net/~joehw/7u40/8021148/webrev/src/com/sun/org/apache/xerces/internal/jaxp/SAXParserImpl.java.html >> [2] >> >> Caused by: java.lang.NullPointerException >> at >> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.access$300(SAXParserImpl.java:69) >> at >> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.setProperty(SAXParserImpl.java:545) >> at >> com.sun.org.apache.xml.internal.utils.XMLReaderManager.getXMLReader(XMLReaderManager.java:161) >> at >> com.sun.org.apache.xml.internal.dtm.ref.DTMManagerDefault.getXMLReader(DTMManagerDefault.java:613) >> at >> com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager.getDTM(XSLTCDTMManager.java:401) >> at >> com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager.getDTM(XSLTCDTMManager.java:252) >> at >> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.getDOM(TransformerImpl.java:559) >> ... 43 more >> --------- >> javax.xml.transform.TransformerException: java.lang.NullPointerException >> at >> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.getDOM(TransformerImpl.java:581) >> at >> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:742) >> at >> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:353) >> at >> org.netbeans.spi.project.support.ant.GeneratedFilesHelper$1$1.run(GeneratedFilesHelper.java:332) >> >> Thanks, >> Joe >> > From chris.hegarty at oracle.com Wed Jul 24 09:04:14 2013 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Wed, 24 Jul 2013 10:04:14 +0100 Subject: RFR: JAXP in JDK8/7u40 : 8021148 Regression in SAXParserImpl in 7u40 b34 (NPE) In-Reply-To: <51EF7B38.4080903@oracle.com> References: <51EF3596.7010602@oracle.com> <51EF6D98.4030804@oracle.com> <51EF7B38.4080903@oracle.com> Message-ID: <51EF988E.3080304@oracle.com> Joe, I can see in SAXParserImpl constructor, setFeature0 could throw, leaving the fSecurityPropertyMgr uninitialized. There my be other code paths too. I agree with this change, and Daniel's comments to make both fSecurityPropertyMgr fields final. Consider it reviewed ( at least on my side ). -Chris. On 24/07/2013 07:59, huizhe wang wrote: > > On 7/23/2013 11:00 PM, Daniel Fuchs wrote: >> Hi Joe, >> >> This looks reasonable. >> Out of curiosity - could it be that it was fSAXParser that was null, >> and not fSecurityPropertyMgr? >> JAXPSAXParser has a no arg public constructor that could have lead to >> that... > > That was my suspicion as well. I thought NetBeans was referencing the > internal class directly since the new JAXPSAXParser(this) inside > SAXParserImpl was the only call in the entire jaxp code. I was therefore > thinking it really should have been a private class. Of course, once > NetBeans bugzilla became accessible (it was down at the time), I was > able to get the error stacktrace. > > There is still something strange since XMLReaderManager.getXMLReader > calls XMLReaderFactory which should have returned SAXParser since it's > hardcoded default. In a manual test, I could only get a JAXPSAXParser if > I intentionally set "org.xml.sax.driver" to a "bogus parser". I'm asking > the NetBeans reporter and haven't heard from him yet. > >> >> I have only one remark: >> >> It looks as if fSecurityPropertyMgr could be declared final in both >> classes - and I think it >> would be better if it were: it would make it clear that it's never >> replaced in fSAXParser >> and that therefore your new code is strictly equivalent to the old in >> that respect. > > Make sense. > > Thanks, > Joe > >> >> best regards, >> >> -- daniel >> >> On 7/24/13 4:01 AM, huizhe wang wrote: >>> Hi Lance, Chris, >>> >>> Looking at the affected class [1], and the error stack trace [2] , it >>> appeared that in SAXParserImpl$JAXPSAXParser , line 545, >>> fSAXParser.fSecurityPropertyMgr is null when setProperty is called. >>> fSecurityPropertyMgr was instantiated in SAXParserImpl's constructor >>> after JAXPSAXParser was. I can see a chance where the NetBeans got a >>> copy of JAXPSAXParser instance with fSecurityPropertyMgr not >>> initialized. The fix is to remove the reference of >>> fSecurityPropertyMgr in JAXPSAXParser, and pass it in when >>> JAXPSAXParser is created. >>> >>> Here is the webrev: >>> http://cr.openjdk.java.net/~joehw/7u40/8021148/webrev/ >>> >>> [1] >>> http://cr.openjdk.java.net/~joehw/7u40/8021148/webrev/src/com/sun/org/apache/xerces/internal/jaxp/SAXParserImpl.java.html >>> >>> [2] >>> >>> Caused by: java.lang.NullPointerException >>> at >>> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.access$300(SAXParserImpl.java:69) >>> >>> at >>> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.setProperty(SAXParserImpl.java:545) >>> >>> at >>> com.sun.org.apache.xml.internal.utils.XMLReaderManager.getXMLReader(XMLReaderManager.java:161) >>> >>> at >>> com.sun.org.apache.xml.internal.dtm.ref.DTMManagerDefault.getXMLReader(DTMManagerDefault.java:613) >>> >>> at >>> com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager.getDTM(XSLTCDTMManager.java:401) >>> >>> at >>> com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager.getDTM(XSLTCDTMManager.java:252) >>> >>> at >>> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.getDOM(TransformerImpl.java:559) >>> >>> ... 43 more >>> --------- >>> javax.xml.transform.TransformerException: java.lang.NullPointerException >>> at >>> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.getDOM(TransformerImpl.java:581) >>> >>> at >>> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:742) >>> >>> at >>> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:353) >>> >>> at >>> org.netbeans.spi.project.support.ant.GeneratedFilesHelper$1$1.run(GeneratedFilesHelper.java:332) >>> >>> >>> Thanks, >>> Joe >>> >> > From paul.sandoz at oracle.com Wed Jul 24 09:22:32 2013 From: paul.sandoz at oracle.com (Paul Sandoz) Date: Wed, 24 Jul 2013 10:22:32 +0100 Subject: RFR 8020921 Re: CompletableFuture updates and CompletionStage In-Reply-To: References: <51DE88F3.6030208@cs.oswego.edu> Message-ID: <4CEAE08B-9F8F-4E72-A447-82097E4A778A@oracle.com> On Jul 11, 2013, at 12:51 PM, Paul Sandoz wrote: > Hi, > > Doug's explanation provides an excellent hook to hang the RFR off: > > http://cr.openjdk.java.net/~psandoz/tl/JDK-8020291-completion-stage/specdiff/overview-summary.html > > http://cr.openjdk.java.net/~psandoz/tl/JDK-8020291-completion-stage/webrev/ > Any takers for reviewing? Paul. From lance.andersen at oracle.com Wed Jul 24 10:41:11 2013 From: lance.andersen at oracle.com (Lance Andersen - Oracle) Date: Wed, 24 Jul 2013 06:41:11 -0400 Subject: RFR: JAXP in JDK8/7u40 : 8021148 Regression in SAXParserImpl in 7u40 b34 (NPE) In-Reply-To: <51EF988E.3080304@oracle.com> References: <51EF3596.7010602@oracle.com> <51EF6D98.4030804@oracle.com> <51EF7B38.4080903@oracle.com> <51EF988E.3080304@oracle.com> Message-ID: <799C1DF4-E39B-4E7D-A346-A4AD96660180@oracle.com> Agree with the change and making fSecurityPropertyMgr final Best Lance On Jul 24, 2013, at 5:04 AM, chris Hegarty wrote: > Joe, > > I can see in SAXParserImpl constructor, setFeature0 could throw, leaving the fSecurityPropertyMgr uninitialized. There my be other code paths too. > > I agree with this change, and Daniel's comments to make both fSecurityPropertyMgr fields final. Consider it reviewed ( at least on my side ). > > -Chris. > > On 24/07/2013 07:59, huizhe wang wrote: >> >> On 7/23/2013 11:00 PM, Daniel Fuchs wrote: >>> Hi Joe, >>> >>> This looks reasonable. >>> Out of curiosity - could it be that it was fSAXParser that was null, >>> and not fSecurityPropertyMgr? >>> JAXPSAXParser has a no arg public constructor that could have lead to >>> that... >> >> That was my suspicion as well. I thought NetBeans was referencing the >> internal class directly since the new JAXPSAXParser(this) inside >> SAXParserImpl was the only call in the entire jaxp code. I was therefore >> thinking it really should have been a private class. Of course, once >> NetBeans bugzilla became accessible (it was down at the time), I was >> able to get the error stacktrace. >> >> There is still something strange since XMLReaderManager.getXMLReader >> calls XMLReaderFactory which should have returned SAXParser since it's >> hardcoded default. In a manual test, I could only get a JAXPSAXParser if >> I intentionally set "org.xml.sax.driver" to a "bogus parser". I'm asking >> the NetBeans reporter and haven't heard from him yet. >> >>> >>> I have only one remark: >>> >>> It looks as if fSecurityPropertyMgr could be declared final in both >>> classes - and I think it >>> would be better if it were: it would make it clear that it's never >>> replaced in fSAXParser >>> and that therefore your new code is strictly equivalent to the old in >>> that respect. >> >> Make sense. >> >> Thanks, >> Joe >> >>> >>> best regards, >>> >>> -- daniel >>> >>> On 7/24/13 4:01 AM, huizhe wang wrote: >>>> Hi Lance, Chris, >>>> >>>> Looking at the affected class [1], and the error stack trace [2] , it >>>> appeared that in SAXParserImpl$JAXPSAXParser , line 545, >>>> fSAXParser.fSecurityPropertyMgr is null when setProperty is called. >>>> fSecurityPropertyMgr was instantiated in SAXParserImpl's constructor >>>> after JAXPSAXParser was. I can see a chance where the NetBeans got a >>>> copy of JAXPSAXParser instance with fSecurityPropertyMgr not >>>> initialized. The fix is to remove the reference of >>>> fSecurityPropertyMgr in JAXPSAXParser, and pass it in when >>>> JAXPSAXParser is created. >>>> >>>> Here is the webrev: >>>> http://cr.openjdk.java.net/~joehw/7u40/8021148/webrev/ >>>> >>>> [1] >>>> http://cr.openjdk.java.net/~joehw/7u40/8021148/webrev/src/com/sun/org/apache/xerces/internal/jaxp/SAXParserImpl.java.html >>>> >>>> [2] >>>> >>>> Caused by: java.lang.NullPointerException >>>> at >>>> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.access$300(SAXParserImpl.java:69) >>>> >>>> at >>>> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.setProperty(SAXParserImpl.java:545) >>>> >>>> at >>>> com.sun.org.apache.xml.internal.utils.XMLReaderManager.getXMLReader(XMLReaderManager.java:161) >>>> >>>> at >>>> com.sun.org.apache.xml.internal.dtm.ref.DTMManagerDefault.getXMLReader(DTMManagerDefault.java:613) >>>> >>>> at >>>> com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager.getDTM(XSLTCDTMManager.java:401) >>>> >>>> at >>>> com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager.getDTM(XSLTCDTMManager.java:252) >>>> >>>> at >>>> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.getDOM(TransformerImpl.java:559) >>>> >>>> ... 43 more >>>> --------- >>>> javax.xml.transform.TransformerException: java.lang.NullPointerException >>>> at >>>> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.getDOM(TransformerImpl.java:581) >>>> >>>> at >>>> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:742) >>>> >>>> at >>>> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:353) >>>> >>>> at >>>> org.netbeans.spi.project.support.ant.GeneratedFilesHelper$1$1.run(GeneratedFilesHelper.java:332) >>>> >>>> >>>> Thanks, >>>> Joe >>>> >>> >> -------------- next part -------------- Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 Oracle Java Engineering 1 Network Drive Burlington, MA 01803 Lance.Andersen at oracle.com From chris.hegarty at oracle.com Wed Jul 24 11:04:17 2013 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Wed, 24 Jul 2013 12:04:17 +0100 Subject: RFR 8020921 Re: CompletableFuture updates and CompletionStage In-Reply-To: <4CEAE08B-9F8F-4E72-A447-82097E4A778A@oracle.com> References: <51DE88F3.6030208@cs.oswego.edu> <4CEAE08B-9F8F-4E72-A447-82097E4A778A@oracle.com> Message-ID: <51EFB4B1.6060601@oracle.com> Hi Paul, Doug, I am happy to be considered as a reviewer for this change. I think the separation of policies and execution mechanisms from the fluent completion-style capabilities is nice. Some minor comments/questions: 1) Should CS.toCompletableFuture declare UnsupportedOperationException in its @throws ? 2) "All CompletionStage methods are implemented independently of other public methods, so the behavior of one method is not impacted by overrides of others in subclasses." I guess this could be an implNote, but then it might not be as conveniently placed. 3) "Actions supplied for dependent completions of non-async methods may be performed by the thread that completes the current CompletableFuture, or by any other caller of these methods. " Is "these methods" referring to other SC methods, or other CF methods? It should be the latter, right. -Chris. On 24/07/2013 10:22, Paul Sandoz wrote: > On Jul 11, 2013, at 12:51 PM, Paul Sandoz wrote: >> Hi, >> >> Doug's explanation provides an excellent hook to hang the RFR off: >> >> http://cr.openjdk.java.net/~psandoz/tl/JDK-8020291-completion-stage/specdiff/overview-summary.html >> >> http://cr.openjdk.java.net/~psandoz/tl/JDK-8020291-completion-stage/webrev/ >> > > Any takers for reviewing? > > Paul. From sean.coffey at oracle.com Wed Jul 24 11:22:24 2013 From: sean.coffey at oracle.com (=?ISO-8859-1?Q?Se=E1n_Coffey?=) Date: Wed, 24 Jul 2013 15:22:24 +0400 Subject: RFR : 8017566 : Backout 8000450 - Cannot access to com.sun.corba.se.impl.orb.ORBImpl In-Reply-To: <51EEFD2D.2000800@oracle.com> References: <51E0013A.4070301@oracle.com> <51E07700.1080103@oracle.com> <51E3AF62.8030209@oracle.com> <51EEFD2D.2000800@oracle.com> Message-ID: <51EFB8F0.1010707@oracle.com> I've just created JDK-8021257 to track this. Yes - the ORB.init issue can be corrected easily but more issues fall out from that. One example : [1]. All calling sites into creation of com.sun.corba.se.impl classes need to be examined. regards, Sean. [1] java.lang.NoClassDefFoundError: Could not initialize class com.sun.corba.se.impl.ior.iiop.MaxStreamFormatVersionComponentImpl at com.sun.corba.se.spi.ior.iiop.IIOPFactories.makeMaxStreamFormatVersionComponent(IIOPFactories.java:174) at com.sun.corba.se.impl.transport.SocketOrChannelAcceptorImpl.addToIORTemplate(SocketOrChannelAcceptorImpl.java:361) at com.sun.corba.se.impl.transport.CorbaTransportManagerImpl.addToIORTemplate(CorbaTransportManagerImpl.java:238) On 24/07/13 02:01, Alan Bateman wrote: > On 15/07/2013 01:14, Se?n Coffey wrote: >> Mandy, >> >>> >>> Looks fine to me. I agree that we should back it out for 7u40. I >>> would think we want to leave the change in jdk8 and continue the >>> investigation and resolving the JCK failures for jdk8. Is that what >>> you are thinking? If so, we don't need to back it out from jdk8. >> I was hoping to back out the fix for both jdk7u40 and jdk8. The setup >> to reproduce is quite simple (modify package list in java.security) >> and I think it's not necessary to have JCK failures in jdk8 for the >> short to medium term as a result. > Have you created a new bug to track doing a more complete fix? It > looks like ORB.init should be straight-forward to fix to work even if > the package for the default implementation is on the restricted list. > > -Alan From david.holmes at oracle.com Wed Jul 24 11:48:55 2013 From: david.holmes at oracle.com (David Holmes) Date: Wed, 24 Jul 2013 21:48:55 +1000 Subject: RFR: 8019948: java/util/logging/bundlesearch/ResourceBundleSearchTest.java is failing intermitently In-Reply-To: <51EE8060.2060105@oracle.com> References: <51EE8060.2060105@oracle.com> Message-ID: <51EFBF27.6000207@oracle.com> On 23/07/2013 11:08 PM, Daniel Fuchs wrote: > Hi, > > Please find below a changeset for fixing > 8019948: java/util/logging/bundlesearch/ResourceBundleSearchTest.java is > failing intermittently [1] > > This appears to be a test bug due to a bizarre use of synchronization > in the test. The test was failing regularly before the fix (= often > enough), but I haven't managed to reproduce since I changed > lr.wait() into lr.join(); lr.join() is lr.wait() behind the scenes but with a check for isAlive(). So this suggests you have been getting spurious wakeups from lr.wait() - which is theoretically possible but extremely unlikely. If you have the cycles could you run the original code with this change: lr.wait(); + if (lr.isAlive()) throw new Error("Spurious wakeup!"); Thanks, David > http://cr.openjdk.java.net/~dfuchs/webrev_8019948/webrev.00/ > > best regards, > > -- daniel > > [1] https://jbs.oracle.com/bugs/browse/JDK-8019948 From paul.sandoz at oracle.com Wed Jul 24 12:37:08 2013 From: paul.sandoz at oracle.com (Paul Sandoz) Date: Wed, 24 Jul 2013 13:37:08 +0100 Subject: RFR 8020921 Re: CompletableFuture updates and CompletionStage In-Reply-To: <51EFB4B1.6060601@oracle.com> References: <51DE88F3.6030208@cs.oswego.edu> <4CEAE08B-9F8F-4E72-A447-82097E4A778A@oracle.com> <51EFB4B1.6060601@oracle.com> Message-ID: On Jul 24, 2013, at 12:04 PM, Chris Hegarty wrote: > Hi Paul, Doug, > > I am happy to be considered as a reviewer for this change. Thanks! > I think the separation of policies and execution mechanisms from the fluent completion-style capabilities is nice. > > Some minor comments/questions: > 1) Should CS.toCompletableFuture declare UnsupportedOperationException > in its @throws ? > What is the convention for declaring runtime exceptions? I notice Iterator.remove does not declare runtime exceptions. In fact it might make sense for this method to be a default implementation throwing UnsupportedOperationException, although the chances of this interface being wildly implemented compared to Iterator is very rare so that does not seem a terribly important thing to do. > 2) "All CompletionStage methods are implemented independently of other > public methods, so the behavior of one method is not impacted by > overrides of others in subclasses." > > I guess this could be an implNote, but then it might not be as > conveniently placed. > That policy reads to me like a spec requirement on CF. > 3) "Actions supplied for dependent completions of non-async methods may > be performed by the thread that completes the current > CompletableFuture, or by any other caller of these methods. " > > Is "these methods" referring to other SC methods, or other CF > methods? It should be the latter, right. > I presume it is referring to the implementations of the non-async methods on SC. Paul. From daniel.fuchs at oracle.com Wed Jul 24 13:07:57 2013 From: daniel.fuchs at oracle.com (Daniel Fuchs) Date: Wed, 24 Jul 2013 15:07:57 +0200 Subject: RFR: 8019948: java/util/logging/bundlesearch/ResourceBundleSearchTest.java is failing intermitently In-Reply-To: <51EFBF27.6000207@oracle.com> References: <51EE8060.2060105@oracle.com> <51EFBF27.6000207@oracle.com> Message-ID: <51EFD1AD.9090205@oracle.com> Hi David, On 7/24/13 1:48 PM, David Holmes wrote: > On 23/07/2013 11:08 PM, Daniel Fuchs wrote: >> Hi, >> >> Please find below a changeset for fixing >> 8019948: java/util/logging/bundlesearch/ResourceBundleSearchTest.java is >> failing intermittently [1] >> >> This appears to be a test bug due to a bizarre use of synchronization >> in the test. The test was failing regularly before the fix (= often >> enough), but I haven't managed to reproduce since I changed >> lr.wait() into lr.join(); > > lr.join() is lr.wait() behind the scenes but with a check for isAlive(). > So this suggests you have been getting spurious wakeups from lr.wait() - > which is theoretically possible but extremely unlikely. If you have the > cycles could you run the original code with this change: > > lr.wait(); > + if (lr.isAlive()) throw new Error("Spurious wakeup!"); As far as I can tell the issue seems to be that the caller never exit from its call to lr.wait(). I am thinking that maybe the thread is already finished when lr.wait() is called - so that the caller would never wake up, (it would have missed the notify()). Increasing the load on the machine seemed to increase the chances of triggering the issue - which seems a usual pattern with these race conditions... best regards, -- daniel > > Thanks, > David > >> http://cr.openjdk.java.net/~dfuchs/webrev_8019948/webrev.00/ >> >> best regards, >> >> -- daniel >> >> [1] https://jbs.oracle.com/bugs/browse/JDK-8019948 From chris.hegarty at oracle.com Wed Jul 24 13:24:29 2013 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Wed, 24 Jul 2013 14:24:29 +0100 Subject: 8021261: ProblemList.txt updates (7/2013) Message-ID: <51EFD58D.1050700@oracle.com> I'm planning this months update to the ProblemList.txt. Anyone got anything else they would like to add, under this bug number? Otherwise, I'll push the two changes I have below. 8008200: has been fixed 8020435: will be fixed soon. We can remove it when the source change appears. >: hg diff ProblemList.txt diff -r a3a2889b1049 test/ProblemList.txt --- a/test/ProblemList.txt Mon Jul 22 15:26:11 2013 +0100 +++ b/test/ProblemList.txt Wed Jul 24 14:18:28 2013 +0100 @@ -130,9 +130,6 @@ java/lang/management/MemoryMXBean/Collec # 7196801 java/lang/management/MemoryMXBean/LowMemoryTest2.sh generic-all - -# 8008200 -java/lang/Class/asSubclass/BasicUnit.java generic-all # 8015780 java/lang/reflect/Method/GenericStringTest.java generic-all @@ -371,6 +368,9 @@ java/util/concurrent/ThreadPoolExecutor/ # Filed 6772009 java/util/concurrent/locks/ReentrantLock/CancelledLockLoops.java generic-all +# 8020435 +java/util/concurrent/CompletableFuture/Basic.java generic-all + # 7041639, Solaris DSA keypair generation bug java/util/TimeZone/TimeZoneDatePermissionCheck.sh solaris-all -Chris. From Alan.Bateman at oracle.com Wed Jul 24 13:48:00 2013 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Wed, 24 Jul 2013 06:48:00 -0700 Subject: 8021261: ProblemList.txt updates (7/2013) In-Reply-To: <51EFD58D.1050700@oracle.com> References: <51EFD58D.1050700@oracle.com> Message-ID: <51EFDB10.6030600@oracle.com> On 24/07/2013 06:24, Chris Hegarty wrote: > I'm planning this months update to the ProblemList.txt. > > Anyone got anything else they would like to add, under this bug > number? Otherwise, I'll push the two changes I have below. > > 8008200: has been fixed > 8020435: will be fixed soon. We can remove it when the source > change appears. > Looks okay to me, I don't know of other updates that are needed at this time. -Alan From shanliang.jiang at oracle.com Wed Jul 24 13:51:29 2013 From: shanliang.jiang at oracle.com (shanliang.jiang at oracle.com) Date: Wed, 24 Jul 2013 13:51:29 +0000 Subject: hg: jdk8/tl/jdk: 8016221: A unit test should not use a fix port to run a jmx connector Message-ID: <20130724135234.0309948303@hg.openjdk.java.net> Changeset: 187a1f2613c0 Author: sjiang Date: 2013-07-24 15:47 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/187a1f2613c0 8016221: A unit test should not use a fix port to run a jmx connector Reviewed-by: jbachorik, dfuchs ! test/com/sun/management/DiagnosticCommandMBean/DcmdMBeanDoubleInvocationTest.java ! test/com/sun/management/DiagnosticCommandMBean/DcmdMBeanInvocationTest.java ! test/com/sun/management/DiagnosticCommandMBean/DcmdMBeanTest.java From chris.hegarty at oracle.com Wed Jul 24 14:56:08 2013 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Wed, 24 Jul 2013 15:56:08 +0100 Subject: 8021261: ProblemList.txt updates (7/2013) In-Reply-To: <51EFDB10.6030600@oracle.com> References: <51EFD58D.1050700@oracle.com> <51EFDB10.6030600@oracle.com> Message-ID: <51EFEB08.6010009@oracle.com> Thanks for the review Alan ;-) I would also like to add: + # 8021186 + jdk/lambda/vm/DefaultMethodsTest.java generic-all ... until 8021186 can be addressed. -Chris. On 24/07/2013 14:48, Alan Bateman wrote: > On 24/07/2013 06:24, Chris Hegarty wrote: >> I'm planning this months update to the ProblemList.txt. >> >> Anyone got anything else they would like to add, under this bug >> number? Otherwise, I'll push the two changes I have below. >> >> 8008200: has been fixed >> 8020435: will be fixed soon. We can remove it when the source >> change appears. >> > Looks okay to me, I don't know of other updates that are needed at this > time. > > -Alan > From maurizio.cimadamore at oracle.com Wed Jul 24 15:09:19 2013 From: maurizio.cimadamore at oracle.com (Maurizio Cimadamore) Date: Wed, 24 Jul 2013 16:09:19 +0100 Subject: 8021261: ProblemList.txt updates (7/2013) In-Reply-To: <51EFEB08.6010009@oracle.com> References: <51EFD58D.1050700@oracle.com> <51EFDB10.6030600@oracle.com> <51EFEB08.6010009@oracle.com> Message-ID: <51EFEE1F.8020606@oracle.com> On 24/07/13 15:56, Chris Hegarty wrote: > Thanks for the review Alan ;-) > > I would also like to add: > + # 8021186 > + jdk/lambda/vm/DefaultMethodsTest.java generic-all > > ... until 8021186 can be addressed. Thanks for taking care of this! Maurizio > > -Chris. > > On 24/07/2013 14:48, Alan Bateman wrote: >> On 24/07/2013 06:24, Chris Hegarty wrote: >>> I'm planning this months update to the ProblemList.txt. >>> >>> Anyone got anything else they would like to add, under this bug >>> number? Otherwise, I'll push the two changes I have below. >>> >>> 8008200: has been fixed >>> 8020435: will be fixed soon. We can remove it when the source >>> change appears. >>> >> Looks okay to me, I don't know of other updates that are needed at this >> time. >> >> -Alan >> From dl at cs.oswego.edu Wed Jul 24 15:25:52 2013 From: dl at cs.oswego.edu (Doug Lea) Date: Wed, 24 Jul 2013 11:25:52 -0400 Subject: RFR 8020921 Re: CompletableFuture updates and CompletionStage In-Reply-To: References: <51DE88F3.6030208@cs.oswego.edu> <4CEAE08B-9F8F-4E72-A447-82097E4A778A@oracle.com> <51EFB4B1.6060601@oracle.com> Message-ID: <51EFF200.8020008@cs.oswego.edu> On 07/24/13 08:37, Paul Sandoz wrote: > > On Jul 24, 2013, at 12:04 PM, Chris Hegarty wrote: > >> Hi Paul, Doug, >> >> I am happy to be considered as a reviewer for this change. > > Thanks! Thanks to you both! > > >> I think the separation of policies and execution mechanisms from the fluent completion-style capabilities is nice. >> >> Some minor comments/questions: >> 1) Should CS.toCompletableFuture declare UnsupportedOperationException >> in its @throws ? >> > > What is the convention for declaring runtime exceptions? I notice Iterator.remove does not declare runtime exceptions. > I think the convention for javadoc is to list if it provides non-obvious information. Which might marginally hold here, so I added. >> 2) "All CompletionStage methods are implemented independently of other >> public methods, so the behavior of one method is not impacted by >> overrides of others in subclasses." >> >> I guess this could be an implNote, but then it might not be as >> conveniently placed. >> > > That policy reads to me like a spec requirement on CF. Yes, a meta-impl-note of sorts. Even if we were to overhaul the internals of this class, we'd want to make sure this still holds. This way people can confidently override for example all non-async methods, knowing that there is no impact on async, and vice versa. > > >> 3) "Actions supplied for dependent completions of non-async methods may >> be performed by the thread that completes the current >> CompletableFuture, or by any other caller of these methods. " >> >> Is "these methods" referring to other SC methods, or other CF >> methods? It should be the latter, right. Clarified to: *

  • Actions supplied for dependent completions of * non-async methods may be performed by the thread that * completes the current CompletableFuture, or by any other caller of * a completion method.
  • Thanks also to Chris for pointing out that CompletableFuture did not have arrangements in place for asyncs when users run with system property java.util.concurrent.ForkJoinPool.common.parallelism set to zero. Now it does. -Doug From chris.hegarty at oracle.com Wed Jul 24 15:43:24 2013 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Wed, 24 Jul 2013 16:43:24 +0100 Subject: RFR 8020921 Re: CompletableFuture updates and CompletionStage In-Reply-To: <51EFF200.8020008@cs.oswego.edu> References: <51DE88F3.6030208@cs.oswego.edu> <4CEAE08B-9F8F-4E72-A447-82097E4A778A@oracle.com> <51EFB4B1.6060601@oracle.com> <51EFF200.8020008@cs.oswego.edu> Message-ID: <51EFF61C.4040303@oracle.com> Thanks Doug, I see the updates in you CVS. Paul, or I, can sync these before pushing this. On 24/07/2013 16:25, Doug Lea wrote: > .... > Thanks also to Chris for pointing out that CompletableFuture > did not have arrangements in place for asyncs when users run with > system property java.util.concurrent.ForkJoinPool.common.parallelism > set to zero. Now it does. You can trivially update the Basic test to catch this. hg diff java/util/concurrent/CompletableFuture/Basic.java diff -r a3a2889b1049 test/java/util/concurrent/CompletableFuture/Basic.java --- a/test/java/util/concurrent/CompletableFuture/Basic.java Mon Jul 22 15:26:11 2013 +0100 +++ b/test/java/util/concurrent/CompletableFuture/Basic.java Wed Jul 24 16:38:18 2013 +0100 @@ -34,6 +34,8 @@ /* * @test * @bug 8005696 + * @run main Basic + * @run main/othervm -Djava.util.concurrent.ForkJoinPool.common.parallelism=0 Basic * @summary Basic tests for CompletableFuture * @author Chris Hegarty */ -Chris. From Alan.Bateman at oracle.com Wed Jul 24 16:14:58 2013 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Wed, 24 Jul 2013 09:14:58 -0700 Subject: RFR: 8016846: Pattern.splitAsStream tests required In-Reply-To: <51E5998E.8040409@oracle.com> References: <51E5998E.8040409@oracle.com> Message-ID: <51EFFD82.50307@oracle.com> On 16/07/2013 12:05, Henry Jen wrote: > Hi, > > Please review the webrev at, > > http://cr.openjdk.java.net/~henryjen/tl/8016846/0/webrev/ > > The test is mostly contributed by Ben Evans. > > Cheers, > Henry > It looks okay to me, just a concern that the tests for the regex API are normally in test/java/util/regex. -Alan. From paul.sandoz at oracle.com Wed Jul 24 17:15:15 2013 From: paul.sandoz at oracle.com (Paul Sandoz) Date: Wed, 24 Jul 2013 18:15:15 +0100 Subject: RFR: 8016846: Pattern.splitAsStream tests required In-Reply-To: <51EFFD82.50307@oracle.com> References: <51E5998E.8040409@oracle.com> <51EFFD82.50307@oracle.com> Message-ID: <6641D095-6E1C-4A83-9283-E141FC6FAC46@oracle.com> On Jul 24, 2013, at 5:14 PM, Alan Bateman wrote: > On 16/07/2013 12:05, Henry Jen wrote: >> Hi, >> >> Please review the webrev at, >> >> http://cr.openjdk.java.net/~henryjen/tl/8016846/0/webrev/ >> >> The test is mostly contributed by Ben Evans. >> >> Cheers, >> Henry >> > It looks okay to me, just a concern that the tests for the regex API are normally in test/java/util/regex. > I have been placing anything that extends from java.util.stream.OpTestCase in the stream tests location. Paul. From Alan.Bateman at oracle.com Wed Jul 24 18:33:43 2013 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Wed, 24 Jul 2013 11:33:43 -0700 Subject: Build error with GCC4.8 on Fedora19 In-Reply-To: <51DDAF72.4000909@redhat.com> References: <20130709045501.4D23E3B6274@msgw008-05.ocn.ad.jp> <51DBA3CD.9020605@oracle.com> <51DBBE7C.6070801@oracle.com> <51DDAF72.4000909@redhat.com> Message-ID: <51F01E07.3070808@oracle.com> On 10/07/2013 12:01, Omair Majid wrote: > On 07/09/2013 03:40 AM, Erik Joelsson wrote: >> I would like to see a comment explaining why the option was needed. Is >> this a bug in gcc or has the checking just become better? > -Werror is not a great default. It means "all warnings are errors". The > set of warnings that a compiler emits changes all the time. Users and > distributions can enable additional warnings by default. Newer compiler > versions may omit additional warnings. So on any compiler other than the > typical compiler used, extra warnings are possible. With -Werror, this > will probably fail. Lots of people discourage it [1]. > > We have been setting SCTP_WERROR="" to disable this -Werror on Fedora > builds [2]. > I'm curious if there was a conclusion on this one. I assume SCTP_WERROR was originally intended for building libsctp (not libnio) so it would be strange to add to SCTP_WERROR to disable -Werror for issues coming from the file system code. One other thing that isn't clear is why there aren't other warnings as there are many other JNI functions in this source file that don't use the "jclass this" parameter. -Alan From martinrb at google.com Wed Jul 24 19:24:12 2013 From: martinrb at google.com (Martin Buchholz) Date: Wed, 24 Jul 2013 12:24:12 -0700 Subject: RFR [8020669] java.nio.file.Files.readAllBytes() does not read any data when Files.size() is 0 In-Reply-To: <51EF1B43.9030200@oracle.com> References: <51E97416.20506@oracle.com> <51E98043.6030102@oracle.com> <51E9853E.8020409@redhat.com> <51E985AD.60401@redhat.com> <51EB0BFF.3030106@oracle.com> <51ED57D8.90001@oracle.com> <51EE55AC.5000902@oracle.com> <51EE8E9A.6040806@redhat.com> <51EF1B43.9030200@oracle.com> Message-ID: It's wasteful to create a 1-byte array to read into. Just use the nullary read method. http://download.java.net/jdk8/docs/api/java/io/InputStream.html#read() On Tue, Jul 23, 2013 at 5:09 PM, Ivan Gerasimov wrote: > Would you please take a look at the updated webrev? > http://cr.openjdk.java.net/~**igerasim/8020669/2/webrev/ > > readAllBytes() was recently (in b93) changed by Alan Bateman to fix > 8014928. > > Here's what I've done: > - reverted readAllBytes() to its implementation prior b93. > - modified it to address both 8020669 and 8014928. > > http://bugs.sun.com/view_bug.**do?bug_id=8020669< > http://bugs.sun.com/view_bug.**do?bug_id=8014928 > > > http://bugs.sun.com/view_bug.**do?bug_id=8014928 > > Sincerely yours, > Ivan > > > On 23.07.2013 18:09, David M. Lloyd wrote: > >> Here's how it should behave: >> >> - allocate 'size' byte byte array >> - if size > 0: >> - use simple old I/O to read into the array >> - do a one-byte read(), if not EOF then expand the array, using a simple >> growth pattern like 3/2 (with a special case for 0), and continue reading >> until EOF >> - if the array matches the size of the file, return the array, else use >> copyOf() to shrink it >> >> This way you only ever copy the array size() was wrong. >> >> On 07/23/2013 05:06 AM, Ivan Gerasimov wrote: >> >>> Hi Roger! >>> >>> This is how my implementation behaves: >>> - allocate 'size' bytes in BAOS >>> - allocate 8k for temp buffer >>> - in cycle read 8k or less bytes from input stream and copy them into >>> BAOS >>> - if capacity of BAOS isn't sufficient (file had grown), its buffer will >>> be reallocated >>> Thus, 1 reallocation and 1 copying of already read data on each 8k piece >>> of additional bytes. >>> >>> In normal case, i.e. when fc.size() is correct, we have overhead of 1 >>> allocation and copying 'size' bytes in size/8k iterations. >>> >>> And this is how current implementation does >>> - allocate 'size' bytes >>> - allocate 'size' bytes of native memory for temp buffer in IOUtil.read() >>> - read the whole file into temp buffer >>> - copy the temp buffer back into our buffer >>> >>> In common when fc.size() is right, we have 1 allocation and copying >>> 'size' bytes from temp buffer back. >>> >>> So there is a difference in allocations/copying, but in my opinion it's >>> not that significant for this particular task. >>> >>> Sincerely yours, >>> Ivan >>> >>> On 22.07.2013 20:03, roger riggs wrote: >>> >>>> Hi Ivan, >>>> >>>> I'm concerned about the change in behavior for the existing working >>>> cases. >>>> >>>> How many times are the bytes copied in your proposed implementation? >>>> How many arrays are allocated and discarded? >>>> Files.copy() uses an extra array for the copies. >>>> >>>> BAOS should only be used for size == 0; that would address the issue >>>> without changing the current behavior or allocations. >>>> >>>> Roger >>>> >>>> >>>> >>>> >>>> On 7/20/2013 6:15 PM, Ivan Gerasimov wrote: >>>> >>>>> Roger, David thanks for suggestions! >>>>> >>>>> Would you please take a look at an updated webrev? >>>>> http://cr.openjdk.java.net/~**igerasim/8020669/1/webrev/ >>>>> >>>>> - File size is used as an initial size of BAOS's buffer. >>>>> - BAOS avoids copying its buffer in toByteArray(), if size is correct . >>>>> >>>>> I don't want to initialize BAOS with a positive number if size >>>>> happened to be zero. >>>>> Because zero could indicate that the file is really empty. >>>>> >>>>> Sincerely yours, >>>>> Ivan >>>>> >>>>> On 19.07.2013 22:30, David M. Lloyd wrote: >>>>> >>>>>> My mistake, we're not talking about strings. Still you can subclass >>>>>> and determine whether the buffer size guess was right, and if so >>>>>> return the array as-is (swap in an empty array or something as >>>>>> needed). >>>>>> >>>>>> On 07/19/2013 01:28 PM, David M. Lloyd wrote: >>>>>> >>>>>>> It's trivial to subclass ByteArrayOutputStream and add a method which >>>>>>> converts its contents to a string using the two protected fields >>>>>>> which >>>>>>> give you all the info you need to do so. So no extra copy is needed >>>>>>> that you aren't already doing. >>>>>>> >>>>>>> On 07/19/2013 01:06 PM, roger riggs wrote: >>>>>>> >>>>>>>> Hi Ivan, >>>>>>>> >>>>>>>> I think this change takes too big a hit for the cases where the >>>>>>>> size is >>>>>>>> correct. >>>>>>>> >>>>>>>> No real file system can be wrong about the size of a file so this >>>>>>>> is a >>>>>>>> problem >>>>>>>> only for special file systems. If the problem is with size >>>>>>>> reporting zero >>>>>>>> then maybe using the incremental read only for size == would be a >>>>>>>> better >>>>>>>> fix. >>>>>>>> >>>>>>>> At least you could pass the size to the constructor for BAOS and >>>>>>>> avoid >>>>>>>> the thrashing for every re-size; but still it will allocate and >>>>>>>> create >>>>>>>> an extra copy >>>>>>>> of the every time. >>>>>>>> >>>>>>>> $.02, Roger >>>>>>>> >>>>>>>> >>>>>>>> On 7/19/2013 1:15 PM, Ivan Gerasimov wrote: >>>>>>>> >>>>>>>>> Hello everybody! >>>>>>>>> >>>>>>>>> Would you please review a fix for the problem with >>>>>>>>> j.n.f.Files.readAllBytes() function? >>>>>>>>> The current implementation relies on FileChannel.size() to >>>>>>>>> preallocate >>>>>>>>> a buffer for the whole file's content. >>>>>>>>> However, some special filesystems can report a wrong size. >>>>>>>>> An example is procfs under Linux, which reports many files under >>>>>>>>> /proc >>>>>>>>> to be zero sized. >>>>>>>>> >>>>>>>>> Thus it is proposed not to rely on the size() and instead >>>>>>>>> continuously >>>>>>>>> read until EOF. >>>>>>>>> >>>>>>>>> The downside is reallocation and copying file content between >>>>>>>>> buffers. >>>>>>>>> But taking into account that the doc says: "It is not intended for >>>>>>>>> reading in large files." it should not be a big problem. >>>>>>>>> >>>>>>>>> http://bugs.sun.com/view_bug.**do?bug_id=8020669 >>>>>>>>> http://cr.openjdk.java.net/~**igerasim/8020669/0/webrev/ >>>>>>>>> >>>>>>>>> The fix is for JDK8. If it is approved, it can be applied to JDK7 >>>>>>>>> as >>>>>>>>> well. >>>>>>>>> >>>>>>>>> Sincerely yours, >>>>>>>>> Ivan Gerasimov >>>>>>>>> >>>>>>>> >>>>>>>> >>>>>>> >>>>>>> >>>>>> >>>>>> >>>>> >>>> >>>> >>>> >>> >> >> > From heliofrota at gmail.com Wed Jul 24 19:28:59 2013 From: heliofrota at gmail.com (Helio Frota) Date: Wed, 24 Jul 2013 16:28:59 -0300 Subject: Build error with GCC4.8 on Fedora19 In-Reply-To: <51F01E07.3070808@oracle.com> References: <20130709045501.4D23E3B6274@msgw008-05.ocn.ad.jp> <51DBA3CD.9020605@oracle.com> <51DBBE7C.6070801@oracle.com> <51DDAF72.4000909@redhat.com> <51F01E07.3070808@oracle.com> Message-ID: Hi, I'm curious if there was a conclusion on this one. I assume SCTP_WERROR was originally intended for building libsctp (not libnio) so it would be strange to add to SCTP_WERROR to disable -Werror for issues coming from the file system code. One other thing that isn't clear is why there aren't other warnings as there are many other JNI functions in this source file that don't use the "jclass this" parameter. I have a plain raw new fedora 19 x86 env here. Going to do the build right now... and post on this thread the feedback. Regards, Helio 2013/7/24 Alan Bateman > On 10/07/2013 12:01, Omair Majid wrote: > >> On 07/09/2013 03:40 AM, Erik Joelsson wrote: >> >>> I would like to see a comment explaining why the option was needed. Is >>> this a bug in gcc or has the checking just become better? >>> >> -Werror is not a great default. It means "all warnings are errors". The >> set of warnings that a compiler emits changes all the time. Users and >> distributions can enable additional warnings by default. Newer compiler >> versions may omit additional warnings. So on any compiler other than the >> typical compiler used, extra warnings are possible. With -Werror, this >> will probably fail. Lots of people discourage it [1]. >> >> We have been setting SCTP_WERROR="" to disable this -Werror on Fedora >> builds [2]. >> >> I'm curious if there was a conclusion on this one. I assume SCTP_WERROR > was originally intended for building libsctp (not libnio) so it would be > strange to add to SCTP_WERROR to disable -Werror for issues coming from the > file system code. One other thing that isn't clear is why there aren't > other warnings as there are many other JNI functions in this source file > that don't use the "jclass this" parameter. > > -Alan > -- Helio Frota JUG Leader - CEJUG http://www.cejug.org/ http://www.linkedin.com/in/heliofrota From heliofrota at gmail.com Wed Jul 24 19:35:14 2013 From: heliofrota at gmail.com (Helio Frota) Date: Wed, 24 Jul 2013 16:35:14 -0300 Subject: Build error with GCC4.8 on Fedora19 In-Reply-To: References: <20130709045501.4D23E3B6274@msgw008-05.ocn.ad.jp> <51DBA3CD.9020605@oracle.com> <51DBBE7C.6070801@oracle.com> <51DDAF72.4000909@redhat.com> <51F01E07.3070808@oracle.com> Message-ID: Ok first feedback configure: error: Could not find a C++ compiler. You might be able to fix this by running 'sudo yum groupinstall "Development Tools"'. I did this but the error continue. Going to investigate a workaround. Regards, Helio 2013/7/24 Helio Frota > Hi, > > I'm curious if there was a conclusion on this one. I assume SCTP_WERROR > was originally intended for building libsctp (not libnio) so it would be > strange to add to SCTP_WERROR to disable -Werror for issues coming from the > file system code. One other thing that isn't clear is why there aren't > other warnings as there are many other JNI functions in this source file > that don't use the "jclass this" parameter. > > I have a plain raw new fedora 19 x86 env here. > > Going to do the build right now... and post on this thread the feedback. > > Regards, > Helio > > > > 2013/7/24 Alan Bateman > >> On 10/07/2013 12:01, Omair Majid wrote: >> >>> On 07/09/2013 03:40 AM, Erik Joelsson wrote: >>> >>>> I would like to see a comment explaining why the option was needed. Is >>>> this a bug in gcc or has the checking just become better? >>>> >>> -Werror is not a great default. It means "all warnings are errors". The >>> set of warnings that a compiler emits changes all the time. Users and >>> distributions can enable additional warnings by default. Newer compiler >>> versions may omit additional warnings. So on any compiler other than the >>> typical compiler used, extra warnings are possible. With -Werror, this >>> will probably fail. Lots of people discourage it [1]. >>> >>> We have been setting SCTP_WERROR="" to disable this -Werror on Fedora >>> builds [2]. >>> >>> I'm curious if there was a conclusion on this one. I assume SCTP_WERROR >> was originally intended for building libsctp (not libnio) so it would be >> strange to add to SCTP_WERROR to disable -Werror for issues coming from the >> file system code. One other thing that isn't clear is why there aren't >> other warnings as there are many other JNI functions in this source file >> that don't use the "jclass this" parameter. >> >> -Alan >> > > > > -- > Helio Frota > JUG Leader - CEJUG > http://www.cejug.org/ > http://www.linkedin.com/in/heliofrota > > > -- Helio Frota JUG Leader - CEJUG http://www.cejug.org/ http://www.linkedin.com/in/heliofrota From martinrb at google.com Wed Jul 24 19:36:11 2013 From: martinrb at google.com (Martin Buchholz) Date: Wed, 24 Jul 2013 12:36:11 -0700 Subject: RFR [8020669] java.nio.file.Files.readAllBytes() does not read any data when Files.size() is 0 In-Reply-To: <51EF1B43.9030200@oracle.com> References: <51E97416.20506@oracle.com> <51E98043.6030102@oracle.com> <51E9853E.8020409@redhat.com> <51E985AD.60401@redhat.com> <51EB0BFF.3030106@oracle.com> <51ED57D8.90001@oracle.com> <51EE55AC.5000902@oracle.com> <51EE8E9A.6040806@redhat.com> <51EF1B43.9030200@oracle.com> Message-ID: Use javadoc style even in private methods. s/Read/Reads/ Use @param initialSize /** + * Read all the bytes from an input stream. The {@code initialSize} + * parameter indicates the initial size of the byte[] to allocate. + */ --- This needs to be tested for an ordinary zero-length file. It looks like for the zero case + int newCapacity = capacity << 1; will infloop not actually increasing the buffer. --- You might want to copy this technique from ArrayList et al: /** * The maximum size of array to allocate. * Some VMs reserve some header words in an array. * Attempts to allocate larger arrays may result in * OutOfMemoryError: Requested array size exceeds VM limit */ private static final int MAX_ARRAY_SIZE = Integer.MAX_VALUE - 8; On Tue, Jul 23, 2013 at 5:09 PM, Ivan Gerasimov wrote: > Would you please take a look at the updated webrev? > http://cr.openjdk.java.net/~**igerasim/8020669/2/webrev/ > > readAllBytes() was recently (in b93) changed by Alan Bateman to fix > 8014928. > > Here's what I've done: > - reverted readAllBytes() to its implementation prior b93. > - modified it to address both 8020669 and 8014928. > > http://bugs.sun.com/view_bug.**do?bug_id=8020669< > http://bugs.sun.com/view_bug.**do?bug_id=8014928 > > > http://bugs.sun.com/view_bug.**do?bug_id=8014928 > > Sincerely yours, > Ivan > > > On 23.07.2013 18:09, David M. Lloyd wrote: > >> Here's how it should behave: >> >> - allocate 'size' byte byte array >> - if size > 0: >> - use simple old I/O to read into the array >> - do a one-byte read(), if not EOF then expand the array, using a simple >> growth pattern like 3/2 (with a special case for 0), and continue reading >> until EOF >> - if the array matches the size of the file, return the array, else use >> copyOf() to shrink it >> >> This way you only ever copy the array size() was wrong. >> >> On 07/23/2013 05:06 AM, Ivan Gerasimov wrote: >> >>> Hi Roger! >>> >>> This is how my implementation behaves: >>> - allocate 'size' bytes in BAOS >>> - allocate 8k for temp buffer >>> - in cycle read 8k or less bytes from input stream and copy them into >>> BAOS >>> - if capacity of BAOS isn't sufficient (file had grown), its buffer will >>> be reallocated >>> Thus, 1 reallocation and 1 copying of already read data on each 8k piece >>> of additional bytes. >>> >>> In normal case, i.e. when fc.size() is correct, we have overhead of 1 >>> allocation and copying 'size' bytes in size/8k iterations. >>> >>> And this is how current implementation does >>> - allocate 'size' bytes >>> - allocate 'size' bytes of native memory for temp buffer in IOUtil.read() >>> - read the whole file into temp buffer >>> - copy the temp buffer back into our buffer >>> >>> In common when fc.size() is right, we have 1 allocation and copying >>> 'size' bytes from temp buffer back. >>> >>> So there is a difference in allocations/copying, but in my opinion it's >>> not that significant for this particular task. >>> >>> Sincerely yours, >>> Ivan >>> >>> On 22.07.2013 20:03, roger riggs wrote: >>> >>>> Hi Ivan, >>>> >>>> I'm concerned about the change in behavior for the existing working >>>> cases. >>>> >>>> How many times are the bytes copied in your proposed implementation? >>>> How many arrays are allocated and discarded? >>>> Files.copy() uses an extra array for the copies. >>>> >>>> BAOS should only be used for size == 0; that would address the issue >>>> without changing the current behavior or allocations. >>>> >>>> Roger >>>> >>>> >>>> >>>> >>>> On 7/20/2013 6:15 PM, Ivan Gerasimov wrote: >>>> >>>>> Roger, David thanks for suggestions! >>>>> >>>>> Would you please take a look at an updated webrev? >>>>> http://cr.openjdk.java.net/~**igerasim/8020669/1/webrev/ >>>>> >>>>> - File size is used as an initial size of BAOS's buffer. >>>>> - BAOS avoids copying its buffer in toByteArray(), if size is correct . >>>>> >>>>> I don't want to initialize BAOS with a positive number if size >>>>> happened to be zero. >>>>> Because zero could indicate that the file is really empty. >>>>> >>>>> Sincerely yours, >>>>> Ivan >>>>> >>>>> On 19.07.2013 22:30, David M. Lloyd wrote: >>>>> >>>>>> My mistake, we're not talking about strings. Still you can subclass >>>>>> and determine whether the buffer size guess was right, and if so >>>>>> return the array as-is (swap in an empty array or something as >>>>>> needed). >>>>>> >>>>>> On 07/19/2013 01:28 PM, David M. Lloyd wrote: >>>>>> >>>>>>> It's trivial to subclass ByteArrayOutputStream and add a method which >>>>>>> converts its contents to a string using the two protected fields >>>>>>> which >>>>>>> give you all the info you need to do so. So no extra copy is needed >>>>>>> that you aren't already doing. >>>>>>> >>>>>>> On 07/19/2013 01:06 PM, roger riggs wrote: >>>>>>> >>>>>>>> Hi Ivan, >>>>>>>> >>>>>>>> I think this change takes too big a hit for the cases where the >>>>>>>> size is >>>>>>>> correct. >>>>>>>> >>>>>>>> No real file system can be wrong about the size of a file so this >>>>>>>> is a >>>>>>>> problem >>>>>>>> only for special file systems. If the problem is with size >>>>>>>> reporting zero >>>>>>>> then maybe using the incremental read only for size == would be a >>>>>>>> better >>>>>>>> fix. >>>>>>>> >>>>>>>> At least you could pass the size to the constructor for BAOS and >>>>>>>> avoid >>>>>>>> the thrashing for every re-size; but still it will allocate and >>>>>>>> create >>>>>>>> an extra copy >>>>>>>> of the every time. >>>>>>>> >>>>>>>> $.02, Roger >>>>>>>> >>>>>>>> >>>>>>>> On 7/19/2013 1:15 PM, Ivan Gerasimov wrote: >>>>>>>> >>>>>>>>> Hello everybody! >>>>>>>>> >>>>>>>>> Would you please review a fix for the problem with >>>>>>>>> j.n.f.Files.readAllBytes() function? >>>>>>>>> The current implementation relies on FileChannel.size() to >>>>>>>>> preallocate >>>>>>>>> a buffer for the whole file's content. >>>>>>>>> However, some special filesystems can report a wrong size. >>>>>>>>> An example is procfs under Linux, which reports many files under >>>>>>>>> /proc >>>>>>>>> to be zero sized. >>>>>>>>> >>>>>>>>> Thus it is proposed not to rely on the size() and instead >>>>>>>>> continuously >>>>>>>>> read until EOF. >>>>>>>>> >>>>>>>>> The downside is reallocation and copying file content between >>>>>>>>> buffers. >>>>>>>>> But taking into account that the doc says: "It is not intended for >>>>>>>>> reading in large files." it should not be a big problem. >>>>>>>>> >>>>>>>>> http://bugs.sun.com/view_bug.**do?bug_id=8020669 >>>>>>>>> http://cr.openjdk.java.net/~**igerasim/8020669/0/webrev/ >>>>>>>>> >>>>>>>>> The fix is for JDK8. If it is approved, it can be applied to JDK7 >>>>>>>>> as >>>>>>>>> well. >>>>>>>>> >>>>>>>>> Sincerely yours, >>>>>>>>> Ivan Gerasimov >>>>>>>>> >>>>>>>> >>>>>>>> >>>>>>> >>>>>>> >>>>>> >>>>>> >>>>> >>>> >>>> >>>> >>> >> >> > From heliofrota at gmail.com Wed Jul 24 19:40:31 2013 From: heliofrota at gmail.com (Helio Frota) Date: Wed, 24 Jul 2013 16:40:31 -0300 Subject: Build error with GCC4.8 on Fedora19 In-Reply-To: References: <20130709045501.4D23E3B6274@msgw008-05.ocn.ad.jp> <51DBA3CD.9020605@oracle.com> <51DBBE7C.6070801@oracle.com> <51DDAF72.4000909@redhat.com> <51F01E07.3070808@oracle.com> Message-ID: Hi, Please need to add the message on the autoconf config scripts: You might be able to fix this by running 'sudo yum install gcc-c++'. because " 'sudo yum groupinstall "Development Tools"' " not installed the gcc-c++ compiler. Regards, Helio 2013/7/24 Helio Frota > Ok first feedback > > configure: error: Could not find a C++ compiler. You might be able to fix > this by running 'sudo yum groupinstall "Development Tools"'. > > I did this but the error continue. > > Going to investigate a workaround. > > Regards, > Helio > > > > 2013/7/24 Helio Frota > >> Hi, >> >> I'm curious if there was a conclusion on this one. I assume SCTP_WERROR >> was originally intended for building libsctp (not libnio) so it would be >> strange to add to SCTP_WERROR to disable -Werror for issues coming from the >> file system code. One other thing that isn't clear is why there aren't >> other warnings as there are many other JNI functions in this source file >> that don't use the "jclass this" parameter. >> >> I have a plain raw new fedora 19 x86 env here. >> >> Going to do the build right now... and post on this thread the feedback. >> >> Regards, >> Helio >> >> >> >> 2013/7/24 Alan Bateman >> >>> On 10/07/2013 12:01, Omair Majid wrote: >>> >>>> On 07/09/2013 03:40 AM, Erik Joelsson wrote: >>>> >>>>> I would like to see a comment explaining why the option was needed. Is >>>>> this a bug in gcc or has the checking just become better? >>>>> >>>> -Werror is not a great default. It means "all warnings are errors". The >>>> set of warnings that a compiler emits changes all the time. Users and >>>> distributions can enable additional warnings by default. Newer compiler >>>> versions may omit additional warnings. So on any compiler other than the >>>> typical compiler used, extra warnings are possible. With -Werror, this >>>> will probably fail. Lots of people discourage it [1]. >>>> >>>> We have been setting SCTP_WERROR="" to disable this -Werror on Fedora >>>> builds [2]. >>>> >>>> I'm curious if there was a conclusion on this one. I assume >>> SCTP_WERROR was originally intended for building libsctp (not libnio) so it >>> would be strange to add to SCTP_WERROR to disable -Werror for issues coming >>> from the file system code. One other thing that isn't clear is why there >>> aren't other warnings as there are many other JNI functions in this source >>> file that don't use the "jclass this" parameter. >>> >>> -Alan >>> >> >> >> >> -- >> Helio Frota >> JUG Leader - CEJUG >> http://www.cejug.org/ >> http://www.linkedin.com/in/heliofrota >> >> >> > > > -- > Helio Frota > JUG Leader - CEJUG > http://www.cejug.org/ > http://www.linkedin.com/in/heliofrota > > > -- Helio Frota JUG Leader - CEJUG http://www.cejug.org/ http://www.linkedin.com/in/heliofrota From heliofrota at gmail.com Wed Jul 24 19:44:24 2013 From: heliofrota at gmail.com (Helio Frota) Date: Wed, 24 Jul 2013 16:44:24 -0300 Subject: Build error with GCC4.8 on Fedora19 In-Reply-To: References: <20130709045501.4D23E3B6274@msgw008-05.ocn.ad.jp> <51DBA3CD.9020605@oracle.com> <51DBBE7C.6070801@oracle.com> <51DDAF72.4000909@redhat.com> <51F01E07.3070808@oracle.com> Message-ID: Hi, Another problem: configure: error: Could not find all X11 headers (shape.h Xrender.h XTest.h). You might be able to fix this by running 'sudo yum install libXtst-devel'. configure exiting with result code 1 I did this, but the error persists. Going to investigate... Regards, Helio 2013/7/24 Helio Frota > Hi, > > Please need to add the message on the autoconf config scripts: > > You might be able to fix this by running 'sudo yum install gcc-c++'. > > because " 'sudo yum groupinstall "Development Tools"' " not installed the > gcc-c++ compiler. > > Regards, > Helio > > > > > > 2013/7/24 Helio Frota > >> Ok first feedback >> >> configure: error: Could not find a C++ compiler. You might be able to fix >> this by running 'sudo yum groupinstall "Development Tools"'. >> >> I did this but the error continue. >> >> Going to investigate a workaround. >> >> Regards, >> Helio >> >> >> >> 2013/7/24 Helio Frota >> >>> Hi, >>> >>> I'm curious if there was a conclusion on this one. I assume SCTP_WERROR >>> was originally intended for building libsctp (not libnio) so it would be >>> strange to add to SCTP_WERROR to disable -Werror for issues coming from the >>> file system code. One other thing that isn't clear is why there aren't >>> other warnings as there are many other JNI functions in this source file >>> that don't use the "jclass this" parameter. >>> >>> I have a plain raw new fedora 19 x86 env here. >>> >>> Going to do the build right now... and post on this thread the feedback. >>> >>> Regards, >>> Helio >>> >>> >>> >>> 2013/7/24 Alan Bateman >>> >>>> On 10/07/2013 12:01, Omair Majid wrote: >>>> >>>>> On 07/09/2013 03:40 AM, Erik Joelsson wrote: >>>>> >>>>>> I would like to see a comment explaining why the option was needed. Is >>>>>> this a bug in gcc or has the checking just become better? >>>>>> >>>>> -Werror is not a great default. It means "all warnings are errors". The >>>>> set of warnings that a compiler emits changes all the time. Users and >>>>> distributions can enable additional warnings by default. Newer compiler >>>>> versions may omit additional warnings. So on any compiler other than >>>>> the >>>>> typical compiler used, extra warnings are possible. With -Werror, this >>>>> will probably fail. Lots of people discourage it [1]. >>>>> >>>>> We have been setting SCTP_WERROR="" to disable this -Werror on Fedora >>>>> builds [2]. >>>>> >>>>> I'm curious if there was a conclusion on this one. I assume >>>> SCTP_WERROR was originally intended for building libsctp (not libnio) so it >>>> would be strange to add to SCTP_WERROR to disable -Werror for issues coming >>>> from the file system code. One other thing that isn't clear is why there >>>> aren't other warnings as there are many other JNI functions in this source >>>> file that don't use the "jclass this" parameter. >>>> >>>> -Alan >>>> >>> >>> >>> >>> -- >>> Helio Frota >>> JUG Leader - CEJUG >>> http://www.cejug.org/ >>> http://www.linkedin.com/in/heliofrota >>> >>> >>> >> >> >> -- >> Helio Frota >> JUG Leader - CEJUG >> http://www.cejug.org/ >> http://www.linkedin.com/in/heliofrota >> >> >> > > > -- > Helio Frota > JUG Leader - CEJUG > http://www.cejug.org/ > http://www.linkedin.com/in/heliofrota > > > -- Helio Frota JUG Leader - CEJUG http://www.cejug.org/ http://www.linkedin.com/in/heliofrota From heliofrota at gmail.com Wed Jul 24 19:50:43 2013 From: heliofrota at gmail.com (Helio Frota) Date: Wed, 24 Jul 2013 16:50:43 -0300 Subject: Build error with GCC4.8 on Fedora19 In-Reply-To: References: <20130709045501.4D23E3B6274@msgw008-05.ocn.ad.jp> <51DBA3CD.9020605@oracle.com> <51DBBE7C.6070801@oracle.com> <51DDAF72.4000909@redhat.com> <51F01E07.3070808@oracle.com> Message-ID: Hi, Please add the message: You might be able to fix this by running 'sudo yum install libXrender-devel'. sudo yum install libXrender-devel Because shape.h Xrender.h XTest.h are not installed with sudo yum install libXtst-devel Regards, Helio 2013/7/24 Helio Frota > Hi, > > Another problem: > > configure: error: Could not find all X11 headers (shape.h Xrender.h > XTest.h). You might be able to fix this by running 'sudo yum install > libXtst-devel'. > configure exiting with result code 1 > > I did this, but the error persists. > > Going to investigate... > > Regards, > Helio > > > > 2013/7/24 Helio Frota > >> Hi, >> >> Please need to add the message on the autoconf config scripts: >> >> You might be able to fix this by running 'sudo yum install gcc-c++'. >> >> because " 'sudo yum groupinstall "Development Tools"' " not installed >> the gcc-c++ compiler. >> >> Regards, >> Helio >> >> >> >> >> >> 2013/7/24 Helio Frota >> >>> Ok first feedback >>> >>> configure: error: Could not find a C++ compiler. You might be able to >>> fix this by running 'sudo yum groupinstall "Development Tools"'. >>> >>> I did this but the error continue. >>> >>> Going to investigate a workaround. >>> >>> Regards, >>> Helio >>> >>> >>> >>> 2013/7/24 Helio Frota >>> >>>> Hi, >>>> >>>> I'm curious if there was a conclusion on this one. I assume SCTP_WERROR >>>> was originally intended for building libsctp (not libnio) so it would be >>>> strange to add to SCTP_WERROR to disable -Werror for issues coming from the >>>> file system code. One other thing that isn't clear is why there aren't >>>> other warnings as there are many other JNI functions in this source file >>>> that don't use the "jclass this" parameter. >>>> >>>> I have a plain raw new fedora 19 x86 env here. >>>> >>>> Going to do the build right now... and post on this thread the feedback. >>>> >>>> Regards, >>>> Helio >>>> >>>> >>>> >>>> 2013/7/24 Alan Bateman >>>> >>>>> On 10/07/2013 12:01, Omair Majid wrote: >>>>> >>>>>> On 07/09/2013 03:40 AM, Erik Joelsson wrote: >>>>>> >>>>>>> I would like to see a comment explaining why the option was needed. >>>>>>> Is >>>>>>> this a bug in gcc or has the checking just become better? >>>>>>> >>>>>> -Werror is not a great default. It means "all warnings are errors". >>>>>> The >>>>>> set of warnings that a compiler emits changes all the time. Users and >>>>>> distributions can enable additional warnings by default. Newer >>>>>> compiler >>>>>> versions may omit additional warnings. So on any compiler other than >>>>>> the >>>>>> typical compiler used, extra warnings are possible. With -Werror, this >>>>>> will probably fail. Lots of people discourage it [1]. >>>>>> >>>>>> We have been setting SCTP_WERROR="" to disable this -Werror on Fedora >>>>>> builds [2]. >>>>>> >>>>>> I'm curious if there was a conclusion on this one. I assume >>>>> SCTP_WERROR was originally intended for building libsctp (not libnio) so it >>>>> would be strange to add to SCTP_WERROR to disable -Werror for issues coming >>>>> from the file system code. One other thing that isn't clear is why there >>>>> aren't other warnings as there are many other JNI functions in this source >>>>> file that don't use the "jclass this" parameter. >>>>> >>>>> -Alan >>>>> >>>> >>>> >>>> >>>> -- >>>> Helio Frota >>>> JUG Leader - CEJUG >>>> http://www.cejug.org/ >>>> http://www.linkedin.com/in/heliofrota >>>> >>>> >>>> >>> >>> >>> -- >>> Helio Frota >>> JUG Leader - CEJUG >>> http://www.cejug.org/ >>> http://www.linkedin.com/in/heliofrota >>> >>> >>> >> >> >> -- >> Helio Frota >> JUG Leader - CEJUG >> http://www.cejug.org/ >> http://www.linkedin.com/in/heliofrota >> >> >> > > > -- > Helio Frota > JUG Leader - CEJUG > http://www.cejug.org/ > http://www.linkedin.com/in/heliofrota > > > -- Helio Frota JUG Leader - CEJUG http://www.cejug.org/ http://www.linkedin.com/in/heliofrota From jason.uh at oracle.com Wed Jul 24 19:50:33 2013 From: jason.uh at oracle.com (jason.uh at oracle.com) Date: Wed, 24 Jul 2013 19:50:33 +0000 Subject: hg: jdk8/tl/jdk: 8016916: UnstructuredName should support DirectoryString Message-ID: <20130724195115.5085E48320@hg.openjdk.java.net> Changeset: f9224fb49890 Author: juh Date: 2013-07-24 12:48 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/f9224fb49890 8016916: UnstructuredName should support DirectoryString Reviewed-by: mullan ! src/share/classes/sun/security/pkcs/PKCS9Attribute.java ! src/share/classes/sun/security/tools/keytool/Main.java + test/sun/security/pkcs/pkcs9/UnstructuredName.java From heliofrota at gmail.com Wed Jul 24 19:53:40 2013 From: heliofrota at gmail.com (Helio Frota) Date: Wed, 24 Jul 2013 16:53:40 -0300 Subject: Build error with GCC4.8 on Fedora19 In-Reply-To: References: <20130709045501.4D23E3B6274@msgw008-05.ocn.ad.jp> <51DBA3CD.9020605@oracle.com> <51DBBE7C.6070801@oracle.com> <51DDAF72.4000909@redhat.com> <51F01E07.3070808@oracle.com> Message-ID: Sorry, its me again. I get the configure error: configure: error: Could not find freetype2! You might be able to fix this by running 'sudo yum install freetype2-devel'. configure exiting with result code 1 But after run the command: sudo yum install freetype2-devel Fedora 19 appears not to have the package Loaded plugins: langpacks, refresh-packagekit No package freetype2-devel available. Error: Nothing to do Going to investigate this... Regards, Helio 2013/7/24 Helio Frota > Hi, > > Please add the message: > > You might be able to fix this by running 'sudo yum install > libXrender-devel'. > > sudo yum install libXrender-devel > > Because shape.h Xrender.h XTest.h are not installed with sudo yum install > libXtst-devel > > Regards, > Helio > > > > > 2013/7/24 Helio Frota > >> Hi, >> >> Another problem: >> >> configure: error: Could not find all X11 headers (shape.h Xrender.h >> XTest.h). You might be able to fix this by running 'sudo yum install >> libXtst-devel'. >> configure exiting with result code 1 >> >> I did this, but the error persists. >> >> Going to investigate... >> >> Regards, >> Helio >> >> >> >> 2013/7/24 Helio Frota >> >>> Hi, >>> >>> Please need to add the message on the autoconf config scripts: >>> >>> You might be able to fix this by running 'sudo yum install gcc-c++'. >>> >>> because " 'sudo yum groupinstall "Development Tools"' " not installed >>> the gcc-c++ compiler. >>> >>> Regards, >>> Helio >>> >>> >>> >>> >>> >>> 2013/7/24 Helio Frota >>> >>>> Ok first feedback >>>> >>>> configure: error: Could not find a C++ compiler. You might be able to >>>> fix this by running 'sudo yum groupinstall "Development Tools"'. >>>> >>>> I did this but the error continue. >>>> >>>> Going to investigate a workaround. >>>> >>>> Regards, >>>> Helio >>>> >>>> >>>> >>>> 2013/7/24 Helio Frota >>>> >>>>> Hi, >>>>> >>>>> I'm curious if there was a conclusion on this one. I assume >>>>> SCTP_WERROR was originally intended for building libsctp (not libnio) so it >>>>> would be strange to add to SCTP_WERROR to disable -Werror for issues coming >>>>> from the file system code. One other thing that isn't clear is why there >>>>> aren't other warnings as there are many other JNI functions in this source >>>>> file that don't use the "jclass this" parameter. >>>>> >>>>> I have a plain raw new fedora 19 x86 env here. >>>>> >>>>> Going to do the build right now... and post on this thread the >>>>> feedback. >>>>> >>>>> Regards, >>>>> Helio >>>>> >>>>> >>>>> >>>>> 2013/7/24 Alan Bateman >>>>> >>>>>> On 10/07/2013 12:01, Omair Majid wrote: >>>>>> >>>>>>> On 07/09/2013 03:40 AM, Erik Joelsson wrote: >>>>>>> >>>>>>>> I would like to see a comment explaining why the option was needed. >>>>>>>> Is >>>>>>>> this a bug in gcc or has the checking just become better? >>>>>>>> >>>>>>> -Werror is not a great default. It means "all warnings are errors". >>>>>>> The >>>>>>> set of warnings that a compiler emits changes all the time. Users and >>>>>>> distributions can enable additional warnings by default. Newer >>>>>>> compiler >>>>>>> versions may omit additional warnings. So on any compiler other than >>>>>>> the >>>>>>> typical compiler used, extra warnings are possible. With -Werror, >>>>>>> this >>>>>>> will probably fail. Lots of people discourage it [1]. >>>>>>> >>>>>>> We have been setting SCTP_WERROR="" to disable this -Werror on Fedora >>>>>>> builds [2]. >>>>>>> >>>>>>> I'm curious if there was a conclusion on this one. I assume >>>>>> SCTP_WERROR was originally intended for building libsctp (not libnio) so it >>>>>> would be strange to add to SCTP_WERROR to disable -Werror for issues coming >>>>>> from the file system code. One other thing that isn't clear is why there >>>>>> aren't other warnings as there are many other JNI functions in this source >>>>>> file that don't use the "jclass this" parameter. >>>>>> >>>>>> -Alan >>>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> Helio Frota >>>>> JUG Leader - CEJUG >>>>> http://www.cejug.org/ >>>>> http://www.linkedin.com/in/heliofrota >>>>> >>>>> >>>>> >>>> >>>> >>>> -- >>>> Helio Frota >>>> JUG Leader - CEJUG >>>> http://www.cejug.org/ >>>> http://www.linkedin.com/in/heliofrota >>>> >>>> >>>> >>> >>> >>> -- >>> Helio Frota >>> JUG Leader - CEJUG >>> http://www.cejug.org/ >>> http://www.linkedin.com/in/heliofrota >>> >>> >>> >> >> >> -- >> Helio Frota >> JUG Leader - CEJUG >> http://www.cejug.org/ >> http://www.linkedin.com/in/heliofrota >> >> >> > > > -- > Helio Frota > JUG Leader - CEJUG > http://www.cejug.org/ > http://www.linkedin.com/in/heliofrota > > > -- Helio Frota JUG Leader - CEJUG http://www.cejug.org/ http://www.linkedin.com/in/heliofrota From omajid at redhat.com Wed Jul 24 19:54:09 2013 From: omajid at redhat.com (Omair Majid) Date: Wed, 24 Jul 2013 15:54:09 -0400 Subject: Build error with GCC4.8 on Fedora19 In-Reply-To: References: <20130709045501.4D23E3B6274@msgw008-05.ocn.ad.jp> <51DBA3CD.9020605@oracle.com> <51DBBE7C.6070801@oracle.com> <51DDAF72.4000909@redhat.com> <51F01E07.3070808@oracle.com> Message-ID: <51F030E1.6090407@redhat.com> On 07/24/2013 03:44 PM, Helio Frota wrote: > Hi, > > Another problem: > > configure: error: Could not find all X11 headers (shape.h Xrender.h > XTest.h). You might be able to fix this by running 'sudo yum install > libXtst-devel'. > configure exiting with result code 1 > > I did this, but the error persists. > > Going to investigate... > The package manager suggestions are very unlikely to be exactly right for all versions of all distributions. You can follow the error message to get better results and install the files it is complaining about. For example, using yum, you can ask to install the package that provides this file (eg XTest.h) by name: # yum install '*/XTest.h' You should do the same for all other header file dependencies configure complains about. If you are on Fedora 19, you can also get all the dependencies faster by getting all the dependencies that java-1.8.0-openjdk (that's what the OpenJDK 8 package is called in Fedora) declares: # yum-builddep java-1.8.0-openjdk This may not be as up-to-date as what configure expects, though. It should be faster. Cheers, Omair -- PGP Key: 66484681 (http://pgp.mit.edu/) Fingerprint = F072 555B 0A17 3957 4E95 0056 F286 F14F 6648 4681 From heliofrota at gmail.com Wed Jul 24 19:57:05 2013 From: heliofrota at gmail.com (Helio Frota) Date: Wed, 24 Jul 2013 16:57:05 -0300 Subject: Build error with GCC4.8 on Fedora19 In-Reply-To: <51F030E1.6090407@redhat.com> References: <20130709045501.4D23E3B6274@msgw008-05.ocn.ad.jp> <51DBA3CD.9020605@oracle.com> <51DBBE7C.6070801@oracle.com> <51DDAF72.4000909@redhat.com> <51F01E07.3070808@oracle.com> <51F030E1.6090407@redhat.com> Message-ID: Hi Omair, Thanks for the tips ! About freetype: Just change to sudo yum install freetype-devel This solve the problem.. Going to validate the "alsa" now... Regards, Helio 2013/7/24 Omair Majid > On 07/24/2013 03:44 PM, Helio Frota wrote: > > Hi, > > > > Another problem: > > > > configure: error: Could not find all X11 headers (shape.h Xrender.h > > XTest.h). You might be able to fix this by running 'sudo yum install > > libXtst-devel'. > > configure exiting with result code 1 > > > > I did this, but the error persists. > > > > Going to investigate... > > > > The package manager suggestions are very unlikely to be exactly right > for all versions of all distributions. You can follow the error message > to get better results and install the files it is complaining about. > > For example, using yum, you can ask to install the package that provides > this file (eg XTest.h) by name: > > # yum install '*/XTest.h' > > You should do the same for all other header file dependencies configure > complains about. > > If you are on Fedora 19, you can also get all the dependencies faster by > getting all the dependencies that java-1.8.0-openjdk (that's what the > OpenJDK 8 package is called in Fedora) declares: > > # yum-builddep java-1.8.0-openjdk > > This may not be as up-to-date as what configure expects, though. It > should be faster. > > Cheers, > Omair > > -- > PGP Key: 66484681 (http://pgp.mit.edu/) > Fingerprint = F072 555B 0A17 3957 4E95 0056 F286 F14F 6648 4681 > -- Helio Frota JUG Leader - CEJUG http://www.cejug.org/ http://www.linkedin.com/in/heliofrota From heliofrota at gmail.com Wed Jul 24 19:59:20 2013 From: heliofrota at gmail.com (Helio Frota) Date: Wed, 24 Jul 2013 16:59:20 -0300 Subject: Build error with GCC4.8 on Fedora19 In-Reply-To: References: <20130709045501.4D23E3B6274@msgw008-05.ocn.ad.jp> <51DBA3CD.9020605@oracle.com> <51DBBE7C.6070801@oracle.com> <51DDAF72.4000909@redhat.com> <51F01E07.3070808@oracle.com> <51F030E1.6090407@redhat.com> Message-ID: Hi, Configure "ok" ==================================================== A new configuration has been successfully created in /home/hf/adopt_openjdk/openjdk8/build/linux-x86-normal-server-release using default settings. Configuration summary: * Debug level: release * JDK variant: normal * JVM variants: server * OpenJDK target: OS: linux, CPU architecture: x86, address length: 32 Tools summary: * Boot JDK: java version "1.7.0_25" Java(TM) SE Runtime Environment (build 1.7.0_25-b15) Java HotSpot(TM) Server VM (build 23.25-b01, mixed mode) (at /home/hf/java/jdk) * C Compiler: gcc (GCC) 4.8.1 20130603 (Red Hat-1) version 4.8.1-1) (at /usr/bin/gcc) * C++ Compiler: g++ (GCC) 4.8.1 20130603 (Red Hat-1) version 4.8.1-1) (at /usr/bin/g++) Build performance summary: * Cores to use: 3 * Memory limit: 3449 MB * ccache status: not installed (consider installing) Build performance tip: ccache gives a tremendous speedup for C++ recompilations. You do not have ccache installed. Try installing it. You might be able to fix this by running 'sudo yum install ccache'. Going to build with make all Regards, Helio 2013/7/24 Helio Frota > Hi Omair, > > Thanks for the tips ! > > About freetype: > > Just change to sudo yum install freetype-devel > This solve the problem.. > > Going to validate the "alsa" now... > > Regards, > Helio > > > 2013/7/24 Omair Majid > >> On 07/24/2013 03:44 PM, Helio Frota wrote: >> > Hi, >> > >> > Another problem: >> > >> > configure: error: Could not find all X11 headers (shape.h Xrender.h >> > XTest.h). You might be able to fix this by running 'sudo yum install >> > libXtst-devel'. >> > configure exiting with result code 1 >> > >> > I did this, but the error persists. >> > >> > Going to investigate... >> > >> >> The package manager suggestions are very unlikely to be exactly right >> for all versions of all distributions. You can follow the error message >> to get better results and install the files it is complaining about. >> >> For example, using yum, you can ask to install the package that provides >> this file (eg XTest.h) by name: >> >> # yum install '*/XTest.h' >> >> You should do the same for all other header file dependencies configure >> complains about. >> >> If you are on Fedora 19, you can also get all the dependencies faster by >> getting all the dependencies that java-1.8.0-openjdk (that's what the >> OpenJDK 8 package is called in Fedora) declares: >> >> # yum-builddep java-1.8.0-openjdk >> >> This may not be as up-to-date as what configure expects, though. It >> should be faster. >> >> Cheers, >> Omair >> >> -- >> PGP Key: 66484681 (http://pgp.mit.edu/) >> Fingerprint = F072 555B 0A17 3957 4E95 0056 F286 F14F 6648 4681 >> > > > > -- > Helio Frota > JUG Leader - CEJUG > http://www.cejug.org/ > http://www.linkedin.com/in/heliofrota > > > -- Helio Frota JUG Leader - CEJUG http://www.cejug.org/ http://www.linkedin.com/in/heliofrota From heliofrota at gmail.com Wed Jul 24 20:11:22 2013 From: heliofrota at gmail.com (Helio Frota) Date: Wed, 24 Jul 2013 17:11:22 -0300 Subject: Build error with GCC4.8 on Fedora19 In-Reply-To: References: <20130709045501.4D23E3B6274@msgw008-05.ocn.ad.jp> <51DBA3CD.9020605@oracle.com> <51DBBE7C.6070801@oracle.com> <51DDAF72.4000909@redhat.com> <51F01E07.3070808@oracle.com> <51F030E1.6090407@redhat.com> Message-ID: Hi, I got the same problem with GCC 4.8.1 and Manjaro distribution ( distro son of archlinux ) Generating precompiled header precompiled.hpp.gch cc1plus: error: the "stabs" debug format cannot be used with pre-compiled headers [-Werror=deprecated] cc1plus: all warnings being treated as errors gmake[6]: *** [precompiled.hpp.gch] Error 1 gmake[5]: *** [the_vm] Error 2 gmake[4]: *** [product] Error 2 gmake[3]: *** [generic_build2] Error 2 gmake[2]: *** [product] Error 2 gmake[1]: *** [/home/hf/adopt_openjdk/openjdk8/build/linux-x86-normal-server-release/hotspot/_hotspot.timestamp] Error 2 make: *** [hotspot-only] Error 2 And i did this one to solve : my web site: http://www.heliofrota.com/blog/2013/06/25/building-openjdk8-plus-gcc-4-dot-8-1-plus-manjaro-gnu-linux-x86/ Regards, Helio 2013/7/24 Helio Frota > Hi, > > Configure "ok" > > > ==================================================== > A new configuration has been successfully created in > /home/hf/adopt_openjdk/openjdk8/build/linux-x86-normal-server-release > using default settings. > > Configuration summary: > * Debug level: release > * JDK variant: normal > * JVM variants: server > * OpenJDK target: OS: linux, CPU architecture: x86, address length: 32 > > Tools summary: > * Boot JDK: java version "1.7.0_25" Java(TM) SE Runtime Environment > (build 1.7.0_25-b15) Java HotSpot(TM) Server VM (build 23.25-b01, mixed > mode) (at /home/hf/java/jdk) > * C Compiler: gcc (GCC) 4.8.1 20130603 (Red Hat-1) version 4.8.1-1) > (at /usr/bin/gcc) > * C++ Compiler: g++ (GCC) 4.8.1 20130603 (Red Hat-1) version 4.8.1-1) > (at /usr/bin/g++) > > Build performance summary: > * Cores to use: 3 > * Memory limit: 3449 MB > * ccache status: not installed (consider installing) > > Build performance tip: ccache gives a tremendous speedup for C++ > recompilations. > You do not have ccache installed. Try installing it. > You might be able to fix this by running 'sudo yum install ccache'. > > Going to build with make all > > Regards, > Helio > > > > > 2013/7/24 Helio Frota > >> Hi Omair, >> >> Thanks for the tips ! >> >> About freetype: >> >> Just change to sudo yum install freetype-devel >> This solve the problem.. >> >> Going to validate the "alsa" now... >> >> Regards, >> Helio >> >> >> 2013/7/24 Omair Majid >> >>> On 07/24/2013 03:44 PM, Helio Frota wrote: >>> > Hi, >>> > >>> > Another problem: >>> > >>> > configure: error: Could not find all X11 headers (shape.h Xrender.h >>> > XTest.h). You might be able to fix this by running 'sudo yum install >>> > libXtst-devel'. >>> > configure exiting with result code 1 >>> > >>> > I did this, but the error persists. >>> > >>> > Going to investigate... >>> > >>> >>> The package manager suggestions are very unlikely to be exactly right >>> for all versions of all distributions. You can follow the error message >>> to get better results and install the files it is complaining about. >>> >>> For example, using yum, you can ask to install the package that provides >>> this file (eg XTest.h) by name: >>> >>> # yum install '*/XTest.h' >>> >>> You should do the same for all other header file dependencies configure >>> complains about. >>> >>> If you are on Fedora 19, you can also get all the dependencies faster by >>> getting all the dependencies that java-1.8.0-openjdk (that's what the >>> OpenJDK 8 package is called in Fedora) declares: >>> >>> # yum-builddep java-1.8.0-openjdk >>> >>> This may not be as up-to-date as what configure expects, though. It >>> should be faster. >>> >>> Cheers, >>> Omair >>> >>> -- >>> PGP Key: 66484681 (http://pgp.mit.edu/) >>> Fingerprint = F072 555B 0A17 3957 4E95 0056 F286 F14F 6648 4681 >>> >> >> >> >> -- >> Helio Frota >> JUG Leader - CEJUG >> http://www.cejug.org/ >> http://www.linkedin.com/in/heliofrota >> >> >> > > > -- > Helio Frota > JUG Leader - CEJUG > http://www.cejug.org/ > http://www.linkedin.com/in/heliofrota > > > -- Helio Frota JUG Leader - CEJUG http://www.cejug.org/ http://www.linkedin.com/in/heliofrota From omajid at redhat.com Wed Jul 24 20:27:15 2013 From: omajid at redhat.com (Omair Majid) Date: Wed, 24 Jul 2013 16:27:15 -0400 Subject: Build error with GCC4.8 on Fedora19 In-Reply-To: References: <20130709045501.4D23E3B6274@msgw008-05.ocn.ad.jp> <51DBA3CD.9020605@oracle.com> <51DBBE7C.6070801@oracle.com> <51DDAF72.4000909@redhat.com> <51F01E07.3070808@oracle.com> <51F030E1.6090407@redhat.com> Message-ID: <51F038A3.1010001@redhat.com> On 07/24/2013 04:11 PM, Helio Frota wrote: > Hi, > > I got the same problem with GCC 4.8.1 and Manjaro distribution ( distro > son of archlinux ) > > Generating precompiled header precompiled.hpp.gch > cc1plus: error: the "stabs" debug format cannot be used with > pre-compiled headers [-Werror=deprecated] > cc1plus: all warnings being treated as errors > gmake[6]: *** [precompiled.hpp.gch] Error 1 > gmake[5]: *** [the_vm] Error 2 > gmake[4]: *** [product] Error 2 > gmake[3]: *** [generic_build2] Error 2 > gmake[2]: *** [product] Error 2 > gmake[1]: *** > [/home/hf/adopt_openjdk/openjdk8/build/linux-x86-normal-server-release/hotspot/_hotspot.timestamp] > Error 2 > make: *** [hotspot-only] Error 2 from hotspot/make/linux/makefiles/gcc.make: # DEBUG_BINARIES uses full -g debug information for all configs ifeq ($(DEBUG_BINARIES), true) CFLAGS += -g else # Use the stabs format for debugging information (this is the default # on gcc-2.91). It's good enough, has all the information about line # numbers and local variables, and libjvm.so is only about 16M. # Change this back to "-g" if you want the most expressive format. # (warning: that could easily inflate libjvm.so to 150M!) The only problem is that modern gcc versions don't produce stabs either. Try: $ make DEBUG_BINARIES=true all Cheers, Omair -- PGP Key: 66484681 (http://pgp.mit.edu/) Fingerprint = F072 555B 0A17 3957 4E95 0056 F286 F14F 6648 4681 From david.lloyd at redhat.com Wed Jul 24 20:40:17 2013 From: david.lloyd at redhat.com (David M. Lloyd) Date: Wed, 24 Jul 2013 15:40:17 -0500 Subject: RFR [8020669] java.nio.file.Files.readAllBytes() does not read any data when Files.size() is 0 In-Reply-To: References: <51E97416.20506@oracle.com> <51E98043.6030102@oracle.com> <51E9853E.8020409@redhat.com> <51E985AD.60401@redhat.com> <51EB0BFF.3030106@oracle.com> <51ED57D8.90001@oracle.com> <51EE55AC.5000902@oracle.com> <51EE8E9A.6040806@redhat.com> <51EF1B43.9030200@oracle.com> Message-ID: <51F03BB1.9090506@redhat.com> I suspect the reason this was done is because the stream is actually a ChannelInputStream. If you don't do the 1-byte array thing, the ChannelInputStream will construct an entire ByteBuffer to read into, which is even worse. As it is, it'll create a wrapper ByteBuffer to encapsulate the destination array, which is bad enough. That's why I was saying that it would be nice if this could get a FileInputStream, which afaik can read directly without messing around with buffers. On 07/24/2013 02:24 PM, Martin Buchholz wrote: > It's wasteful to create a 1-byte array to read into. Just use the > nullary read method. > http://download.java.net/jdk8/docs/api/java/io/InputStream.html#read() > > > On Tue, Jul 23, 2013 at 5:09 PM, Ivan Gerasimov > > wrote: > > Would you please take a look at the updated webrev? > http://cr.openjdk.java.net/~__igerasim/8020669/2/webrev/ > > > readAllBytes() was recently (in b93) changed by Alan Bateman to fix > 8014928. > > Here's what I've done: > - reverted readAllBytes() to its implementation prior b93. > - modified it to address both 8020669 and 8014928. > > http://bugs.sun.com/view_bug.__do?bug_id=8020669 > > > > http://bugs.sun.com/view_bug.__do?bug_id=8014928 > > > Sincerely yours, > Ivan > > > On 23.07.2013 18:09, David M. Lloyd wrote: > > Here's how it should behave: > > - allocate 'size' byte byte array > - if size > 0: > - use simple old I/O to read into the array > - do a one-byte read(), if not EOF then expand the array, using > a simple growth pattern like 3/2 (with a special case for 0), > and continue reading until EOF > - if the array matches the size of the file, return the array, > else use copyOf() to shrink it > > This way you only ever copy the array size() was wrong. > > On 07/23/2013 05:06 AM, Ivan Gerasimov wrote: > > Hi Roger! > > This is how my implementation behaves: > - allocate 'size' bytes in BAOS > - allocate 8k for temp buffer > - in cycle read 8k or less bytes from input stream and copy > them into BAOS > - if capacity of BAOS isn't sufficient (file had grown), its > buffer will > be reallocated > Thus, 1 reallocation and 1 copying of already read data on > each 8k piece > of additional bytes. > > In normal case, i.e. when fc.size() is correct, we have > overhead of 1 > allocation and copying 'size' bytes in size/8k iterations. > > And this is how current implementation does > - allocate 'size' bytes > - allocate 'size' bytes of native memory for temp buffer in > IOUtil.read() > - read the whole file into temp buffer > - copy the temp buffer back into our buffer > > In common when fc.size() is right, we have 1 allocation and > copying > 'size' bytes from temp buffer back. > > So there is a difference in allocations/copying, but in my > opinion it's > not that significant for this particular task. > > Sincerely yours, > Ivan > > On 22.07.2013 20:03, roger riggs wrote: > > Hi Ivan, > > I'm concerned about the change in behavior for the > existing working > cases. > > How many times are the bytes copied in your proposed > implementation? > How many arrays are allocated and discarded? > Files.copy() uses an extra array for the copies. > > BAOS should only be used for size == 0; that would > address the issue > without changing the current behavior or allocations. > > Roger > > > > > On 7/20/2013 6:15 PM, Ivan Gerasimov wrote: > > Roger, David thanks for suggestions! > > Would you please take a look at an updated webrev? > http://cr.openjdk.java.net/~__igerasim/8020669/1/webrev/ > > > - File size is used as an initial size of BAOS's buffer. > - BAOS avoids copying its buffer in toByteArray(), > if size is correct . > > I don't want to initialize BAOS with a positive > number if size > happened to be zero. > Because zero could indicate that the file is really > empty. > > Sincerely yours, > Ivan > > On 19.07.2013 22:30, David M. Lloyd wrote: > > My mistake, we're not talking about strings. > Still you can subclass > and determine whether the buffer size guess was > right, and if so > return the array as-is (swap in an empty array > or something as needed). > > On 07/19/2013 01:28 PM, David M. Lloyd wrote: > > It's trivial to subclass > ByteArrayOutputStream and add a method which > converts its contents to a string using the > two protected fields which > give you all the info you need to do so. So > no extra copy is needed > that you aren't already doing. > > On 07/19/2013 01:06 PM, roger riggs wrote: > > Hi Ivan, > > I think this change takes too big a hit > for the cases where the > size is > correct. > > No real file system can be wrong about > the size of a file so this > is a > problem > only for special file systems. If the > problem is with size > reporting zero > then maybe using the incremental read > only for size == would be a > better > fix. > > At least you could pass the size to the > constructor for BAOS and > avoid > the thrashing for every re-size; but > still it will allocate and > create > an extra copy > of the every time. > > $.02, Roger > > > On 7/19/2013 1:15 PM, Ivan Gerasimov wrote: > > Hello everybody! > > Would you please review a fix for > the problem with > j.n.f.Files.readAllBytes() function? > The current implementation relies on > FileChannel.size() to > preallocate > a buffer for the whole file's content. > However, some special filesystems > can report a wrong size. > An example is procfs under Linux, > which reports many files under > /proc > to be zero sized. > > Thus it is proposed not to rely on > the size() and instead > continuously > read until EOF. > > The downside is reallocation and > copying file content between > buffers. > But taking into account that the doc > says: "It is not intended for > reading in large files." it should > not be a big problem. > > http://bugs.sun.com/view_bug.__do?bug_id=8020669 > > http://cr.openjdk.java.net/~__igerasim/8020669/0/webrev/ > > > The fix is for JDK8. If it is > approved, it can be applied to JDK7 as > well. > > Sincerely yours, > Ivan Gerasimov > > > > > > > > > > > > > > > -- - DML From roger.riggs at oracle.com Wed Jul 24 20:49:27 2013 From: roger.riggs at oracle.com (roger riggs) Date: Wed, 24 Jul 2013 16:49:27 -0400 Subject: RFR [8020669] java.nio.file.Files.readAllBytes() does not read any data when Files.size() is 0 In-Reply-To: <51F03BB1.9090506@redhat.com> References: <51E97416.20506@oracle.com> <51E98043.6030102@oracle.com> <51E9853E.8020409@redhat.com> <51E985AD.60401@redhat.com> <51EB0BFF.3030106@oracle.com> <51ED57D8.90001@oracle.com> <51EE55AC.5000902@oracle.com> <51EE8E9A.6040806@redhat.com> <51EF1B43.9030200@oracle.com> <51F03BB1.9090506@redhat.com> Message-ID: <51F03DD7.9080509@oracle.com> It looks like under the covers the ChannelInputStream uses a 1-byte buffer but caches it and re-uses it. That's slightly better than allocating a new one every time. Also, I don't see much difference between the original use (before the Alan's previous change) of Files.newInputStream(path) vs the compound try in readAllBytes(). That might also be reverted to its previous state as well. Roger On 7/24/2013 4:40 PM, David M. Lloyd wrote: > I suspect the reason this was done is because the stream is actually a > ChannelInputStream. If you don't do the 1-byte array thing, the > ChannelInputStream will construct an entire ByteBuffer to read into, > which is even worse. As it is, it'll create a wrapper ByteBuffer to > encapsulate the destination array, which is bad enough. > > That's why I was saying that it would be nice if this could get a > FileInputStream, which afaik can read directly without messing around > with buffers. > > On 07/24/2013 02:24 PM, Martin Buchholz wrote: >> It's wasteful to create a 1-byte array to read into. Just use the >> nullary read method. >> http://download.java.net/jdk8/docs/api/java/io/InputStream.html#read() >> >> >> On Tue, Jul 23, 2013 at 5:09 PM, Ivan Gerasimov >> > wrote: >> >> Would you please take a look at the updated webrev? >> http://cr.openjdk.java.net/~__igerasim/8020669/2/webrev/ >> >> >> readAllBytes() was recently (in b93) changed by Alan Bateman to fix >> 8014928. >> >> Here's what I've done: >> - reverted readAllBytes() to its implementation prior b93. >> - modified it to address both 8020669 and 8014928. >> >> http://bugs.sun.com/view_bug.__do?bug_id=8020669 >> >> > > >> http://bugs.sun.com/view_bug.__do?bug_id=8014928 >> >> >> Sincerely yours, >> Ivan >> >> >> On 23.07.2013 18:09, David M. Lloyd wrote: >> >> Here's how it should behave: >> >> - allocate 'size' byte byte array >> - if size > 0: >> - use simple old I/O to read into the array >> - do a one-byte read(), if not EOF then expand the array, using >> a simple growth pattern like 3/2 (with a special case for 0), >> and continue reading until EOF >> - if the array matches the size of the file, return the array, >> else use copyOf() to shrink it >> >> This way you only ever copy the array size() was wrong. >> >> On 07/23/2013 05:06 AM, Ivan Gerasimov wrote: >> >> Hi Roger! >> >> This is how my implementation behaves: >> - allocate 'size' bytes in BAOS >> - allocate 8k for temp buffer >> - in cycle read 8k or less bytes from input stream and copy >> them into BAOS >> - if capacity of BAOS isn't sufficient (file had grown), its >> buffer will >> be reallocated >> Thus, 1 reallocation and 1 copying of already read data on >> each 8k piece >> of additional bytes. >> >> In normal case, i.e. when fc.size() is correct, we have >> overhead of 1 >> allocation and copying 'size' bytes in size/8k iterations. >> >> And this is how current implementation does >> - allocate 'size' bytes >> - allocate 'size' bytes of native memory for temp buffer in >> IOUtil.read() >> - read the whole file into temp buffer >> - copy the temp buffer back into our buffer >> >> In common when fc.size() is right, we have 1 allocation and >> copying >> 'size' bytes from temp buffer back. >> >> So there is a difference in allocations/copying, but in my >> opinion it's >> not that significant for this particular task. >> >> Sincerely yours, >> Ivan >> >> On 22.07.2013 20:03, roger riggs wrote: >> >> Hi Ivan, >> >> I'm concerned about the change in behavior for the >> existing working >> cases. >> >> How many times are the bytes copied in your proposed >> implementation? >> How many arrays are allocated and discarded? >> Files.copy() uses an extra array for the copies. >> >> BAOS should only be used for size == 0; that would >> address the issue >> without changing the current behavior or allocations. >> >> Roger >> >> >> >> >> On 7/20/2013 6:15 PM, Ivan Gerasimov wrote: >> >> Roger, David thanks for suggestions! >> >> Would you please take a look at an updated webrev? >> http://cr.openjdk.java.net/~__igerasim/8020669/1/webrev/ >> >> >> - File size is used as an initial size of BAOS's >> buffer. >> - BAOS avoids copying its buffer in toByteArray(), >> if size is correct . >> >> I don't want to initialize BAOS with a positive >> number if size >> happened to be zero. >> Because zero could indicate that the file is really >> empty. >> >> Sincerely yours, >> Ivan >> >> On 19.07.2013 22:30, David M. Lloyd wrote: >> >> My mistake, we're not talking about strings. >> Still you can subclass >> and determine whether the buffer size guess was >> right, and if so >> return the array as-is (swap in an empty array >> or something as needed). >> >> On 07/19/2013 01:28 PM, David M. Lloyd wrote: >> >> It's trivial to subclass >> ByteArrayOutputStream and add a method which >> converts its contents to a string using the >> two protected fields which >> give you all the info you need to do so. So >> no extra copy is needed >> that you aren't already doing. >> >> On 07/19/2013 01:06 PM, roger riggs wrote: >> >> Hi Ivan, >> >> I think this change takes too big a hit >> for the cases where the >> size is >> correct. >> >> No real file system can be wrong about >> the size of a file so this >> is a >> problem >> only for special file systems. If the >> problem is with size >> reporting zero >> then maybe using the incremental read >> only for size == would be a >> better >> fix. >> >> At least you could pass the size to the >> constructor for BAOS and >> avoid >> the thrashing for every re-size; but >> still it will allocate and >> create >> an extra copy >> of the every time. >> >> $.02, Roger >> >> >> On 7/19/2013 1:15 PM, Ivan Gerasimov >> wrote: >> >> Hello everybody! >> >> Would you please review a fix for >> the problem with >> j.n.f.Files.readAllBytes() function? >> The current implementation relies on >> FileChannel.size() to >> preallocate >> a buffer for the whole file's >> content. >> However, some special filesystems >> can report a wrong size. >> An example is procfs under Linux, >> which reports many files under >> /proc >> to be zero sized. >> >> Thus it is proposed not to rely on >> the size() and instead >> continuously >> read until EOF. >> >> The downside is reallocation and >> copying file content between >> buffers. >> But taking into account that the doc >> says: "It is not intended for >> reading in large files." it should >> not be a big problem. >> >> http://bugs.sun.com/view_bug.__do?bug_id=8020669 >> >> http://cr.openjdk.java.net/~__igerasim/8020669/0/webrev/ >> >> >> The fix is for JDK8. If it is >> approved, it can be applied to >> JDK7 as >> well. >> >> Sincerely yours, >> Ivan Gerasimov >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> > > From mike.duigou at oracle.com Wed Jul 24 20:58:44 2013 From: mike.duigou at oracle.com (Mike Duigou) Date: Wed, 24 Jul 2013 13:58:44 -0700 Subject: RFR : 6799426 : (xs) Add constructor PriorityQueue(Comparator) In-Reply-To: <51EF1F43.70307@oracle.com> References: <51EF1F43.70307@oracle.com> Message-ID: <9E110629-31B7-4DC7-A972-A318808961BF@oracle.com> Yes, and there should be. I will open an issue. Mike On Jul 23 2013, at 17:26 , Alan Bateman wrote: > On 22/07/2013 12:24, Mike Duigou wrote: >> Hello all; >> >> A simple rewiew for the addition of another constructor to PriorityQueue. Currently if you wish to specify a Comparator you must also supply a size. This addition allows use of the default size which is good for two reason; you don't have to specify a fixed value and the implementation can change it's default as appropriate. >> >> http://cr.openjdk.java.net/~mduigou/JDK-6799426/0/webrev/ >> >> Mike > Is there a test that could be updated to exercise the new constructor? > > -Alan. From heliofrota at gmail.com Wed Jul 24 21:00:34 2013 From: heliofrota at gmail.com (Helio Frota) Date: Wed, 24 Jul 2013 18:00:34 -0300 Subject: Build error with GCC4.8 on Fedora19 In-Reply-To: <51F038A3.1010001@redhat.com> References: <20130709045501.4D23E3B6274@msgw008-05.ocn.ad.jp> <51DBA3CD.9020605@oracle.com> <51DBBE7C.6070801@oracle.com> <51DDAF72.4000909@redhat.com> <51F01E07.3070808@oracle.com> <51F030E1.6090407@redhat.com> <51F038A3.1010001@redhat.com> Message-ID: Hi Omair, The only problem is that modern gcc versions don't produce stabs either. Try: $ make DEBUG_BINARIES=true all Thanks for the tip ! I will try again tomorrow on job (fedora19) machine. Regards, Helio 2013/7/24 Omair Majid > On 07/24/2013 04:11 PM, Helio Frota wrote: > > Hi, > > > > I got the same problem with GCC 4.8.1 and Manjaro distribution ( distro > > son of archlinux ) > > > > Generating precompiled header precompiled.hpp.gch > > cc1plus: error: the "stabs" debug format cannot be used with > > pre-compiled headers [-Werror=deprecated] > > cc1plus: all warnings being treated as errors > > gmake[6]: *** [precompiled.hpp.gch] Error 1 > > gmake[5]: *** [the_vm] Error 2 > > gmake[4]: *** [product] Error 2 > > gmake[3]: *** [generic_build2] Error 2 > > gmake[2]: *** [product] Error 2 > > gmake[1]: *** > > > [/home/hf/adopt_openjdk/openjdk8/build/linux-x86-normal-server-release/hotspot/_hotspot.timestamp] > > Error 2 > > make: *** [hotspot-only] Error 2 > > from hotspot/make/linux/makefiles/gcc.make: > > # DEBUG_BINARIES uses full -g debug information for all configs > ifeq ($(DEBUG_BINARIES), true) > CFLAGS += -g > else > # Use the stabs format for debugging information (this is the default > # on gcc-2.91). It's good enough, has all the information about line > # numbers and local variables, and libjvm.so is only about 16M. > # Change this back to "-g" if you want the most expressive format. > # (warning: that could easily inflate libjvm.so to 150M!) > > The only problem is that modern gcc versions don't produce stabs either. > > Try: > > $ make DEBUG_BINARIES=true all > > Cheers, > Omair > > -- > PGP Key: 66484681 (http://pgp.mit.edu/) > Fingerprint = F072 555B 0A17 3957 4E95 0056 F286 F14F 6648 4681 > -- Helio Frota JUG Leader - CEJUG http://www.cejug.org/ http://www.linkedin.com/in/heliofrota From david.lloyd at redhat.com Wed Jul 24 21:23:08 2013 From: david.lloyd at redhat.com (David M. Lloyd) Date: Wed, 24 Jul 2013 16:23:08 -0500 Subject: RFR [8020669] java.nio.file.Files.readAllBytes() does not read any data when Files.size() is 0 In-Reply-To: <51F03DD7.9080509@oracle.com> References: <51E97416.20506@oracle.com> <51E98043.6030102@oracle.com> <51E9853E.8020409@redhat.com> <51E985AD.60401@redhat.com> <51EB0BFF.3030106@oracle.com> <51ED57D8.90001@oracle.com> <51EE55AC.5000902@oracle.com> <51EE8E9A.6040806@redhat.com> <51EF1B43.9030200@oracle.com> <51F03BB1.9090506@redhat.com> <51F03DD7.9080509@oracle.com> Message-ID: <51F045BC.3050802@redhat.com> Yes, you're right, I read this wrong. I agree with Martin then that the nullary read method is a better choice. On 07/24/2013 03:49 PM, roger riggs wrote: > It looks like under the covers the ChannelInputStream uses a 1-byte buffer > but caches it and re-uses it. That's slightly better than allocating a > new one every time. > > Also, I don't see much difference between the original use (before the > Alan's previous change) > of Files.newInputStream(path) vs the compound try in readAllBytes(). > That might also be reverted to its previous state as well. > > Roger > > > > On 7/24/2013 4:40 PM, David M. Lloyd wrote: >> I suspect the reason this was done is because the stream is actually a >> ChannelInputStream. If you don't do the 1-byte array thing, the >> ChannelInputStream will construct an entire ByteBuffer to read into, >> which is even worse. As it is, it'll create a wrapper ByteBuffer to >> encapsulate the destination array, which is bad enough. >> >> That's why I was saying that it would be nice if this could get a >> FileInputStream, which afaik can read directly without messing around >> with buffers. >> >> On 07/24/2013 02:24 PM, Martin Buchholz wrote: >>> It's wasteful to create a 1-byte array to read into. Just use the >>> nullary read method. >>> http://download.java.net/jdk8/docs/api/java/io/InputStream.html#read() >>> >>> >>> On Tue, Jul 23, 2013 at 5:09 PM, Ivan Gerasimov >>> > wrote: >>> >>> Would you please take a look at the updated webrev? >>> http://cr.openjdk.java.net/~__igerasim/8020669/2/webrev/ >>> >>> >>> readAllBytes() was recently (in b93) changed by Alan Bateman to fix >>> 8014928. >>> >>> Here's what I've done: >>> - reverted readAllBytes() to its implementation prior b93. >>> - modified it to address both 8020669 and 8014928. >>> >>> http://bugs.sun.com/view_bug.__do?bug_id=8020669 >>> >>> >> > >>> http://bugs.sun.com/view_bug.__do?bug_id=8014928 >>> >>> >>> Sincerely yours, >>> Ivan >>> >>> >>> On 23.07.2013 18:09, David M. Lloyd wrote: >>> >>> Here's how it should behave: >>> >>> - allocate 'size' byte byte array >>> - if size > 0: >>> - use simple old I/O to read into the array >>> - do a one-byte read(), if not EOF then expand the array, using >>> a simple growth pattern like 3/2 (with a special case for 0), >>> and continue reading until EOF >>> - if the array matches the size of the file, return the array, >>> else use copyOf() to shrink it >>> >>> This way you only ever copy the array size() was wrong. >>> >>> On 07/23/2013 05:06 AM, Ivan Gerasimov wrote: >>> >>> Hi Roger! >>> >>> This is how my implementation behaves: >>> - allocate 'size' bytes in BAOS >>> - allocate 8k for temp buffer >>> - in cycle read 8k or less bytes from input stream and copy >>> them into BAOS >>> - if capacity of BAOS isn't sufficient (file had grown), its >>> buffer will >>> be reallocated >>> Thus, 1 reallocation and 1 copying of already read data on >>> each 8k piece >>> of additional bytes. >>> >>> In normal case, i.e. when fc.size() is correct, we have >>> overhead of 1 >>> allocation and copying 'size' bytes in size/8k iterations. >>> >>> And this is how current implementation does >>> - allocate 'size' bytes >>> - allocate 'size' bytes of native memory for temp buffer in >>> IOUtil.read() >>> - read the whole file into temp buffer >>> - copy the temp buffer back into our buffer >>> >>> In common when fc.size() is right, we have 1 allocation and >>> copying >>> 'size' bytes from temp buffer back. >>> >>> So there is a difference in allocations/copying, but in my >>> opinion it's >>> not that significant for this particular task. >>> >>> Sincerely yours, >>> Ivan >>> >>> On 22.07.2013 20:03, roger riggs wrote: >>> >>> Hi Ivan, >>> >>> I'm concerned about the change in behavior for the >>> existing working >>> cases. >>> >>> How many times are the bytes copied in your proposed >>> implementation? >>> How many arrays are allocated and discarded? >>> Files.copy() uses an extra array for the copies. >>> >>> BAOS should only be used for size == 0; that would >>> address the issue >>> without changing the current behavior or allocations. >>> >>> Roger >>> >>> >>> >>> >>> On 7/20/2013 6:15 PM, Ivan Gerasimov wrote: >>> >>> Roger, David thanks for suggestions! >>> >>> Would you please take a look at an updated webrev? >>> http://cr.openjdk.java.net/~__igerasim/8020669/1/webrev/ >>> >>> >>> - File size is used as an initial size of BAOS's >>> buffer. >>> - BAOS avoids copying its buffer in toByteArray(), >>> if size is correct . >>> >>> I don't want to initialize BAOS with a positive >>> number if size >>> happened to be zero. >>> Because zero could indicate that the file is really >>> empty. >>> >>> Sincerely yours, >>> Ivan >>> >>> On 19.07.2013 22:30, David M. Lloyd wrote: >>> >>> My mistake, we're not talking about strings. >>> Still you can subclass >>> and determine whether the buffer size guess was >>> right, and if so >>> return the array as-is (swap in an empty array >>> or something as needed). >>> >>> On 07/19/2013 01:28 PM, David M. Lloyd wrote: >>> >>> It's trivial to subclass >>> ByteArrayOutputStream and add a method which >>> converts its contents to a string using the >>> two protected fields which >>> give you all the info you need to do so. So >>> no extra copy is needed >>> that you aren't already doing. >>> >>> On 07/19/2013 01:06 PM, roger riggs wrote: >>> >>> Hi Ivan, >>> >>> I think this change takes too big a hit >>> for the cases where the >>> size is >>> correct. >>> >>> No real file system can be wrong about >>> the size of a file so this >>> is a >>> problem >>> only for special file systems. If the >>> problem is with size >>> reporting zero >>> then maybe using the incremental read >>> only for size == would be a >>> better >>> fix. >>> >>> At least you could pass the size to the >>> constructor for BAOS and >>> avoid >>> the thrashing for every re-size; but >>> still it will allocate and >>> create >>> an extra copy >>> of the every time. >>> >>> $.02, Roger >>> >>> >>> On 7/19/2013 1:15 PM, Ivan Gerasimov >>> wrote: >>> >>> Hello everybody! >>> >>> Would you please review a fix for >>> the problem with >>> j.n.f.Files.readAllBytes() function? >>> The current implementation relies on >>> FileChannel.size() to >>> preallocate >>> a buffer for the whole file's >>> content. >>> However, some special filesystems >>> can report a wrong size. >>> An example is procfs under Linux, >>> which reports many files under >>> /proc >>> to be zero sized. >>> >>> Thus it is proposed not to rely on >>> the size() and instead >>> continuously >>> read until EOF. >>> >>> The downside is reallocation and >>> copying file content between >>> buffers. >>> But taking into account that the doc >>> says: "It is not intended for >>> reading in large files." it should >>> not be a big problem. >>> >>> http://bugs.sun.com/view_bug.__do?bug_id=8020669 >>> >>> http://cr.openjdk.java.net/~__igerasim/8020669/0/webrev/ >>> >>> >>> The fix is for JDK8. If it is >>> approved, it can be applied to >>> JDK7 as >>> well. >>> >>> Sincerely yours, >>> Ivan Gerasimov >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >> >> > -- - DML From chris.hegarty at oracle.com Wed Jul 24 21:53:05 2013 From: chris.hegarty at oracle.com (chris.hegarty at oracle.com) Date: Wed, 24 Jul 2013 21:53:05 +0000 Subject: hg: jdk8/tl/jdk: 8021261: ProblemList.txt updates (7/2013) Message-ID: <20130724215333.7F7EE48325@hg.openjdk.java.net> Changeset: fd1b5adcfdf0 Author: chegar Date: 2013-07-24 22:52 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/fd1b5adcfdf0 8021261: ProblemList.txt updates (7/2013) Reviewed-by: alanb, mcimadamore ! test/ProblemList.txt From ivan.gerasimov at oracle.com Wed Jul 24 21:59:31 2013 From: ivan.gerasimov at oracle.com (Ivan Gerasimov) Date: Thu, 25 Jul 2013 01:59:31 +0400 Subject: RFR [8020669] java.nio.file.Files.readAllBytes() does not read any data when Files.size() is 0 In-Reply-To: <51F03DD7.9080509@oracle.com> References: <51E97416.20506@oracle.com> <51E98043.6030102@oracle.com> <51E9853E.8020409@redhat.com> <51E985AD.60401@redhat.com> <51EB0BFF.3030106@oracle.com> <51ED57D8.90001@oracle.com> <51EE55AC.5000902@oracle.com> <51EE8E9A.6040806@redhat.com> <51EF1B43.9030200@oracle.com> <51F03BB1.9090506@redhat.com> <51F03DD7.9080509@oracle.com> Message-ID: <51F04E43.8010300@oracle.com> Hello Roger! On 25.07.2013 0:49, roger riggs wrote: > It looks like under the covers the ChannelInputStream uses a 1-byte > buffer > but caches it and re-uses it. That's slightly better than allocating > a new one every time. Thanks, I'll change it. > Also, I don't see much difference between the original use (before the > Alan's previous change) > of Files.newInputStream(path) vs the compound try in readAllBytes(). > That might also be reverted to its previous state as well. The previous implementation reads the file size before opening it. And now the file is first opened and then its size is read, so we're sure we read size of the correct file. Basically it is stat() vs fstat(). I think the former is better, because the name of file can change between reading size and opening. Sincerely yours, Ivan > Roger > > > > On 7/24/2013 4:40 PM, David M. Lloyd wrote: >> I suspect the reason this was done is because the stream is actually >> a ChannelInputStream. If you don't do the 1-byte array thing, the >> ChannelInputStream will construct an entire ByteBuffer to read into, >> which is even worse. As it is, it'll create a wrapper ByteBuffer to >> encapsulate the destination array, which is bad enough. >> >> That's why I was saying that it would be nice if this could get a >> FileInputStream, which afaik can read directly without messing around >> with buffers. >> >> On 07/24/2013 02:24 PM, Martin Buchholz wrote: >>> It's wasteful to create a 1-byte array to read into. Just use the >>> nullary read method. >>> http://download.java.net/jdk8/docs/api/java/io/InputStream.html#read() >>> >>> >>> On Tue, Jul 23, 2013 at 5:09 PM, Ivan Gerasimov >>> > wrote: >>> >>> Would you please take a look at the updated webrev? >>> http://cr.openjdk.java.net/~__igerasim/8020669/2/webrev/ >>> >>> >>> readAllBytes() was recently (in b93) changed by Alan Bateman to fix >>> 8014928. >>> >>> Here's what I've done: >>> - reverted readAllBytes() to its implementation prior b93. >>> - modified it to address both 8020669 and 8014928. >>> >>> http://bugs.sun.com/view_bug.__do?bug_id=8020669 >>> >>> >> > >>> http://bugs.sun.com/view_bug.__do?bug_id=8014928 >>> >>> >>> Sincerely yours, >>> Ivan >>> >>> >>> On 23.07.2013 18:09, David M. Lloyd wrote: >>> >>> Here's how it should behave: >>> >>> - allocate 'size' byte byte array >>> - if size > 0: >>> - use simple old I/O to read into the array >>> - do a one-byte read(), if not EOF then expand the array, using >>> a simple growth pattern like 3/2 (with a special case for 0), >>> and continue reading until EOF >>> - if the array matches the size of the file, return the array, >>> else use copyOf() to shrink it >>> >>> This way you only ever copy the array size() was wrong. >>> >>> On 07/23/2013 05:06 AM, Ivan Gerasimov wrote: >>> >>> Hi Roger! >>> >>> This is how my implementation behaves: >>> - allocate 'size' bytes in BAOS >>> - allocate 8k for temp buffer >>> - in cycle read 8k or less bytes from input stream and copy >>> them into BAOS >>> - if capacity of BAOS isn't sufficient (file had grown), >>> its >>> buffer will >>> be reallocated >>> Thus, 1 reallocation and 1 copying of already read data on >>> each 8k piece >>> of additional bytes. >>> >>> In normal case, i.e. when fc.size() is correct, we have >>> overhead of 1 >>> allocation and copying 'size' bytes in size/8k iterations. >>> >>> And this is how current implementation does >>> - allocate 'size' bytes >>> - allocate 'size' bytes of native memory for temp buffer in >>> IOUtil.read() >>> - read the whole file into temp buffer >>> - copy the temp buffer back into our buffer >>> >>> In common when fc.size() is right, we have 1 allocation and >>> copying >>> 'size' bytes from temp buffer back. >>> >>> So there is a difference in allocations/copying, but in my >>> opinion it's >>> not that significant for this particular task. >>> >>> Sincerely yours, >>> Ivan >>> >>> On 22.07.2013 20:03, roger riggs wrote: >>> >>> Hi Ivan, >>> >>> I'm concerned about the change in behavior for the >>> existing working >>> cases. >>> >>> How many times are the bytes copied in your proposed >>> implementation? >>> How many arrays are allocated and discarded? >>> Files.copy() uses an extra array for the copies. >>> >>> BAOS should only be used for size == 0; that would >>> address the issue >>> without changing the current behavior or allocations. >>> >>> Roger >>> >>> >>> >>> >>> On 7/20/2013 6:15 PM, Ivan Gerasimov wrote: >>> >>> Roger, David thanks for suggestions! >>> >>> Would you please take a look at an updated webrev? >>> http://cr.openjdk.java.net/~__igerasim/8020669/1/webrev/ >>> >>> >>> - File size is used as an initial size of BAOS's >>> buffer. >>> - BAOS avoids copying its buffer in toByteArray(), >>> if size is correct . >>> >>> I don't want to initialize BAOS with a positive >>> number if size >>> happened to be zero. >>> Because zero could indicate that the file is really >>> empty. >>> >>> Sincerely yours, >>> Ivan >>> >>> On 19.07.2013 22:30, David M. Lloyd wrote: >>> >>> My mistake, we're not talking about strings. >>> Still you can subclass >>> and determine whether the buffer size guess was >>> right, and if so >>> return the array as-is (swap in an empty array >>> or something as needed). >>> >>> On 07/19/2013 01:28 PM, David M. Lloyd wrote: >>> >>> It's trivial to subclass >>> ByteArrayOutputStream and add a method >>> which >>> converts its contents to a string using the >>> two protected fields which >>> give you all the info you need to do >>> so. So >>> no extra copy is needed >>> that you aren't already doing. >>> >>> On 07/19/2013 01:06 PM, roger riggs wrote: >>> >>> Hi Ivan, >>> >>> I think this change takes too big a hit >>> for the cases where the >>> size is >>> correct. >>> >>> No real file system can be wrong about >>> the size of a file so this >>> is a >>> problem >>> only for special file systems. If the >>> problem is with size >>> reporting zero >>> then maybe using the incremental read >>> only for size == would be a >>> better >>> fix. >>> >>> At least you could pass the size to the >>> constructor for BAOS and >>> avoid >>> the thrashing for every re-size; but >>> still it will allocate and >>> create >>> an extra copy >>> of the every time. >>> >>> $.02, Roger >>> >>> >>> On 7/19/2013 1:15 PM, Ivan Gerasimov >>> wrote: >>> >>> Hello everybody! >>> >>> Would you please review a fix for >>> the problem with >>> j.n.f.Files.readAllBytes() >>> function? >>> The current implementation >>> relies on >>> FileChannel.size() to >>> preallocate >>> a buffer for the whole file's >>> content. >>> However, some special filesystems >>> can report a wrong size. >>> An example is procfs under Linux, >>> which reports many files under >>> /proc >>> to be zero sized. >>> >>> Thus it is proposed not to rely on >>> the size() and instead >>> continuously >>> read until EOF. >>> >>> The downside is reallocation and >>> copying file content between >>> buffers. >>> But taking into account that the >>> doc >>> says: "It is not intended for >>> reading in large files." it should >>> not be a big problem. >>> >>> http://bugs.sun.com/view_bug.__do?bug_id=8020669 >>> >>> http://cr.openjdk.java.net/~__igerasim/8020669/0/webrev/ >>> >>> >>> The fix is for JDK8. If it is >>> approved, it can be applied to >>> JDK7 as >>> well. >>> >>> Sincerely yours, >>> Ivan Gerasimov >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >> >> > > > From ivan.gerasimov at oracle.com Wed Jul 24 22:19:12 2013 From: ivan.gerasimov at oracle.com (Ivan Gerasimov) Date: Thu, 25 Jul 2013 02:19:12 +0400 Subject: RFR [8020669] java.nio.file.Files.readAllBytes() does not read any data when Files.size() is 0 In-Reply-To: References: <51E97416.20506@oracle.com> <51E98043.6030102@oracle.com> <51E9853E.8020409@redhat.com> <51E985AD.60401@redhat.com> <51EB0BFF.3030106@oracle.com> <51ED57D8.90001@oracle.com> <51EE55AC.5000902@oracle.com> <51EE8E9A.6040806@redhat.com> <51EF1B43.9030200@oracle.com> Message-ID: <51F052E0.6090408@oracle.com> Hello Martin! On 24.07.2013 23:36, Martin Buchholz wrote: > Use javadoc style even in private methods. > s/Read/Reads/ > Use @param initialSize > /** > + * Read all the bytes from an input stream. The {@code initialSize} > + * parameter indicates the initial size of the byte[] to allocate. > + */ > --- Thanks, I'll correct that. > > This needs to be tested for an ordinary zero-length file. It looks > like for the zero case > + int newCapacity = capacity << 1; > will infloop not actually increasing the buffer. > > --- Well, no. First, reading empty file wouldn't go that far. The loop would break in the preceding line. if (n < 0 || source.read(b) < 0) break; And second, there is a check below for too small values of newCapacity: } else if (newCapacity < BUFFER_SIZE) { newCapacity = BUFFER_SIZE; } > > You might want to copy this technique from ArrayList et al: > > > /** > * The maximum size of array to allocate. > * Some VMs reserve some header words in an array. > * Attempts to allocate larger arrays may result in > * OutOfMemoryError: Requested array size exceeds VM limit > */ > private static final int MAX_ARRAY_SIZE = Integer.MAX_VALUE - 8; > Thanks, I'll do that too. One thing I was thinking about is that in a bad case, when we need several iterations (thus reallocations) to read the file, we would copy the starting bytes of the array over and over. Wouldn't it be better to keep a list of buffers and concatenate them only once at the end? What do you think, is it worth implementing that? Sincerely yours, Ivan > > > > On Tue, Jul 23, 2013 at 5:09 PM, Ivan Gerasimov > > wrote: > > Would you please take a look at the updated webrev? > http://cr.openjdk.java.net/~igerasim/8020669/2/webrev/ > > > readAllBytes() was recently (in b93) changed by Alan Bateman to > fix 8014928. > > Here's what I've done: > - reverted readAllBytes() to its implementation prior b93. > - modified it to address both 8020669 and 8014928. > > http://bugs.sun.com/view_bug.do?bug_id=8020669 > > http://bugs.sun.com/view_bug.do?bug_id=8014928 > > Sincerely yours, > Ivan > > > On 23.07.2013 18:09, David M. Lloyd wrote: > > Here's how it should behave: > > - allocate 'size' byte byte array > - if size > 0: > - use simple old I/O to read into the array > - do a one-byte read(), if not EOF then expand the array, > using a simple growth pattern like 3/2 (with a special case > for 0), and continue reading until EOF > - if the array matches the size of the file, return the array, > else use copyOf() to shrink it > > This way you only ever copy the array size() was wrong. > > On 07/23/2013 05:06 AM, Ivan Gerasimov wrote: > > Hi Roger! > > This is how my implementation behaves: > - allocate 'size' bytes in BAOS > - allocate 8k for temp buffer > - in cycle read 8k or less bytes from input stream and > copy them into BAOS > - if capacity of BAOS isn't sufficient (file had grown), > its buffer will > be reallocated > Thus, 1 reallocation and 1 copying of already read data on > each 8k piece > of additional bytes. > > In normal case, i.e. when fc.size() is correct, we have > overhead of 1 > allocation and copying 'size' bytes in size/8k iterations. > > And this is how current implementation does > - allocate 'size' bytes > - allocate 'size' bytes of native memory for temp buffer > in IOUtil.read() > - read the whole file into temp buffer > - copy the temp buffer back into our buffer > > In common when fc.size() is right, we have 1 allocation > and copying > 'size' bytes from temp buffer back. > > So there is a difference in allocations/copying, but in my > opinion it's > not that significant for this particular task. > > Sincerely yours, > Ivan > > On 22.07.2013 20:03, roger riggs wrote: > > Hi Ivan, > > I'm concerned about the change in behavior for the > existing working > cases. > > How many times are the bytes copied in your proposed > implementation? > How many arrays are allocated and discarded? > Files.copy() uses an extra array for the copies. > > BAOS should only be used for size == 0; that would > address the issue > without changing the current behavior or allocations. > > Roger > > > > > On 7/20/2013 6:15 PM, Ivan Gerasimov wrote: > > Roger, David thanks for suggestions! > > Would you please take a look at an updated webrev? > http://cr.openjdk.java.net/~igerasim/8020669/1/webrev/ > > > - File size is used as an initial size of BAOS's > buffer. > - BAOS avoids copying its buffer in toByteArray(), > if size is correct . > > I don't want to initialize BAOS with a positive > number if size > happened to be zero. > Because zero could indicate that the file is > really empty. > > Sincerely yours, > Ivan > > On 19.07.2013 22:30, David M. Lloyd wrote: > > My mistake, we're not talking about strings. > Still you can subclass > and determine whether the buffer size guess > was right, and if so > return the array as-is (swap in an empty array > or something as needed). > > On 07/19/2013 01:28 PM, David M. Lloyd wrote: > > It's trivial to subclass > ByteArrayOutputStream and add a method which > converts its contents to a string using > the two protected fields which > give you all the info you need to do so. > So no extra copy is needed > that you aren't already doing. > > On 07/19/2013 01:06 PM, roger riggs wrote: > > Hi Ivan, > > I think this change takes too big a > hit for the cases where the > size is > correct. > > No real file system can be wrong about > the size of a file so this > is a > problem > only for special file systems. If the > problem is with size > reporting zero > then maybe using the incremental read > only for size == would be a > better > fix. > > At least you could pass the size to > the constructor for BAOS and > avoid > the thrashing for every re-size; but > still it will allocate and > create > an extra copy > of the every time. > > $.02, Roger > > > On 7/19/2013 1:15 PM, Ivan Gerasimov > wrote: > > Hello everybody! > > Would you please review a fix for > the problem with > j.n.f.Files.readAllBytes() function? > The current implementation relies > on FileChannel.size() to > preallocate > a buffer for the whole file's content. > However, some special filesystems > can report a wrong size. > An example is procfs under Linux, > which reports many files under > /proc > to be zero sized. > > Thus it is proposed not to rely on > the size() and instead > continuously > read until EOF. > > The downside is reallocation and > copying file content between > buffers. > But taking into account that the > doc says: "It is not intended for > reading in large files." it should > not be a big problem. > > http://bugs.sun.com/view_bug.do?bug_id=8020669 > http://cr.openjdk.java.net/~igerasim/8020669/0/webrev/ > > > The fix is for JDK8. If it is > approved, it can be applied to JDK7 as > well. > > Sincerely yours, > Ivan Gerasimov > > > > > > > > > > > > > > > From martinrb at google.com Wed Jul 24 23:30:34 2013 From: martinrb at google.com (Martin Buchholz) Date: Wed, 24 Jul 2013 16:30:34 -0700 Subject: RFR : 6799426 : (xs) Add constructor PriorityQueue(Comparator) In-Reply-To: References: Message-ID: PriorityQueue is unusual in that Doug maintains a copy in jsr166 CVS even though it is a non-thread-safe collection. I think it makes sense, because PriorityQueue and PriorityBlockingQueue have parallel APIs and parallel implementations. Many changes to one file require a matching change to the other. Regarding this particular change, if PriorityQueue gets a new constructor taking a Comparator, then PriorityBlockingQueue probably should too (but I haven't looked at the patch in detail) On Mon, Jul 22, 2013 at 12:24 PM, Mike Duigou wrote: > Hello all; > > A simple rewiew for the addition of another constructor to PriorityQueue. > Currently if you wish to specify a Comparator you must also supply a size. > This addition allows use of the default size which is good for two reason; > you don't have to specify a fixed value and the implementation can change > it's default as appropriate. > > http://cr.openjdk.java.net/~mduigou/JDK-6799426/0/webrev/ > > Mike From ivan.gerasimov at oracle.com Wed Jul 24 23:47:21 2013 From: ivan.gerasimov at oracle.com (Ivan Gerasimov) Date: Thu, 25 Jul 2013 03:47:21 +0400 Subject: RFR [8020669] java.nio.file.Files.readAllBytes() does not read any data when Files.size() is 0 In-Reply-To: References: <51E97416.20506@oracle.com> <51E98043.6030102@oracle.com> <51E9853E.8020409@redhat.com> <51E985AD.60401@redhat.com> <51EB0BFF.3030106@oracle.com> <51ED57D8.90001@oracle.com> <51EE55AC.5000902@oracle.com> <51EE8E9A.6040806@redhat.com> <51EF1B43.9030200@oracle.com> Message-ID: <51F06789.1050403@oracle.com> Hello everybody! Would you please review an updated webrev? http://cr.openjdk.java.net/~igerasim/8020669/3/webrev/ Thanks in advance, Ivan On 24.07.2013 23:36, Martin Buchholz wrote: > Use javadoc style even in private methods. > s/Read/Reads/ > Use @param initialSize > /** > + * Read all the bytes from an input stream. The {@code initialSize} > + * parameter indicates the initial size of the byte[] to allocate. > + */ > --- > > This needs to be tested for an ordinary zero-length file. It looks > like for the zero case > + int newCapacity = capacity << 1; > will infloop not actually increasing the buffer. > > --- > > You might want to copy this technique from ArrayList et al: > > > /** > * The maximum size of array to allocate. > * Some VMs reserve some header words in an array. > * Attempts to allocate larger arrays may result in > * OutOfMemoryError: Requested array size exceeds VM limit > */ > private static final int MAX_ARRAY_SIZE = Integer.MAX_VALUE - 8; > > > > > On Tue, Jul 23, 2013 at 5:09 PM, Ivan Gerasimov > > wrote: > > Would you please take a look at the updated webrev? > http://cr.openjdk.java.net/~igerasim/8020669/2/webrev/ > > > readAllBytes() was recently (in b93) changed by Alan Bateman to > fix 8014928. > > Here's what I've done: > - reverted readAllBytes() to its implementation prior b93. > - modified it to address both 8020669 and 8014928. > > http://bugs.sun.com/view_bug.do?bug_id=8020669 > > http://bugs.sun.com/view_bug.do?bug_id=8014928 > > Sincerely yours, > Ivan > > > On 23.07.2013 18:09, David M. Lloyd wrote: > > Here's how it should behave: > > - allocate 'size' byte byte array > - if size > 0: > - use simple old I/O to read into the array > - do a one-byte read(), if not EOF then expand the array, > using a simple growth pattern like 3/2 (with a special case > for 0), and continue reading until EOF > - if the array matches the size of the file, return the array, > else use copyOf() to shrink it > > This way you only ever copy the array size() was wrong. > > On 07/23/2013 05:06 AM, Ivan Gerasimov wrote: > > Hi Roger! > > This is how my implementation behaves: > - allocate 'size' bytes in BAOS > - allocate 8k for temp buffer > - in cycle read 8k or less bytes from input stream and > copy them into BAOS > - if capacity of BAOS isn't sufficient (file had grown), > its buffer will > be reallocated > Thus, 1 reallocation and 1 copying of already read data on > each 8k piece > of additional bytes. > > In normal case, i.e. when fc.size() is correct, we have > overhead of 1 > allocation and copying 'size' bytes in size/8k iterations. > > And this is how current implementation does > - allocate 'size' bytes > - allocate 'size' bytes of native memory for temp buffer > in IOUtil.read() > - read the whole file into temp buffer > - copy the temp buffer back into our buffer > > In common when fc.size() is right, we have 1 allocation > and copying > 'size' bytes from temp buffer back. > > So there is a difference in allocations/copying, but in my > opinion it's > not that significant for this particular task. > > Sincerely yours, > Ivan > > On 22.07.2013 20:03, roger riggs wrote: > > Hi Ivan, > > I'm concerned about the change in behavior for the > existing working > cases. > > How many times are the bytes copied in your proposed > implementation? > How many arrays are allocated and discarded? > Files.copy() uses an extra array for the copies. > > BAOS should only be used for size == 0; that would > address the issue > without changing the current behavior or allocations. > > Roger > > > > > On 7/20/2013 6:15 PM, Ivan Gerasimov wrote: > > Roger, David thanks for suggestions! > > Would you please take a look at an updated webrev? > http://cr.openjdk.java.net/~igerasim/8020669/1/webrev/ > > > - File size is used as an initial size of BAOS's > buffer. > - BAOS avoids copying its buffer in toByteArray(), > if size is correct . > > I don't want to initialize BAOS with a positive > number if size > happened to be zero. > Because zero could indicate that the file is > really empty. > > Sincerely yours, > Ivan > > On 19.07.2013 22:30, David M. Lloyd wrote: > > My mistake, we're not talking about strings. > Still you can subclass > and determine whether the buffer size guess > was right, and if so > return the array as-is (swap in an empty array > or something as needed). > > On 07/19/2013 01:28 PM, David M. Lloyd wrote: > > It's trivial to subclass > ByteArrayOutputStream and add a method which > converts its contents to a string using > the two protected fields which > give you all the info you need to do so. > So no extra copy is needed > that you aren't already doing. > > On 07/19/2013 01:06 PM, roger riggs wrote: > > Hi Ivan, > > I think this change takes too big a > hit for the cases where the > size is > correct. > > No real file system can be wrong about > the size of a file so this > is a > problem > only for special file systems. If the > problem is with size > reporting zero > then maybe using the incremental read > only for size == would be a > better > fix. > > At least you could pass the size to > the constructor for BAOS and > avoid > the thrashing for every re-size; but > still it will allocate and > create > an extra copy > of the every time. > > $.02, Roger > > > On 7/19/2013 1:15 PM, Ivan Gerasimov > wrote: > > Hello everybody! > > Would you please review a fix for > the problem with > j.n.f.Files.readAllBytes() function? > The current implementation relies > on FileChannel.size() to > preallocate > a buffer for the whole file's content. > However, some special filesystems > can report a wrong size. > An example is procfs under Linux, > which reports many files under > /proc > to be zero sized. > > Thus it is proposed not to rely on > the size() and instead > continuously > read until EOF. > > The downside is reallocation and > copying file content between > buffers. > But taking into account that the > doc says: "It is not intended for > reading in large files." it should > not be a big problem. > > http://bugs.sun.com/view_bug.do?bug_id=8020669 > http://cr.openjdk.java.net/~igerasim/8020669/0/webrev/ > > > The fix is for JDK8. If it is > approved, it can be applied to JDK7 as > well. > > Sincerely yours, > Ivan Gerasimov > > > > > > > > > > > > > > > From brian.burkhalter at oracle.com Thu Jul 25 00:21:39 2013 From: brian.burkhalter at oracle.com (Brian Burkhalter) Date: Wed, 24 Jul 2013 17:21:39 -0700 Subject: Java 8 RFR 6378503: In java.math.BigDecimal, division by one returns zero Message-ID: <46EBFCD4-D336-4336-9D28-C8F2CAB9CB21@oracle.com> JDK 8 Reviewers: This review request concerns the issue http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6378503 for which the proposed webrev is http://cr.openjdk.java.net/~bpb/6378503/ The fix consists in preventing overflowing the int type in certain places. The added test case is equivalent to the one described in the issue report insofar as I can tell but is much less computationally expensive. Note that this patch follows that for 8020641 (approved [1]) which follows that for 8014319 (pending [2]). Thanks, Brian [1] http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-July/019017.html [2] http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-July/018922.html From jonathan.gibbons at oracle.com Thu Jul 25 00:36:13 2013 From: jonathan.gibbons at oracle.com (jonathan.gibbons at oracle.com) Date: Thu, 25 Jul 2013 00:36:13 +0000 Subject: hg: jdk8/tl/langtools: 8020556: doclint does not check type variables for @throws Message-ID: <20130725003619.3FE3D48339@hg.openjdk.java.net> Changeset: 2fbe77c38802 Author: jjg Date: 2013-07-24 17:35 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/2fbe77c38802 8020556: doclint does not check type variables for @throws Reviewed-by: mcimadamore ! src/share/classes/com/sun/source/util/DocTrees.java ! src/share/classes/com/sun/tools/doclint/Checker.java ! src/share/classes/com/sun/tools/javac/api/JavacTrees.java ! src/share/classes/com/sun/tools/javac/comp/Env.java ! test/tools/doclint/ReferenceTest.java From joe.darcy at oracle.com Thu Jul 25 04:01:45 2013 From: joe.darcy at oracle.com (Joe Darcy) Date: Wed, 24 Jul 2013 21:01:45 -0700 Subject: Java 8 RFR 6378503: In java.math.BigDecimal, division by one returns zero In-Reply-To: <46EBFCD4-D336-4336-9D28-C8F2CAB9CB21@oracle.com> References: <46EBFCD4-D336-4336-9D28-C8F2CAB9CB21@oracle.com> Message-ID: <51F0A329.9010802@oracle.com> Hi Brian, I took a look through the code and I don't see how sdiff == Integer.MIN_VALUE is handled. In any case, as long as the runtimes and memory usage are tractable, the set of test cases should be augmented to include sdiff == Integer.MIN_VALUE and (long)Integer.MIN_VALUE + 1, etc. Cheers, -Joe On 7/24/2013 5:21 PM, Brian Burkhalter wrote: > JDK 8 Reviewers: > > This review request concerns the issue > > http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6378503 > > for which the proposed webrev is > > http://cr.openjdk.java.net/~bpb/6378503/ > > The fix consists in preventing overflowing the int type in certain places. The added test case is equivalent to the one described in the issue report insofar as I can tell but is much less computationally expensive. > > Note that this patch follows that for 8020641 (approved [1]) which follows that for 8014319 (pending [2]). > > Thanks, > > Brian > > [1] http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-July/019017.html > [2] http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-July/018922.html From sundararajan.athijegannathan at oracle.com Thu Jul 25 04:45:09 2013 From: sundararajan.athijegannathan at oracle.com (sundararajan.athijegannathan at oracle.com) Date: Thu, 25 Jul 2013 04:45:09 +0000 Subject: hg: jdk8/tl/nashorn: 7 new changesets Message-ID: <20130725044516.6B74148346@hg.openjdk.java.net> Changeset: 8b97fe2b7c98 Author: attila Date: 2013-07-23 18:28 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/8b97fe2b7c98 8021129: Use public lookup again Reviewed-by: lagergren, sundar ! src/jdk/internal/dynalink/beans/AbstractJavaLinker.java ! src/jdk/internal/dynalink/beans/FacetIntrospector.java - src/jdk/internal/dynalink/beans/SafeUnreflector.java - src/jdk/internal/dynalink/beans/SafeUnreflectorImpl.java - src/jdk/internal/dynalink/beans/SandboxClassLoader.java - src/jdk/internal/dynalink/beans/sandbox/Unreflector.java + test/script/trusted/JDK-8021129.js + test/script/trusted/JDK-8021129.js.EXPECTED + test/src/jdk/nashorn/internal/test/models/InternalRunnable.java + test/src/jdk/nashorn/internal/test/models/RestrictedRunnable.java + test/src/jdk/nashorn/test/models/InternalRunnableSuperclass.java Changeset: a58a07a00122 Author: attila Date: 2013-07-24 11:13 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/a58a07a00122 8021189: Prevent access to constructors of restricted classes Reviewed-by: lagergren, sundar ! src/jdk/internal/dynalink/beans/AbstractJavaLinker.java ! src/jdk/internal/dynalink/beans/FacetIntrospector.java ! src/jdk/internal/dynalink/beans/StaticClassLinker.java ! test/script/trusted/JDK-8006529.js ! test/script/trusted/JDK-8021129.js + test/script/trusted/JDK-8021189.js + test/script/trusted/JDK-8021189.js.EXPECTED Changeset: e4efb3ce97b2 Author: attila Date: 2013-07-24 12:48 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/e4efb3ce97b2 8021246: Fix regression for 8021189 Reviewed-by: lagergren, sundar ! src/jdk/nashorn/internal/runtime/linker/JavaAdapterBytecodeGenerator.java ! test/script/trusted/JDK-8006529.js Changeset: 2a25917777f7 Author: hannesw Date: 2013-07-24 13:16 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/2a25917777f7 8020718: RETURN symbol has wrong type in split functions Reviewed-by: lagergren, attila ! src/jdk/nashorn/internal/codegen/CodeGenerator.java ! src/jdk/nashorn/internal/codegen/FinalizeTypes.java ! src/jdk/nashorn/internal/codegen/MethodEmitter.java ! src/jdk/nashorn/internal/codegen/SplitMethodEmitter.java ! src/jdk/nashorn/internal/ir/Block.java ! src/jdk/nashorn/internal/ir/FunctionNode.java ! src/jdk/nashorn/internal/ir/IdentNode.java ! src/jdk/nashorn/internal/ir/Symbol.java Changeset: 573cc6eb66ae Author: jlaskey Date: 2013-07-24 08:25 -0300 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/573cc6eb66ae Merge - src/jdk/internal/dynalink/beans/SafeUnreflector.java - src/jdk/internal/dynalink/beans/SafeUnreflectorImpl.java - src/jdk/internal/dynalink/beans/SandboxClassLoader.java - src/jdk/internal/dynalink/beans/sandbox/Unreflector.java Changeset: dc54df348a58 Author: sundar Date: 2013-07-24 20:28 +0530 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/dc54df348a58 8021262: Make nashorn access checks consistent with underlying dynalink Reviewed-by: jlaskey, lagergren, attila ! make/code_coverage.xml ! src/jdk/nashorn/internal/codegen/SpillObjectCreator.java ! src/jdk/nashorn/internal/objects/NativeDate.java ! src/jdk/nashorn/internal/objects/NativeObject.java ! src/jdk/nashorn/internal/runtime/Context.java ! src/jdk/nashorn/internal/runtime/NashornLoader.java ! src/jdk/nashorn/internal/runtime/PropertyMap.java ! src/jdk/nashorn/internal/runtime/ScriptObject.java ! src/jdk/nashorn/internal/runtime/ScriptRuntime.java ! src/jdk/nashorn/internal/runtime/Source.java ! src/jdk/nashorn/internal/runtime/linker/JavaAdapterBytecodeGenerator.java ! src/jdk/nashorn/internal/runtime/linker/JavaAdapterClassLoader.java ! src/jdk/nashorn/internal/runtime/linker/JavaAdapterFactory.java ! src/jdk/nashorn/internal/runtime/linker/LinkerCallSite.java ! src/jdk/nashorn/internal/runtime/linker/NashornBottomLinker.java ! src/jdk/nashorn/internal/runtime/linker/NashornStaticClassLinker.java ! src/jdk/nashorn/internal/runtime/linker/ReflectionCheckLinker.java ! test/script/sandbox/nashorninternals.js ! test/script/trusted/JDK-8006529.js ! test/script/trusted/JDK-8021129.js ! test/script/trusted/JDK-8021189.js ! test/script/trusted/JDK-8021189.js.EXPECTED ! test/src/jdk/nashorn/test/models/InternalRunnableSuperclass.java Changeset: d203d68f6624 Author: sundar Date: 2013-07-24 21:01 +0530 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/d203d68f6624 8021294: --verify-code option results in AnalyzerException Reviewed-by: hannesw, jlaskey ! src/jdk/nashorn/internal/runtime/Context.java From david.holmes at oracle.com Thu Jul 25 04:47:41 2013 From: david.holmes at oracle.com (David Holmes) Date: Thu, 25 Jul 2013 14:47:41 +1000 Subject: RFR: 8019948: java/util/logging/bundlesearch/ResourceBundleSearchTest.java is failing intermitently In-Reply-To: <51EFD1AD.9090205@oracle.com> References: <51EE8060.2060105@oracle.com> <51EFBF27.6000207@oracle.com> <51EFD1AD.9090205@oracle.com> Message-ID: <51F0ADED.40409@oracle.com> On 24/07/2013 11:07 PM, Daniel Fuchs wrote: > Hi David, > > On 7/24/13 1:48 PM, David Holmes wrote: >> On 23/07/2013 11:08 PM, Daniel Fuchs wrote: >>> Hi, >>> >>> Please find below a changeset for fixing >>> 8019948: java/util/logging/bundlesearch/ResourceBundleSearchTest.java is >>> failing intermittently [1] >>> >>> This appears to be a test bug due to a bizarre use of synchronization >>> in the test. The test was failing regularly before the fix (= often >>> enough), but I haven't managed to reproduce since I changed >>> lr.wait() into lr.join(); >> >> lr.join() is lr.wait() behind the scenes but with a check for isAlive(). >> So this suggests you have been getting spurious wakeups from lr.wait() - >> which is theoretically possible but extremely unlikely. If you have the >> cycles could you run the original code with this change: >> >> lr.wait(); >> + if (lr.isAlive()) throw new Error("Spurious wakeup!"); > > As far as I can tell the issue seems to be that the caller never > exit from its call to lr.wait(). > > I am thinking that maybe the thread is already finished when > lr.wait() is called - so that the caller would never wake up, > (it would have missed the notify()). Yes of course. Use of wait() must always be guarded by the condition that is being waited upon. Thanks, David > Increasing the load on the machine seemed to increase the chances of > triggering the issue - which seems a usual pattern with these race > conditions... > > best regards, > > -- daniel > > >> >> Thanks, >> David >> >>> http://cr.openjdk.java.net/~dfuchs/webrev_8019948/webrev.00/ >>> >>> best regards, >>> >>> -- daniel >>> >>> [1] https://jbs.oracle.com/bugs/browse/JDK-8019948 > From huizhe.wang at oracle.com Thu Jul 25 06:30:55 2013 From: huizhe.wang at oracle.com (huizhe wang) Date: Wed, 24 Jul 2013 23:30:55 -0700 Subject: RFR: JAXP in JDK8/7u40 : 8021148 Regression in SAXParserImpl in 7u40 b34 (NPE) In-Reply-To: <799C1DF4-E39B-4E7D-A346-A4AD96660180@oracle.com> References: <51EF3596.7010602@oracle.com> <51EF6D98.4030804@oracle.com> <51EF7B38.4080903@oracle.com> <51EF988E.3080304@oracle.com> <799C1DF4-E39B-4E7D-A346-A4AD96660180@oracle.com> Message-ID: <51F0C61F.7020306@oracle.com> I received test from the NetBeans team. The NetBeans did reference the internal JAXPSAXParser directly. This is not a usage supported by the spec. I would suggest them remove it and use the default parser instead. I'm asking the NetBeans team what are the features they rely on that the default parser couldn't provide. In the meantime, we're making this fix so that existing NetBeans continue to work properly when 7u40 is used. Here's an updated webrev (test included): http://cr.openjdk.java.net/~joehw/7u40/8021148/webrev/ Thanks, Joe On 7/24/2013 3:41 AM, Lance Andersen - Oracle wrote: > Agree with the change and making fSecurityPropertyMgr final > > Best > Lance > On Jul 24, 2013, at 5:04 AM, chris Hegarty wrote: > >> Joe, >> >> I can see in SAXParserImpl constructor, setFeature0 could throw, leaving the fSecurityPropertyMgr uninitialized. There my be other code paths too. >> >> I agree with this change, and Daniel's comments to make both fSecurityPropertyMgr fields final. Consider it reviewed ( at least on my side ). >> >> -Chris. >> >> On 24/07/2013 07:59, huizhe wang wrote: >>> On 7/23/2013 11:00 PM, Daniel Fuchs wrote: >>>> Hi Joe, >>>> >>>> This looks reasonable. >>>> Out of curiosity - could it be that it was fSAXParser that was null, >>>> and not fSecurityPropertyMgr? >>>> JAXPSAXParser has a no arg public constructor that could have lead to >>>> that... >>> That was my suspicion as well. I thought NetBeans was referencing the >>> internal class directly since the new JAXPSAXParser(this) inside >>> SAXParserImpl was the only call in the entire jaxp code. I was therefore >>> thinking it really should have been a private class. Of course, once >>> NetBeans bugzilla became accessible (it was down at the time), I was >>> able to get the error stacktrace. >>> >>> There is still something strange since XMLReaderManager.getXMLReader >>> calls XMLReaderFactory which should have returned SAXParser since it's >>> hardcoded default. In a manual test, I could only get a JAXPSAXParser if >>> I intentionally set "org.xml.sax.driver" to a "bogus parser". I'm asking >>> the NetBeans reporter and haven't heard from him yet. >>> >>>> I have only one remark: >>>> >>>> It looks as if fSecurityPropertyMgr could be declared final in both >>>> classes - and I think it >>>> would be better if it were: it would make it clear that it's never >>>> replaced in fSAXParser >>>> and that therefore your new code is strictly equivalent to the old in >>>> that respect. >>> Make sense. >>> >>> Thanks, >>> Joe >>> >>>> best regards, >>>> >>>> -- daniel >>>> >>>> On 7/24/13 4:01 AM, huizhe wang wrote: >>>>> Hi Lance, Chris, >>>>> >>>>> Looking at the affected class [1], and the error stack trace [2] , it >>>>> appeared that in SAXParserImpl$JAXPSAXParser , line 545, >>>>> fSAXParser.fSecurityPropertyMgr is null when setProperty is called. >>>>> fSecurityPropertyMgr was instantiated in SAXParserImpl's constructor >>>>> after JAXPSAXParser was. I can see a chance where the NetBeans got a >>>>> copy of JAXPSAXParser instance with fSecurityPropertyMgr not >>>>> initialized. The fix is to remove the reference of >>>>> fSecurityPropertyMgr in JAXPSAXParser, and pass it in when >>>>> JAXPSAXParser is created. >>>>> >>>>> Here is the webrev: >>>>> http://cr.openjdk.java.net/~joehw/7u40/8021148/webrev/ >>>>> >>>>> [1] >>>>> http://cr.openjdk.java.net/~joehw/7u40/8021148/webrev/src/com/sun/org/apache/xerces/internal/jaxp/SAXParserImpl.java.html >>>>> >>>>> [2] >>>>> >>>>> Caused by: java.lang.NullPointerException >>>>> at >>>>> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.access$300(SAXParserImpl.java:69) >>>>> >>>>> at >>>>> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.setProperty(SAXParserImpl.java:545) >>>>> >>>>> at >>>>> com.sun.org.apache.xml.internal.utils.XMLReaderManager.getXMLReader(XMLReaderManager.java:161) >>>>> >>>>> at >>>>> com.sun.org.apache.xml.internal.dtm.ref.DTMManagerDefault.getXMLReader(DTMManagerDefault.java:613) >>>>> >>>>> at >>>>> com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager.getDTM(XSLTCDTMManager.java:401) >>>>> >>>>> at >>>>> com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager.getDTM(XSLTCDTMManager.java:252) >>>>> >>>>> at >>>>> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.getDOM(TransformerImpl.java:559) >>>>> >>>>> ... 43 more >>>>> --------- >>>>> javax.xml.transform.TransformerException: java.lang.NullPointerException >>>>> at >>>>> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.getDOM(TransformerImpl.java:581) >>>>> >>>>> at >>>>> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:742) >>>>> >>>>> at >>>>> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:353) >>>>> >>>>> at >>>>> org.netbeans.spi.project.support.ant.GeneratedFilesHelper$1$1.run(GeneratedFilesHelper.java:332) >>>>> >>>>> >>>>> Thanks, >>>>> Joe >>>>> > > > Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 > Oracle Java Engineering > 1 Network Drive > Burlington, MA 01803 > Lance.Andersen at oracle.com > From joe.darcy at oracle.com Thu Jul 25 06:47:38 2013 From: joe.darcy at oracle.com (Joe Darcy) Date: Wed, 24 Jul 2013 23:47:38 -0700 Subject: RFR JDK 8 - Another round of doclint fixes in java.util.jar Message-ID: <51F0CA0A.3090609@oracle.com> Hello, Please review this change below to fix another small batch of doclint problem in java.util.jar. Thanks, -Joe diff -r fd1b5adcfdf0 src/share/classes/java/util/jar/Attributes.java --- a/src/share/classes/java/util/jar/Attributes.java Wed Jul 24 22:52:01 2013 +0100 +++ b/src/share/classes/java/util/jar/Attributes.java Wed Jul 24 23:46:52 2013 -0700 @@ -527,7 +527,7 @@ * Name object for Manifest-Version * manifest attribute. This attribute indicates the version number * of the manifest standard to which a JAR file's manifest conforms. - * @see + * @see * Manifest and Signature Specification */ public static final Name MANIFEST_VERSION = new Name("Manifest-Version"); @@ -535,7 +535,7 @@ /** * Name object for Signature-Version * manifest attribute used when signing JAR files. - * @see + * @see * Manifest and Signature Specification */ public static final Name SIGNATURE_VERSION = new Name("Signature-Version"); diff -r fd1b5adcfdf0 src/share/classes/java/util/jar/JarEntry.java --- a/src/share/classes/java/util/jar/JarEntry.java Wed Jul 24 22:52:01 2013 +0100 +++ b/src/share/classes/java/util/jar/JarEntry.java Wed Jul 24 23:46:52 2013 -0700 @@ -81,6 +81,7 @@ * * @return the Manifest Attributes for this * entry, or null if none + * @throws IOException if an I/O error has occurred */ public Attributes getAttributes() throws IOException { return attr; diff -r fd1b5adcfdf0 src/share/classes/java/util/jar/JarFile.java --- a/src/share/classes/java/util/jar/JarFile.java Wed Jul 24 22:52:01 2013 +0100 +++ b/src/share/classes/java/util/jar/JarFile.java Wed Jul 24 23:46:52 2013 -0700 @@ -168,6 +168,7 @@ * * @throws IllegalStateException * may be thrown if the jar file has been closed + * @throws IOException if an I/O error has occurred */ public Manifest getManifest() throws IOException { return getManifestFromReference(); From joe.darcy at oracle.com Thu Jul 25 06:58:41 2013 From: joe.darcy at oracle.com (Joe Darcy) Date: Wed, 24 Jul 2013 23:58:41 -0700 Subject: RFR JDK 8 java.util.stream doclint fix Message-ID: <51F0CCA1.4060607@oracle.com> Hello, Please review this minor doclint fix in java.util.stream. Thanks, -Joe --- a/src/share/classes/java/util/stream/StreamSupport.java Wed Jul 24 22:52:01 2013 +0100 +++ b/src/share/classes/java/util/stream/StreamSupport.java Wed Jul 24 23:57:19 2013 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -96,6 +96,7 @@ * Non-Interference for * more details. * + * @param the type of stream elements * @param supplier a {@code Supplier} of a {@code Spliterator} * @param characteristics Spliterator characteristics of the supplied * {@code Spliterator}. The characteristics must be equal to From david.holmes at oracle.com Thu Jul 25 07:09:15 2013 From: david.holmes at oracle.com (David Holmes) Date: Thu, 25 Jul 2013 17:09:15 +1000 Subject: RFR JDK 8 - Another round of doclint fixes in java.util.jar In-Reply-To: <51F0CA0A.3090609@oracle.com> References: <51F0CA0A.3090609@oracle.com> Message-ID: <51F0CF1B.3010701@oracle.com> On 25/07/2013 4:47 PM, Joe Darcy wrote: > Hello, > > Please review this change below to fix another small batch of doclint > problem in java.util.jar. > > Thanks, > > -Joe > > diff -r fd1b5adcfdf0 src/share/classes/java/util/jar/Attributes.java > --- a/src/share/classes/java/util/jar/Attributes.java Wed Jul 24 > 22:52:01 2013 +0100 > +++ b/src/share/classes/java/util/jar/Attributes.java Wed Jul 24 > 23:46:52 2013 -0700 > @@ -527,7 +527,7 @@ > * Name object for Manifest-Version > * manifest attribute. This attribute indicates the version > number > * of the manifest standard to which a JAR file's manifest > conforms. > - * @see > + * @see href="../../../../technotes/guides/jar/jar.html#JAR_Manifest"> > * Manifest and Signature Specification > */ I stared and stared at this but could not see a difference - trailing whitespace? David ----- > public static final Name MANIFEST_VERSION = new > Name("Manifest-Version"); > @@ -535,7 +535,7 @@ > /** > * Name object for Signature-Version > * manifest attribute used when signing JAR files. > - * @see > + * @see href="../../../../technotes/guides/jar/jar.html#JAR_Manifest"> > * Manifest and Signature Specification > */ > public static final Name SIGNATURE_VERSION = new > Name("Signature-Version"); > diff -r fd1b5adcfdf0 src/share/classes/java/util/jar/JarEntry.java > --- a/src/share/classes/java/util/jar/JarEntry.java Wed Jul 24 > 22:52:01 2013 +0100 > +++ b/src/share/classes/java/util/jar/JarEntry.java Wed Jul 24 > 23:46:52 2013 -0700 > @@ -81,6 +81,7 @@ > * > * @return the Manifest Attributes for this > * entry, or null if none > + * @throws IOException if an I/O error has occurred > */ > public Attributes getAttributes() throws IOException { > return attr; > diff -r fd1b5adcfdf0 src/share/classes/java/util/jar/JarFile.java > --- a/src/share/classes/java/util/jar/JarFile.java Wed Jul 24 > 22:52:01 2013 +0100 > +++ b/src/share/classes/java/util/jar/JarFile.java Wed Jul 24 > 23:46:52 2013 -0700 > @@ -168,6 +168,7 @@ > * > * @throws IllegalStateException > * may be thrown if the jar file has been closed > + * @throws IOException if an I/O error has occurred > */ > public Manifest getManifest() throws IOException { > return getManifestFromReference(); > From joe.darcy at oracle.com Thu Jul 25 07:11:41 2013 From: joe.darcy at oracle.com (Joe Darcy) Date: Thu, 25 Jul 2013 00:11:41 -0700 Subject: RFR JDK 8 - Another round of doclint fixes in java.util.jar In-Reply-To: <51F0CF1B.3010701@oracle.com> References: <51F0CA0A.3090609@oracle.com> <51F0CF1B.3010701@oracle.com> Message-ID: <51F0CFAD.6050008@oracle.com> On 07/25/2013 12:09 AM, David Holmes wrote: > On 25/07/2013 4:47 PM, Joe Darcy wrote: >> Hello, >> >> Please review this change below to fix another small batch of doclint >> problem in java.util.jar. >> >> Thanks, >> >> -Joe >> >> diff -r fd1b5adcfdf0 src/share/classes/java/util/jar/Attributes.java >> --- a/src/share/classes/java/util/jar/Attributes.java Wed Jul 24 >> 22:52:01 2013 +0100 >> +++ b/src/share/classes/java/util/jar/Attributes.java Wed Jul 24 >> 23:46:52 2013 -0700 >> @@ -527,7 +527,7 @@ >> * Name object for Manifest-Version >> * manifest attribute. This attribute indicates the version >> number >> * of the manifest standard to which a JAR file's manifest >> conforms. >> - * @see >> + * @see > href="../../../../technotes/guides/jar/jar.html#JAR_Manifest"> >> * Manifest and Signature Specification >> */ > > I stared and stared at this but could not see a difference - trailing > whitespace? Before ...#JAR-SPACE-Manifest after ...#JAR-UNDERSCORE-Manifest (Sorry for not pointing this subtle point out initially.) Thanks, -Joe From joe.darcy at oracle.com Thu Jul 25 07:13:28 2013 From: joe.darcy at oracle.com (Joe Darcy) Date: Thu, 25 Jul 2013 00:13:28 -0700 Subject: RFR JDK 8 - doclint fixes to java.io.Object{Input, Output}Stream Message-ID: <51F0D018.9080706@oracle.com> Hello, Please review the fix below to add @throws tags to constructors in java.io.Object{Input, Output}Stream. Thanks, -Joe diff -r fd1b5adcfdf0 src/share/classes/java/io/ObjectInputStream.java --- a/src/share/classes/java/io/ObjectInputStream.java Wed Jul 24 22:52:01 2013 +0100 +++ b/src/share/classes/java/io/ObjectInputStream.java Thu Jul 25 00:10:06 2013 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -313,6 +313,7 @@ * @throws SecurityException if a security manager exists and its * checkPermission method denies enabling * subclassing. + * @throws IOException if an I/O error occurs while creating this stream * @see SecurityManager#checkPermission * @see java.io.SerializablePermission */ diff -r fd1b5adcfdf0 src/share/classes/java/io/ObjectOutputStream.java --- a/src/share/classes/java/io/ObjectOutputStream.java Wed Jul 24 22:52:01 2013 +0100 +++ b/src/share/classes/java/io/ObjectOutputStream.java Thu Jul 25 00:10:06 2013 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -265,6 +265,7 @@ * @throws SecurityException if a security manager exists and its * checkPermission method denies enabling * subclassing. + * @throws IOException if an I/O error occurs while creating this stream * @see SecurityManager#checkPermission * @see java.io.SerializablePermission */ From david.holmes at oracle.com Thu Jul 25 07:20:28 2013 From: david.holmes at oracle.com (David Holmes) Date: Thu, 25 Jul 2013 17:20:28 +1000 Subject: RFR JDK 8 - Another round of doclint fixes in java.util.jar In-Reply-To: <51F0CFAD.6050008@oracle.com> References: <51F0CA0A.3090609@oracle.com> <51F0CF1B.3010701@oracle.com> <51F0CFAD.6050008@oracle.com> Message-ID: <51F0D1BC.104@oracle.com> Thanks - looks good to me (if you can trust that I was actually able to read it ;-) ) David On 25/07/2013 5:11 PM, Joe Darcy wrote: > On 07/25/2013 12:09 AM, David Holmes wrote: >> On 25/07/2013 4:47 PM, Joe Darcy wrote: >>> Hello, >>> >>> Please review this change below to fix another small batch of doclint >>> problem in java.util.jar. >>> >>> Thanks, >>> >>> -Joe >>> >>> diff -r fd1b5adcfdf0 src/share/classes/java/util/jar/Attributes.java >>> --- a/src/share/classes/java/util/jar/Attributes.java Wed Jul 24 >>> 22:52:01 2013 +0100 >>> +++ b/src/share/classes/java/util/jar/Attributes.java Wed Jul 24 >>> 23:46:52 2013 -0700 >>> @@ -527,7 +527,7 @@ >>> * Name object for Manifest-Version >>> * manifest attribute. This attribute indicates the version >>> number >>> * of the manifest standard to which a JAR file's manifest >>> conforms. >>> - * @see >>> + * @see >> href="../../../../technotes/guides/jar/jar.html#JAR_Manifest"> >>> * Manifest and Signature Specification >>> */ >> >> I stared and stared at this but could not see a difference - trailing >> whitespace? > > Before > > ...#JAR-SPACE-Manifest > > after > > ...#JAR-UNDERSCORE-Manifest > > (Sorry for not pointing this subtle point out initially.) > > Thanks, > > -Joe From david.holmes at oracle.com Thu Jul 25 07:33:45 2013 From: david.holmes at oracle.com (David Holmes) Date: Thu, 25 Jul 2013 17:33:45 +1000 Subject: RFR JDK 8 java.util.stream doclint fix In-Reply-To: <51F0CCA1.4060607@oracle.com> References: <51F0CCA1.4060607@oracle.com> Message-ID: <51F0D4D9.7050807@oracle.com> Looks good. :) David On 25/07/2013 4:58 PM, Joe Darcy wrote: > Hello, > > Please review this minor doclint fix in java.util.stream. > > Thanks, > > -Joe > > --- a/src/share/classes/java/util/stream/StreamSupport.java Wed Jul > 24 22:52:01 2013 +0100 > +++ b/src/share/classes/java/util/stream/StreamSupport.java Wed Jul > 24 23:57:19 2013 -0700 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. > + * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights > reserved. > * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. > * > * This code is free software; you can redistribute it and/or modify it > @@ -96,6 +96,7 @@ > * href="package-summary.html#Non-Interference">Non-Interference for > * more details. > * > + * @param the type of stream elements > * @param supplier a {@code Supplier} of a {@code Spliterator} > * @param characteristics Spliterator characteristics of the supplied > * {@code Spliterator}. The characteristics must be equal to > From david.holmes at oracle.com Thu Jul 25 07:36:01 2013 From: david.holmes at oracle.com (David Holmes) Date: Thu, 25 Jul 2013 17:36:01 +1000 Subject: RFR JDK 8 - doclint fixes to java.io.Object{Input, Output}Stream In-Reply-To: <51F0D018.9080706@oracle.com> References: <51F0D018.9080706@oracle.com> Message-ID: <51F0D561.6060103@oracle.com> Looks good. David On 25/07/2013 5:13 PM, Joe Darcy wrote: > Hello, > > Please review the fix below to add @throws tags to constructors in > java.io.Object{Input, Output}Stream. > > Thanks, > > -Joe > > diff -r fd1b5adcfdf0 src/share/classes/java/io/ObjectInputStream.java > --- a/src/share/classes/java/io/ObjectInputStream.java Wed Jul 24 > 22:52:01 2013 +0100 > +++ b/src/share/classes/java/io/ObjectInputStream.java Thu Jul 25 > 00:10:06 2013 -0700 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights > reserved. > + * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights > reserved. > * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. > * > * This code is free software; you can redistribute it and/or modify it > @@ -313,6 +313,7 @@ > * @throws SecurityException if a security manager exists and its > * checkPermission method denies enabling > * subclassing. > + * @throws IOException if an I/O error occurs while creating this > stream > * @see SecurityManager#checkPermission > * @see java.io.SerializablePermission > */ > diff -r fd1b5adcfdf0 src/share/classes/java/io/ObjectOutputStream.java > --- a/src/share/classes/java/io/ObjectOutputStream.java Wed Jul 24 > 22:52:01 2013 +0100 > +++ b/src/share/classes/java/io/ObjectOutputStream.java Thu Jul 25 > 00:10:06 2013 -0700 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 1996, 2012, Oracle and/or its affiliates. All rights > reserved. > + * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights > reserved. > * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. > * > * This code is free software; you can redistribute it and/or modify it > @@ -265,6 +265,7 @@ > * @throws SecurityException if a security manager exists and its > * checkPermission method denies enabling > * subclassing. > + * @throws IOException if an I/O error occurs while creating this > stream > * @see SecurityManager#checkPermission > * @see java.io.SerializablePermission > */ > From rieberandreas at gmail.com Thu Jul 25 07:36:17 2013 From: rieberandreas at gmail.com (Andreas Rieber) Date: Thu, 25 Jul 2013 09:36:17 +0200 Subject: RFR JDK 8 - Another round of doclint fixes in java.util.jar In-Reply-To: <51F0CFAD.6050008@oracle.com> References: <51F0CA0A.3090609@oracle.com> <51F0CF1B.3010701@oracle.com> <51F0CFAD.6050008@oracle.com> Message-ID: <51F0D571.5040805@gmail.com> minor one, the year in header needs also update ;-) On 25.07.13 09:11, Joe Darcy wrote: > On 07/25/2013 12:09 AM, David Holmes wrote: >> On 25/07/2013 4:47 PM, Joe Darcy wrote: >>> Hello, >>> >>> Please review this change below to fix another small batch of doclint >>> problem in java.util.jar. >>> >>> Thanks, >>> >>> -Joe >>> >>> diff -r fd1b5adcfdf0 src/share/classes/java/util/jar/Attributes.java >>> --- a/src/share/classes/java/util/jar/Attributes.java Wed Jul 24 >>> 22:52:01 2013 +0100 >>> +++ b/src/share/classes/java/util/jar/Attributes.java Wed Jul 24 >>> 23:46:52 2013 -0700 >>> @@ -527,7 +527,7 @@ >>> * Name object for Manifest-Version >>> * manifest attribute. This attribute indicates the version >>> number >>> * of the manifest standard to which a JAR file's manifest >>> conforms. >>> - * @see >>> + * @see >> href="../../../../technotes/guides/jar/jar.html#JAR_Manifest"> >>> * Manifest and Signature Specification >>> */ >> >> I stared and stared at this but could not see a difference - trailing >> whitespace? > > Before > > ...#JAR-SPACE-Manifest > > after > > ...#JAR-UNDERSCORE-Manifest > > (Sorry for not pointing this subtle point out initially.) > > Thanks, > > -Joe From daniel.fuchs at oracle.com Thu Jul 25 07:39:47 2013 From: daniel.fuchs at oracle.com (Daniel Fuchs) Date: Thu, 25 Jul 2013 09:39:47 +0200 Subject: RFR: JAXP in JDK8/7u40 : 8021148 Regression in SAXParserImpl in 7u40 b34 (NPE) In-Reply-To: <51F0C61F.7020306@oracle.com> References: <51EF3596.7010602@oracle.com> <51EF6D98.4030804@oracle.com> <51EF7B38.4080903@oracle.com> <51EF988E.3080304@oracle.com> <799C1DF4-E39B-4E7D-A346-A4AD96660180@oracle.com> <51F0C61F.7020306@oracle.com> Message-ID: <51F0D643.6060004@oracle.com> Hi Joe, Looks good. Small nit: you could keep fSecurityPropertyManager final by using: if (spm != null) { fSecurityPropertyManager = spm; } else { fSecurityPropertyManager = new ... ... } Don't feel obliged to do it though - your fix is good as it is. best regards, -- daniel On 7/25/13 8:30 AM, huizhe wang wrote: > I received test from the NetBeans team. The NetBeans did reference the > internal JAXPSAXParser directly. This is not a usage supported by the > spec. I would suggest them remove it and use the default parser > instead. I'm asking the NetBeans team what are the features they rely > on that the default parser couldn't provide. In the meantime, we're > making this fix so that existing NetBeans continue to work properly > when 7u40 is used. > > Here's an updated webrev (test included): > http://cr.openjdk.java.net/~joehw/7u40/8021148/webrev/ > > Thanks, > Joe > > On 7/24/2013 3:41 AM, Lance Andersen - Oracle wrote: >> Agree with the change and making fSecurityPropertyMgr final >> >> Best >> Lance >> On Jul 24, 2013, at 5:04 AM, chris Hegarty wrote: >> >>> Joe, >>> >>> I can see in SAXParserImpl constructor, setFeature0 could throw, >>> leaving the fSecurityPropertyMgr uninitialized. There my be other >>> code paths too. >>> >>> I agree with this change, and Daniel's comments to make both >>> fSecurityPropertyMgr fields final. Consider it reviewed ( at least >>> on my side ). >>> >>> -Chris. >>> >>> On 24/07/2013 07:59, huizhe wang wrote: >>>> On 7/23/2013 11:00 PM, Daniel Fuchs wrote: >>>>> Hi Joe, >>>>> >>>>> This looks reasonable. >>>>> Out of curiosity - could it be that it was fSAXParser that was null, >>>>> and not fSecurityPropertyMgr? >>>>> JAXPSAXParser has a no arg public constructor that could have lead to >>>>> that... >>>> That was my suspicion as well. I thought NetBeans was referencing the >>>> internal class directly since the new JAXPSAXParser(this) inside >>>> SAXParserImpl was the only call in the entire jaxp code. I was >>>> therefore >>>> thinking it really should have been a private class. Of course, once >>>> NetBeans bugzilla became accessible (it was down at the time), I was >>>> able to get the error stacktrace. >>>> >>>> There is still something strange since XMLReaderManager.getXMLReader >>>> calls XMLReaderFactory which should have returned SAXParser since it's >>>> hardcoded default. In a manual test, I could only get a >>>> JAXPSAXParser if >>>> I intentionally set "org.xml.sax.driver" to a "bogus parser". I'm >>>> asking >>>> the NetBeans reporter and haven't heard from him yet. >>>> >>>>> I have only one remark: >>>>> >>>>> It looks as if fSecurityPropertyMgr could be declared final in both >>>>> classes - and I think it >>>>> would be better if it were: it would make it clear that it's never >>>>> replaced in fSAXParser >>>>> and that therefore your new code is strictly equivalent to the old in >>>>> that respect. >>>> Make sense. >>>> >>>> Thanks, >>>> Joe >>>> >>>>> best regards, >>>>> >>>>> -- daniel >>>>> >>>>> On 7/24/13 4:01 AM, huizhe wang wrote: >>>>>> Hi Lance, Chris, >>>>>> >>>>>> Looking at the affected class [1], and the error stack trace [2] >>>>>> , it >>>>>> appeared that in SAXParserImpl$JAXPSAXParser , line 545, >>>>>> fSAXParser.fSecurityPropertyMgr is null when setProperty is called. >>>>>> fSecurityPropertyMgr was instantiated in SAXParserImpl's constructor >>>>>> after JAXPSAXParser was. I can see a chance where the NetBeans got a >>>>>> copy of JAXPSAXParser instance with fSecurityPropertyMgr not >>>>>> initialized. The fix is to remove the reference of >>>>>> fSecurityPropertyMgr in JAXPSAXParser, and pass it in when >>>>>> JAXPSAXParser is created. >>>>>> >>>>>> Here is the webrev: >>>>>> http://cr.openjdk.java.net/~joehw/7u40/8021148/webrev/ >>>>>> >>>>>> [1] >>>>>> http://cr.openjdk.java.net/~joehw/7u40/8021148/webrev/src/com/sun/org/apache/xerces/internal/jaxp/SAXParserImpl.java.html >>>>>> >>>>>> >>>>>> [2] >>>>>> >>>>>> Caused by: java.lang.NullPointerException >>>>>> at >>>>>> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.access$300(SAXParserImpl.java:69) >>>>>> >>>>>> >>>>>> at >>>>>> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.setProperty(SAXParserImpl.java:545) >>>>>> >>>>>> >>>>>> at >>>>>> com.sun.org.apache.xml.internal.utils.XMLReaderManager.getXMLReader(XMLReaderManager.java:161) >>>>>> >>>>>> >>>>>> at >>>>>> com.sun.org.apache.xml.internal.dtm.ref.DTMManagerDefault.getXMLReader(DTMManagerDefault.java:613) >>>>>> >>>>>> >>>>>> at >>>>>> com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager.getDTM(XSLTCDTMManager.java:401) >>>>>> >>>>>> >>>>>> at >>>>>> com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager.getDTM(XSLTCDTMManager.java:252) >>>>>> >>>>>> >>>>>> at >>>>>> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.getDOM(TransformerImpl.java:559) >>>>>> >>>>>> >>>>>> ... 43 more >>>>>> --------- >>>>>> javax.xml.transform.TransformerException: >>>>>> java.lang.NullPointerException >>>>>> at >>>>>> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.getDOM(TransformerImpl.java:581) >>>>>> >>>>>> >>>>>> at >>>>>> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:742) >>>>>> >>>>>> >>>>>> at >>>>>> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:353) >>>>>> >>>>>> >>>>>> at >>>>>> org.netbeans.spi.project.support.ant.GeneratedFilesHelper$1$1.run(GeneratedFilesHelper.java:332) >>>>>> >>>>>> >>>>>> >>>>>> Thanks, >>>>>> Joe >>>>>> >> >> >> Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 >> Oracle Java Engineering >> 1 Network Drive >> Burlington, MA 01803 >> Lance.Andersen at oracle.com >> > From huizhe.wang at oracle.com Thu Jul 25 07:54:12 2013 From: huizhe.wang at oracle.com (huizhe wang) Date: Thu, 25 Jul 2013 00:54:12 -0700 Subject: RFR: JAXP in JDK8/7u40 : 8021148 Regression in SAXParserImpl in 7u40 b34 (NPE) In-Reply-To: <51F0D643.6060004@oracle.com> References: <51EF3596.7010602@oracle.com> <51EF6D98.4030804@oracle.com> <51EF7B38.4080903@oracle.com> <51EF988E.3080304@oracle.com> <799C1DF4-E39B-4E7D-A346-A4AD96660180@oracle.com> <51F0C61F.7020306@oracle.com> <51F0D643.6060004@oracle.com> Message-ID: <51F0D9A4.8020000@oracle.com> Thanks for the quick review and the tip. I've started a build and am still trying to fix some test issues on the other patch. So for now I'll keep it that way. -Joe On 7/25/2013 12:39 AM, Daniel Fuchs wrote: > Hi Joe, > > Looks good. > > Small nit: you could keep fSecurityPropertyManager final by using: > > if (spm != null) { > fSecurityPropertyManager = spm; > } else { > fSecurityPropertyManager = new ... > ... > } > > Don't feel obliged to do it though - your fix is good as it is. > > best regards, > > -- daniel > > On 7/25/13 8:30 AM, huizhe wang wrote: >> I received test from the NetBeans team. The NetBeans did reference >> the internal JAXPSAXParser directly. This is not a usage supported by >> the spec. I would suggest them remove it and use the default parser >> instead. I'm asking the NetBeans team what are the features they rely >> on that the default parser couldn't provide. In the meantime, we're >> making this fix so that existing NetBeans continue to work properly >> when 7u40 is used. >> >> Here's an updated webrev (test included): >> http://cr.openjdk.java.net/~joehw/7u40/8021148/webrev/ >> >> Thanks, >> Joe >> >> On 7/24/2013 3:41 AM, Lance Andersen - Oracle wrote: >>> Agree with the change and making fSecurityPropertyMgr final >>> >>> Best >>> Lance >>> On Jul 24, 2013, at 5:04 AM, chris Hegarty wrote: >>> >>>> Joe, >>>> >>>> I can see in SAXParserImpl constructor, setFeature0 could throw, >>>> leaving the fSecurityPropertyMgr uninitialized. There my be other >>>> code paths too. >>>> >>>> I agree with this change, and Daniel's comments to make both >>>> fSecurityPropertyMgr fields final. Consider it reviewed ( at least >>>> on my side ). >>>> >>>> -Chris. >>>> >>>> On 24/07/2013 07:59, huizhe wang wrote: >>>>> On 7/23/2013 11:00 PM, Daniel Fuchs wrote: >>>>>> Hi Joe, >>>>>> >>>>>> This looks reasonable. >>>>>> Out of curiosity - could it be that it was fSAXParser that was null, >>>>>> and not fSecurityPropertyMgr? >>>>>> JAXPSAXParser has a no arg public constructor that could have >>>>>> lead to >>>>>> that... >>>>> That was my suspicion as well. I thought NetBeans was referencing the >>>>> internal class directly since the new JAXPSAXParser(this) inside >>>>> SAXParserImpl was the only call in the entire jaxp code. I was >>>>> therefore >>>>> thinking it really should have been a private class. Of course, once >>>>> NetBeans bugzilla became accessible (it was down at the time), I was >>>>> able to get the error stacktrace. >>>>> >>>>> There is still something strange since XMLReaderManager.getXMLReader >>>>> calls XMLReaderFactory which should have returned SAXParser since >>>>> it's >>>>> hardcoded default. In a manual test, I could only get a >>>>> JAXPSAXParser if >>>>> I intentionally set "org.xml.sax.driver" to a "bogus parser". I'm >>>>> asking >>>>> the NetBeans reporter and haven't heard from him yet. >>>>> >>>>>> I have only one remark: >>>>>> >>>>>> It looks as if fSecurityPropertyMgr could be declared final in both >>>>>> classes - and I think it >>>>>> would be better if it were: it would make it clear that it's never >>>>>> replaced in fSAXParser >>>>>> and that therefore your new code is strictly equivalent to the >>>>>> old in >>>>>> that respect. >>>>> Make sense. >>>>> >>>>> Thanks, >>>>> Joe >>>>> >>>>>> best regards, >>>>>> >>>>>> -- daniel >>>>>> >>>>>> On 7/24/13 4:01 AM, huizhe wang wrote: >>>>>>> Hi Lance, Chris, >>>>>>> >>>>>>> Looking at the affected class [1], and the error stack trace [2] >>>>>>> , it >>>>>>> appeared that in SAXParserImpl$JAXPSAXParser , line 545, >>>>>>> fSAXParser.fSecurityPropertyMgr is null when setProperty is called. >>>>>>> fSecurityPropertyMgr was instantiated in SAXParserImpl's >>>>>>> constructor >>>>>>> after JAXPSAXParser was. I can see a chance where the NetBeans >>>>>>> got a >>>>>>> copy of JAXPSAXParser instance with fSecurityPropertyMgr not >>>>>>> initialized. The fix is to remove the reference of >>>>>>> fSecurityPropertyMgr in JAXPSAXParser, and pass it in when >>>>>>> JAXPSAXParser is created. >>>>>>> >>>>>>> Here is the webrev: >>>>>>> http://cr.openjdk.java.net/~joehw/7u40/8021148/webrev/ >>>>>>> >>>>>>> [1] >>>>>>> http://cr.openjdk.java.net/~joehw/7u40/8021148/webrev/src/com/sun/org/apache/xerces/internal/jaxp/SAXParserImpl.java.html >>>>>>> >>>>>>> >>>>>>> [2] >>>>>>> >>>>>>> Caused by: java.lang.NullPointerException >>>>>>> at >>>>>>> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.access$300(SAXParserImpl.java:69) >>>>>>> >>>>>>> >>>>>>> at >>>>>>> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.setProperty(SAXParserImpl.java:545) >>>>>>> >>>>>>> >>>>>>> at >>>>>>> com.sun.org.apache.xml.internal.utils.XMLReaderManager.getXMLReader(XMLReaderManager.java:161) >>>>>>> >>>>>>> >>>>>>> at >>>>>>> com.sun.org.apache.xml.internal.dtm.ref.DTMManagerDefault.getXMLReader(DTMManagerDefault.java:613) >>>>>>> >>>>>>> >>>>>>> at >>>>>>> com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager.getDTM(XSLTCDTMManager.java:401) >>>>>>> >>>>>>> >>>>>>> at >>>>>>> com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager.getDTM(XSLTCDTMManager.java:252) >>>>>>> >>>>>>> >>>>>>> at >>>>>>> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.getDOM(TransformerImpl.java:559) >>>>>>> >>>>>>> >>>>>>> ... 43 more >>>>>>> --------- >>>>>>> javax.xml.transform.TransformerException: >>>>>>> java.lang.NullPointerException >>>>>>> at >>>>>>> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.getDOM(TransformerImpl.java:581) >>>>>>> >>>>>>> >>>>>>> at >>>>>>> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:742) >>>>>>> >>>>>>> >>>>>>> at >>>>>>> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:353) >>>>>>> >>>>>>> >>>>>>> at >>>>>>> org.netbeans.spi.project.support.ant.GeneratedFilesHelper$1$1.run(GeneratedFilesHelper.java:332) >>>>>>> >>>>>>> >>>>>>> >>>>>>> Thanks, >>>>>>> Joe >>>>>>> >>> >>> >>> Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 >>> Oracle Java Engineering >>> 1 Network Drive >>> Burlington, MA 01803 >>> Lance.Andersen at oracle.com >>> >> > From paul.sandoz at Oracle.COM Thu Jul 25 07:56:40 2013 From: paul.sandoz at Oracle.COM (Paul Sandoz) Date: Thu, 25 Jul 2013 08:56:40 +0100 Subject: RFR JDK 8 java.util.stream doclint fix In-Reply-To: <51F0CCA1.4060607@oracle.com> References: <51F0CCA1.4060607@oracle.com> Message-ID: <92285051-929B-4CBD-9898-E906F04E11D8@Oracle.COM> Hi Joe, Looks good. Paul. On Jul 25, 2013, at 7:58 AM, Joe Darcy wrote: > Hello, > > Please review this minor doclint fix in java.util.stream. > > Thanks, > > -Joe > > --- a/src/share/classes/java/util/stream/StreamSupport.java Wed Jul 24 22:52:01 2013 +0100 > +++ b/src/share/classes/java/util/stream/StreamSupport.java Wed Jul 24 23:57:19 2013 -0700 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. > + * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. > * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. > * > * This code is free software; you can redistribute it and/or modify it > @@ -96,6 +96,7 @@ > * Non-Interference for > * more details. > * > + * @param the type of stream elements > * @param supplier a {@code Supplier} of a {@code Spliterator} > * @param characteristics Spliterator characteristics of the supplied > * {@code Spliterator}. The characteristics must be equal to > From chris.hegarty at oracle.com Thu Jul 25 08:06:47 2013 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Thu, 25 Jul 2013 09:06:47 +0100 Subject: RFR: JAXP in JDK8/7u40 : 8021148 Regression in SAXParserImpl in 7u40 b34 (NPE) In-Reply-To: <51F0D643.6060004@oracle.com> References: <51EF3596.7010602@oracle.com> <51EF6D98.4030804@oracle.com> <51EF7B38.4080903@oracle.com> <51EF988E.3080304@oracle.com> <799C1DF4-E39B-4E7D-A346-A4AD96660180@oracle.com> <51F0C61F.7020306@oracle.com> <51F0D643.6060004@oracle.com> Message-ID: <51F0DC97.5010000@oracle.com> On 07/25/2013 08:39 AM, Daniel Fuchs wrote: > Hi Joe, > > Looks good. +1 > > Small nit: you could keep fSecurityPropertyManager final by using: > > if (spm != null) { > fSecurityPropertyManager = spm; > } else { > fSecurityPropertyManager = new ... > ... > } > > Don't feel obliged to do it though - your fix is good as it is. +1 Additionally, and don't feel obliged either, the (fSecurityPropertyMgr != null) is no longer needed, since this can never be the case. Though I do understand that you may not want to take any chances ;-) For JDK8, in the future, I think you should remove this constructor. NetBeans can do the right thing to support a new major release. -Chris. > > best regards, > > -- daniel > > On 7/25/13 8:30 AM, huizhe wang wrote: >> I received test from the NetBeans team. The NetBeans did reference the >> internal JAXPSAXParser directly. This is not a usage supported by the >> spec. I would suggest them remove it and use the default parser >> instead. I'm asking the NetBeans team what are the features they rely >> on that the default parser couldn't provide. In the meantime, we're >> making this fix so that existing NetBeans continue to work properly >> when 7u40 is used. >> >> Here's an updated webrev (test included): >> http://cr.openjdk.java.net/~joehw/7u40/8021148/webrev/ >> >> Thanks, >> Joe >> >> On 7/24/2013 3:41 AM, Lance Andersen - Oracle wrote: >>> Agree with the change and making fSecurityPropertyMgr final >>> >>> Best >>> Lance >>> On Jul 24, 2013, at 5:04 AM, chris Hegarty wrote: >>> >>>> Joe, >>>> >>>> I can see in SAXParserImpl constructor, setFeature0 could throw, >>>> leaving the fSecurityPropertyMgr uninitialized. There my be other >>>> code paths too. >>>> >>>> I agree with this change, and Daniel's comments to make both >>>> fSecurityPropertyMgr fields final. Consider it reviewed ( at least >>>> on my side ). >>>> >>>> -Chris. >>>> >>>> On 24/07/2013 07:59, huizhe wang wrote: >>>>> On 7/23/2013 11:00 PM, Daniel Fuchs wrote: >>>>>> Hi Joe, >>>>>> >>>>>> This looks reasonable. >>>>>> Out of curiosity - could it be that it was fSAXParser that was null, >>>>>> and not fSecurityPropertyMgr? >>>>>> JAXPSAXParser has a no arg public constructor that could have lead to >>>>>> that... >>>>> That was my suspicion as well. I thought NetBeans was referencing the >>>>> internal class directly since the new JAXPSAXParser(this) inside >>>>> SAXParserImpl was the only call in the entire jaxp code. I was >>>>> therefore >>>>> thinking it really should have been a private class. Of course, once >>>>> NetBeans bugzilla became accessible (it was down at the time), I was >>>>> able to get the error stacktrace. >>>>> >>>>> There is still something strange since XMLReaderManager.getXMLReader >>>>> calls XMLReaderFactory which should have returned SAXParser since it's >>>>> hardcoded default. In a manual test, I could only get a >>>>> JAXPSAXParser if >>>>> I intentionally set "org.xml.sax.driver" to a "bogus parser". I'm >>>>> asking >>>>> the NetBeans reporter and haven't heard from him yet. >>>>> >>>>>> I have only one remark: >>>>>> >>>>>> It looks as if fSecurityPropertyMgr could be declared final in both >>>>>> classes - and I think it >>>>>> would be better if it were: it would make it clear that it's never >>>>>> replaced in fSAXParser >>>>>> and that therefore your new code is strictly equivalent to the old in >>>>>> that respect. >>>>> Make sense. >>>>> >>>>> Thanks, >>>>> Joe >>>>> >>>>>> best regards, >>>>>> >>>>>> -- daniel >>>>>> >>>>>> On 7/24/13 4:01 AM, huizhe wang wrote: >>>>>>> Hi Lance, Chris, >>>>>>> >>>>>>> Looking at the affected class [1], and the error stack trace [2] >>>>>>> , it >>>>>>> appeared that in SAXParserImpl$JAXPSAXParser , line 545, >>>>>>> fSAXParser.fSecurityPropertyMgr is null when setProperty is called. >>>>>>> fSecurityPropertyMgr was instantiated in SAXParserImpl's constructor >>>>>>> after JAXPSAXParser was. I can see a chance where the NetBeans got a >>>>>>> copy of JAXPSAXParser instance with fSecurityPropertyMgr not >>>>>>> initialized. The fix is to remove the reference of >>>>>>> fSecurityPropertyMgr in JAXPSAXParser, and pass it in when >>>>>>> JAXPSAXParser is created. >>>>>>> >>>>>>> Here is the webrev: >>>>>>> http://cr.openjdk.java.net/~joehw/7u40/8021148/webrev/ >>>>>>> >>>>>>> [1] >>>>>>> http://cr.openjdk.java.net/~joehw/7u40/8021148/webrev/src/com/sun/org/apache/xerces/internal/jaxp/SAXParserImpl.java.html >>>>>>> >>>>>>> >>>>>>> [2] >>>>>>> >>>>>>> Caused by: java.lang.NullPointerException >>>>>>> at >>>>>>> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.access$300(SAXParserImpl.java:69) >>>>>>> >>>>>>> >>>>>>> at >>>>>>> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.setProperty(SAXParserImpl.java:545) >>>>>>> >>>>>>> >>>>>>> at >>>>>>> com.sun.org.apache.xml.internal.utils.XMLReaderManager.getXMLReader(XMLReaderManager.java:161) >>>>>>> >>>>>>> >>>>>>> at >>>>>>> com.sun.org.apache.xml.internal.dtm.ref.DTMManagerDefault.getXMLReader(DTMManagerDefault.java:613) >>>>>>> >>>>>>> >>>>>>> at >>>>>>> com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager.getDTM(XSLTCDTMManager.java:401) >>>>>>> >>>>>>> >>>>>>> at >>>>>>> com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager.getDTM(XSLTCDTMManager.java:252) >>>>>>> >>>>>>> >>>>>>> at >>>>>>> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.getDOM(TransformerImpl.java:559) >>>>>>> >>>>>>> >>>>>>> ... 43 more >>>>>>> --------- >>>>>>> javax.xml.transform.TransformerException: >>>>>>> java.lang.NullPointerException >>>>>>> at >>>>>>> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.getDOM(TransformerImpl.java:581) >>>>>>> >>>>>>> >>>>>>> at >>>>>>> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:742) >>>>>>> >>>>>>> >>>>>>> at >>>>>>> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:353) >>>>>>> >>>>>>> >>>>>>> at >>>>>>> org.netbeans.spi.project.support.ant.GeneratedFilesHelper$1$1.run(GeneratedFilesHelper.java:332) >>>>>>> >>>>>>> >>>>>>> >>>>>>> Thanks, >>>>>>> Joe >>>>>>> >>> >>> >>> Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 >>> Oracle Java Engineering >>> 1 Network Drive >>> Burlington, MA 01803 >>> Lance.Andersen at oracle.com >>> >> > From chris.hegarty at oracle.com Thu Jul 25 08:12:12 2013 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Thu, 25 Jul 2013 09:12:12 +0100 Subject: RFR JDK 8 - Another round of doclint fixes in java.util.jar In-Reply-To: <51F0CA0A.3090609@oracle.com> References: <51F0CA0A.3090609@oracle.com> Message-ID: <51F0DDDC.6070709@oracle.com> Looks good to me Joe, -Chris. On 07/25/2013 07:47 AM, Joe Darcy wrote: > Hello, > > Please review this change below to fix another small batch of doclint > problem in java.util.jar. > > Thanks, > > -Joe > > diff -r fd1b5adcfdf0 src/share/classes/java/util/jar/Attributes.java > --- a/src/share/classes/java/util/jar/Attributes.java Wed Jul 24 > 22:52:01 2013 +0100 > +++ b/src/share/classes/java/util/jar/Attributes.java Wed Jul 24 > 23:46:52 2013 -0700 > @@ -527,7 +527,7 @@ > * Name object for Manifest-Version > * manifest attribute. This attribute indicates the version > number > * of the manifest standard to which a JAR file's manifest > conforms. > - * @see > + * @see href="../../../../technotes/guides/jar/jar.html#JAR_Manifest"> > * Manifest and Signature Specification > */ > public static final Name MANIFEST_VERSION = new > Name("Manifest-Version"); > @@ -535,7 +535,7 @@ > /** > * Name object for Signature-Version > * manifest attribute used when signing JAR files. > - * @see > + * @see href="../../../../technotes/guides/jar/jar.html#JAR_Manifest"> > * Manifest and Signature Specification > */ > public static final Name SIGNATURE_VERSION = new > Name("Signature-Version"); > diff -r fd1b5adcfdf0 src/share/classes/java/util/jar/JarEntry.java > --- a/src/share/classes/java/util/jar/JarEntry.java Wed Jul 24 > 22:52:01 2013 +0100 > +++ b/src/share/classes/java/util/jar/JarEntry.java Wed Jul 24 > 23:46:52 2013 -0700 > @@ -81,6 +81,7 @@ > * > * @return the Manifest Attributes for this > * entry, or null if none > + * @throws IOException if an I/O error has occurred > */ > public Attributes getAttributes() throws IOException { > return attr; > diff -r fd1b5adcfdf0 src/share/classes/java/util/jar/JarFile.java > --- a/src/share/classes/java/util/jar/JarFile.java Wed Jul 24 > 22:52:01 2013 +0100 > +++ b/src/share/classes/java/util/jar/JarFile.java Wed Jul 24 > 23:46:52 2013 -0700 > @@ -168,6 +168,7 @@ > * > * @throws IllegalStateException > * may be thrown if the jar file has been closed > + * @throws IOException if an I/O error has occurred > */ > public Manifest getManifest() throws IOException { > return getManifestFromReference(); > From chris.hegarty at oracle.com Thu Jul 25 08:13:11 2013 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Thu, 25 Jul 2013 09:13:11 +0100 Subject: RFR JDK 8 java.util.stream doclint fix In-Reply-To: <51F0CCA1.4060607@oracle.com> References: <51F0CCA1.4060607@oracle.com> Message-ID: <51F0DE17.2010101@oracle.com> Looks fine Joe. -Chris. On 07/25/2013 07:58 AM, Joe Darcy wrote: > Hello, > > Please review this minor doclint fix in java.util.stream. > > Thanks, > > -Joe > > --- a/src/share/classes/java/util/stream/StreamSupport.java Wed Jul > 24 22:52:01 2013 +0100 > +++ b/src/share/classes/java/util/stream/StreamSupport.java Wed Jul > 24 23:57:19 2013 -0700 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. > + * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights > reserved. > * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. > * > * This code is free software; you can redistribute it and/or modify it > @@ -96,6 +96,7 @@ > * href="package-summary.html#Non-Interference">Non-Interference for > * more details. > * > + * @param the type of stream elements > * @param supplier a {@code Supplier} of a {@code Spliterator} > * @param characteristics Spliterator characteristics of the supplied > * {@code Spliterator}. The characteristics must be equal to > From chris.hegarty at oracle.com Thu Jul 25 08:15:32 2013 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Thu, 25 Jul 2013 09:15:32 +0100 Subject: RFR JDK 8 - doclint fixes to java.io.Object{Input, Output}Stream In-Reply-To: <51F0D018.9080706@oracle.com> References: <51F0D018.9080706@oracle.com> Message-ID: <51F0DEA4.4010705@oracle.com> Looks good. -Chris. On 07/25/2013 08:13 AM, Joe Darcy wrote: > Hello, > > Please review the fix below to add @throws tags to constructors in > java.io.Object{Input, Output}Stream. > > Thanks, > > -Joe > > diff -r fd1b5adcfdf0 src/share/classes/java/io/ObjectInputStream.java > --- a/src/share/classes/java/io/ObjectInputStream.java Wed Jul 24 > 22:52:01 2013 +0100 > +++ b/src/share/classes/java/io/ObjectInputStream.java Thu Jul 25 > 00:10:06 2013 -0700 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights > reserved. > + * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights > reserved. > * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. > * > * This code is free software; you can redistribute it and/or modify it > @@ -313,6 +313,7 @@ > * @throws SecurityException if a security manager exists and its > * checkPermission method denies enabling > * subclassing. > + * @throws IOException if an I/O error occurs while creating this > stream > * @see SecurityManager#checkPermission > * @see java.io.SerializablePermission > */ > diff -r fd1b5adcfdf0 src/share/classes/java/io/ObjectOutputStream.java > --- a/src/share/classes/java/io/ObjectOutputStream.java Wed Jul 24 > 22:52:01 2013 +0100 > +++ b/src/share/classes/java/io/ObjectOutputStream.java Thu Jul 25 > 00:10:06 2013 -0700 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 1996, 2012, Oracle and/or its affiliates. All rights > reserved. > + * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights > reserved. > * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. > * > * This code is free software; you can redistribute it and/or modify it > @@ -265,6 +265,7 @@ > * @throws SecurityException if a security manager exists and its > * checkPermission method denies enabling > * subclassing. > + * @throws IOException if an I/O error occurs while creating this > stream > * @see SecurityManager#checkPermission > * @see java.io.SerializablePermission > */ > From chris.hegarty at oracle.com Thu Jul 25 08:41:22 2013 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Thu, 25 Jul 2013 09:41:22 +0100 Subject: RFR doclint issues in j.u.c.atomic Message-ID: <51F0E4B2.6000607@oracle.com> These changes are already committed in the jsr166 CVS, this is a request to pull them into jdk8. diff -r fd1b5adcfdf0 src/share/classes/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java --- a/src/share/classes/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java Wed Jul 24 22:52:01 2013 +0100 +++ b/src/share/classes/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java Thu Jul 25 09:37:25 2013 +0100 @@ -71,6 +71,7 @@ public abstract class AtomicIntegerField * * @param tclass the class of the objects holding the field * @param fieldName the name of the field to be updated + * @param the type of instances of tclass * @return the updater * @throws IllegalArgumentException if the field is not a * volatile integer type diff -r fd1b5adcfdf0 src/share/classes/java/util/concurrent/atomic/AtomicLongFieldUpdater.java --- a/src/share/classes/java/util/concurrent/atomic/AtomicLongFieldUpdater.java Wed Jul 24 22:52:01 2013 +0100 +++ b/src/share/classes/java/util/concurrent/atomic/AtomicLongFieldUpdater.java Thu Jul 25 09:37:25 2013 +0100 @@ -71,6 +71,7 @@ public abstract class AtomicLongFieldUpd * * @param tclass the class of the objects holding the field * @param fieldName the name of the field to be updated + * @param the type of instances of tclass * @return the updater * @throws IllegalArgumentException if the field is not a * volatile long type diff -r fd1b5adcfdf0 src/share/classes/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java --- a/src/share/classes/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java Wed Jul 24 22:52:01 2013 +0100 +++ b/src/share/classes/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java Thu Jul 25 09:37:25 2013 +0100 @@ -91,6 +91,8 @@ public abstract class AtomicReferenceFie * @param tclass the class of the objects holding the field * @param vclass the class of the field * @param fieldName the name of the field to be updated + * @param the type of instances of tclass + * @param the type of instances of vclass * @return the updater * @throws ClassCastException if the field is of the wrong type * @throws IllegalArgumentException if the field is not volatile -Chris. From chris.hegarty at oracle.com Thu Jul 25 09:12:49 2013 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Thu, 25 Jul 2013 10:12:49 +0100 Subject: RFR doclint issues in j.u.concurrent Message-ID: <51F0EC11.2000700@oracle.com> These changes are already committed in the jsr166 CVS, this is a request to pull them into jdk8. With these changes all but CompletableFuture are doclint warning free. There is a separate effort to overhaul CF, which will address the warnings. diff -r fd1b5adcfdf0 src/share/classes/java/util/concurrent/AbstractExecutorService.java --- a/src/share/classes/java/util/concurrent/AbstractExecutorService.java Wed Jul 24 22:52:01 2013 +0100 +++ b/src/share/classes/java/util/concurrent/AbstractExecutorService.java Thu Jul 25 10:04:28 2013 +0100 @@ -76,6 +76,7 @@ public abstract class AbstractExecutorSe * * @param runnable the runnable task being wrapped * @param value the default value for the returned future + * @param the type of the given value * @return a {@code RunnableFuture} which, when run, will run the * underlying runnable and which, as a {@code Future}, will yield * the given value as its result and provide for cancellation of @@ -90,6 +91,7 @@ public abstract class AbstractExecutorSe * Returns a {@code RunnableFuture} for the given callable task. * * @param callable the callable task being wrapped + * @param the type of the callable's result * @return a {@code RunnableFuture} which, when run, will call the * underlying callable and which, as a {@code Future}, will yield * the callable's result as its result and provide for diff -r fd1b5adcfdf0 src/share/classes/java/util/concurrent/ExecutorService.java --- a/src/share/classes/java/util/concurrent/ExecutorService.java Wed Jul 24 22:52:01 2013 +0100 +++ b/src/share/classes/java/util/concurrent/ExecutorService.java Thu Jul 25 10:04:28 2013 +0100 @@ -227,6 +227,7 @@ public interface ExecutorService extends * {@link Callable} form so they can be submitted. * * @param task the task to submit + * @param the type of the task's result * @return a Future representing pending completion of the task * @throws RejectedExecutionException if the task cannot be * scheduled for execution @@ -241,6 +242,7 @@ public interface ExecutorService extends * * @param task the task to submit * @param result the result to return + * @param the type of the result * @return a Future representing pending completion of the task * @throws RejectedExecutionException if the task cannot be * scheduled for execution @@ -272,6 +274,7 @@ public interface ExecutorService extends * collection is modified while this operation is in progress. * * @param tasks the collection of tasks + * @param the type of the values returned from the tasks * @return a list of Futures representing the tasks, in the same * sequential order as produced by the iterator for the * given task list, each of which has completed @@ -299,6 +302,7 @@ public interface ExecutorService extends * @param tasks the collection of tasks * @param timeout the maximum time to wait * @param unit the time unit of the timeout argument + * @param the type of the values returned from the tasks * @return a list of Futures representing the tasks, in the same * sequential order as produced by the iterator for the * given task list. If the operation did not time out, @@ -324,6 +328,7 @@ public interface ExecutorService extends * collection is modified while this operation is in progress. * * @param tasks the collection of tasks + * @param the type of the values returned from the tasks * @return the result returned by one of the tasks * @throws InterruptedException if interrupted while waiting * @throws NullPointerException if tasks or any element task @@ -348,6 +353,7 @@ public interface ExecutorService extends * @param tasks the collection of tasks * @param timeout the maximum time to wait * @param unit the time unit of the timeout argument + * @param the type of the values returned from the tasks * @return the result returned by one of the tasks * @throws InterruptedException if interrupted while waiting * @throws NullPointerException if tasks, or unit, or any element diff -r fd1b5adcfdf0 src/share/classes/java/util/concurrent/Executors.java --- a/src/share/classes/java/util/concurrent/Executors.java Wed Jul 24 22:52:01 2013 +0100 +++ b/src/share/classes/java/util/concurrent/Executors.java Thu Jul 25 10:04:28 2013 +0100 @@ -397,6 +397,7 @@ public class Executors { * {@code Callable} to an otherwise resultless action. * @param task the task to run * @param result the result to return + * @param the type of the result * @return a callable object * @throws NullPointerException if task null */ @@ -458,6 +459,7 @@ public class Executors { * action; or if not possible, throw an associated {@link * AccessControlException}. * @param callable the underlying task + * @param the type of the callable's result * @return a callable object * @throws NullPointerException if callable null */ @@ -480,6 +482,7 @@ public class Executors { * AccessControlException}. * * @param callable the underlying task + * @param the type of the callable's result * @return a callable object * @throws NullPointerException if callable null * @throws AccessControlException if the current access control diff -r fd1b5adcfdf0 src/share/classes/java/util/concurrent/ForkJoinPool.java --- a/src/share/classes/java/util/concurrent/ForkJoinPool.java Wed Jul 24 22:52:01 2013 +0100 +++ b/src/share/classes/java/util/concurrent/ForkJoinPool.java Thu Jul 25 10:04:28 2013 +0100 @@ -561,8 +561,8 @@ public class ForkJoinPool extends Abstra * Returns a new worker thread operating in the given pool. * * @param pool the pool this thread works in + * @return the new worker thread * @throws NullPointerException if the pool is null - * @return the new worker thread */ public ForkJoinWorkerThread newThread(ForkJoinPool pool); } @@ -2497,6 +2497,7 @@ public class ForkJoinPool extends Abstra * minimally only the latter. * * @param task the task + * @param the type of the task's result * @return the task's result * @throws NullPointerException if the task is null * @throws RejectedExecutionException if the task cannot be @@ -2545,6 +2546,7 @@ public class ForkJoinPool extends Abstra * Submits a ForkJoinTask for execution. * * @param task the task to submit + * @param the type of the task's result * @return the task * @throws NullPointerException if the task is null * @throws RejectedExecutionException if the task cannot be diff -r fd1b5adcfdf0 src/share/classes/java/util/concurrent/ForkJoinTask.java --- a/src/share/classes/java/util/concurrent/ForkJoinTask.java Wed Jul 24 22:52:01 2013 +0100 +++ b/src/share/classes/java/util/concurrent/ForkJoinTask.java Thu Jul 25 10:04:28 2013 +0100 @@ -810,6 +810,7 @@ public abstract class ForkJoinTask im * unprocessed. * * @param tasks the collection of tasks + * @param the type of the values returned from the tasks * @return the tasks argument, to simplify usage * @throws NullPointerException if tasks or any element are null */ @@ -1472,6 +1473,7 @@ public abstract class ForkJoinTask im * * @param runnable the runnable action * @param result the result upon completion + * @param the type of the result * @return the task */ public static ForkJoinTask adapt(Runnable runnable, T result) { @@ -1485,6 +1487,7 @@ public abstract class ForkJoinTask im * encountered into {@code RuntimeException}. * * @param callable the callable action + * @param the type of the callable's result * @return the task */ public static ForkJoinTask adapt(Callable callable) { @@ -1498,6 +1501,8 @@ public abstract class ForkJoinTask im /** * Saves this task to a stream (that is, serializes it). * + * @param s the stream + * @throws java.io.IOException if an I/O error occurs * @serialData the current run status and the exception thrown * during execution, or {@code null} if none */ @@ -1509,6 +1514,10 @@ public abstract class ForkJoinTask im /** * Reconstitutes this task from a stream (that is, deserializes it). + * @param s the stream + * @throws ClassNotFoundException if the class of a serialized object + * could not be found + * @throws java.io.IOException if an I/O error occurs */ private void readObject(java.io.ObjectInputStream s) throws java.io.IOException, ClassNotFoundException { diff -r fd1b5adcfdf0 src/share/classes/java/util/concurrent/ScheduledExecutorService.java --- a/src/share/classes/java/util/concurrent/ScheduledExecutorService.java Wed Jul 24 22:52:01 2013 +0100 +++ b/src/share/classes/java/util/concurrent/ScheduledExecutorService.java Thu Jul 25 10:04:28 2013 +0100 @@ -117,6 +117,7 @@ public interface ScheduledExecutorServic * @param callable the function to execute * @param delay the time from now to delay execution * @param unit the time unit of the delay parameter + * @param the type of the callable's result * @return a ScheduledFuture that can be used to extract result or cancel * @throws RejectedExecutionException if the task cannot be * scheduled for execution diff -r fd1b5adcfdf0 src/share/classes/java/util/concurrent/ScheduledThreadPoolExecutor.java --- a/src/share/classes/java/util/concurrent/ScheduledThreadPoolExecutor.java Wed Jul 24 22:52:01 2013 +0100 +++ b/src/share/classes/java/util/concurrent/ScheduledThreadPoolExecutor.java Thu Jul 25 10:04:28 2013 +0100 @@ -392,6 +392,7 @@ public class ScheduledThreadPoolExecutor * * @param runnable the submitted Runnable * @param task the task created to execute the runnable + * @param the type of the task's result * @return a task that can execute the runnable * @since 1.6 */ @@ -408,6 +409,7 @@ public class ScheduledThreadPoolExecutor * * @param callable the submitted Callable * @param task the task created to execute the callable + * @param the type of the task's result * @return a task that can execute the callable * @since 1.6 */ diff -r fd1b5adcfdf0 src/share/classes/java/util/concurrent/TimeUnit.java --- a/src/share/classes/java/util/concurrent/TimeUnit.java Wed Jul 24 22:52:01 2013 +0100 +++ b/src/share/classes/java/util/concurrent/TimeUnit.java Thu Jul 25 10:04:28 2013 +0100 @@ -69,6 +69,9 @@ package java.util.concurrent; * @author Doug Lea */ public enum TimeUnit { + /** + * Time unit representing one thousandth of a microsecond + */ NANOSECONDS { public long toNanos(long d) { return d; } public long toMicros(long d) { return d/(C1/C0); } @@ -80,6 +83,10 @@ public enum TimeUnit { public long convert(long d, TimeUnit u) { return u.toNanos(d); } int excessNanos(long d, long m) { return (int)(d - (m*C2)); } }, + + /** + * Time unit representing one thousandth of a millisecond + */ MICROSECONDS { public long toNanos(long d) { return x(d, C1/C0, MAX/(C1/C0)); } public long toMicros(long d) { return d; } @@ -91,6 +98,10 @@ public enum TimeUnit { public long convert(long d, TimeUnit u) { return u.toMicros(d); } int excessNanos(long d, long m) { return (int)((d*C1) - (m*C2)); } }, + + /** + * Time unit representing one thousandth of a second + */ MILLISECONDS { public long toNanos(long d) { return x(d, C2/C0, MAX/(C2/C0)); } public long toMicros(long d) { return x(d, C2/C1, MAX/(C2/C1)); } @@ -102,6 +113,10 @@ public enum TimeUnit { public long convert(long d, TimeUnit u) { return u.toMillis(d); } int excessNanos(long d, long m) { return 0; } }, + + /** + * Time unit representing one second + */ SECONDS { public long toNanos(long d) { return x(d, C3/C0, MAX/(C3/C0)); } public long toMicros(long d) { return x(d, C3/C1, MAX/(C3/C1)); } @@ -113,6 +128,10 @@ public enum TimeUnit { public long convert(long d, TimeUnit u) { return u.toSeconds(d); } int excessNanos(long d, long m) { return 0; } }, + + /** + * Time unit representing sixty seconds + */ MINUTES { public long toNanos(long d) { return x(d, C4/C0, MAX/(C4/C0)); } public long toMicros(long d) { return x(d, C4/C1, MAX/(C4/C1)); } @@ -124,6 +143,10 @@ public enum TimeUnit { public long convert(long d, TimeUnit u) { return u.toMinutes(d); } int excessNanos(long d, long m) { return 0; } }, + + /** + * Time unit representing sixty minutes + */ HOURS { public long toNanos(long d) { return x(d, C5/C0, MAX/(C5/C0)); } public long toMicros(long d) { return x(d, C5/C1, MAX/(C5/C1)); } @@ -135,6 +158,10 @@ public enum TimeUnit { public long convert(long d, TimeUnit u) { return u.toHours(d); } int excessNanos(long d, long m) { return 0; } }, + + /** + * Time unit representing twenty four hours + */ DAYS { public long toNanos(long d) { return x(d, C6/C0, MAX/(C6/C0)); } public long toMicros(long d) { return x(d, C6/C1, MAX/(C6/C1)); } -Chris. From joel.franck at oracle.com Thu Jul 25 09:27:41 2013 From: joel.franck at oracle.com (joel.franck at oracle.com) Date: Thu, 25 Jul 2013 09:27:41 +0000 Subject: hg: jdk8/tl/langtools: 8007961: javax.lang.model tests for repeating annotations fail in getAnnotationsByType Message-ID: <20130725092748.37DDC4834F@hg.openjdk.java.net> Changeset: a218f7befd55 Author: jfranck Date: 2013-07-25 11:02 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/a218f7befd55 8007961: javax.lang.model tests for repeating annotations fail in getAnnotationsByType Reviewed-by: jjg ! src/share/classes/com/sun/tools/javac/code/Symbol.java ! src/share/classes/com/sun/tools/javac/model/JavacAnnoConstructs.java ! test/tools/javac/processing/model/element/repeatingAnnotations/MixRepeatableAndOfficialContainerInheritedA1Test.java ! test/tools/javac/processing/model/element/repeatingAnnotations/MixRepeatableAndOfficialContainerInheritedB1Test.java ! test/tools/javac/processing/model/element/repeatingAnnotations/MixRepeatableAndOfficialContainerInheritedB2Test.java ! test/tools/javac/processing/model/element/repeatingAnnotations/RepeatableOverrideATest.java ! test/tools/javac/processing/model/element/repeatingAnnotations/RepeatableOverrideBTest.java + test/tools/javac/processing/model/inheritedByType/EnsureOrder.java From paul.sandoz at oracle.com Thu Jul 25 09:31:03 2013 From: paul.sandoz at oracle.com (Paul Sandoz) Date: Thu, 25 Jul 2013 10:31:03 +0100 Subject: RFR 8020156/8020009 TreeMap.values should report ORDERED/TreeMap.entrySet comparator should not be null Message-ID: Hi, Please review the following patch that fixes two issues with TreeMap spliterators: http://cr.openjdk.java.net/~psandoz/tl/JDK-8020156-8020009-TreeMap/webrev/ It's unfortunate and damn ugly that i resorted to using raw types and a cast for the EntrySet Spliterator.getComparator method: + // Since SORTED is reported and Map.Entry elements are not comparable + // then a non-null comparator needs to be returned + if (tree.comparator != null) { + // Adapt the existing non-null comparator to compare entries + // by key + return Map.Entry.comparingByKey(tree.comparator); + } + else { + // Return a comparator of entries by key, with K assumed to be + // of Comparable + // First obtain the Map.Entry.comparingByKey() comparator + // as a raw type since K is not declared with + // a upper bound of Comparable, then cast to the return type + @SuppressWarnings("rawtypes") + Comparator craw = Map.Entry.comparingByKey(); + @SuppressWarnings("unchecked") + Comparator> c = + (Comparator>) craw; + return c; + } Perhaps rather than reusing a Map.Entry comparator method it is clearer to do the following: return (Comparator> & Serializable) (e1, e2) -> { @SuppressWarnings("unchecked") Comparable k1 = (Comparable) e1.getKey(); return k1.compareTo(e2.getKey()); }; ? I marginally prefer that. I created a new test java/util/Spliterators/SpliteratorCharacteristics that we can fill out over time for other collections as and when needed. Paul. From Lance.Andersen at oracle.com Thu Jul 25 09:35:46 2013 From: Lance.Andersen at oracle.com (Lance Andersen) Date: Thu, 25 Jul 2013 05:35:46 -0400 Subject: RFR doclint issues in j.u.concurrent In-Reply-To: <51F0EC11.2000700@oracle.com> References: <51F0EC11.2000700@oracle.com> Message-ID: Looks fine Best Lance -- Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 Oracle Java Engineering 1 Network Drive Burlington, MA 01803 Lance.Andersen at oracle.com Sent from my iPhone On Jul 25, 2013, at 5:12 AM, Chris Hegarty wrote: > These changes are already committed in the jsr166 CVS, this is a request to pull them into jdk8. > > With these changes all but CompletableFuture are doclint warning free. There is a separate effort to overhaul CF, which will address the warnings. > > diff -r fd1b5adcfdf0 src/share/classes/java/util/concurrent/AbstractExecutorService.java > --- a/src/share/classes/java/util/concurrent/AbstractExecutorService.java Wed Jul 24 22:52:01 2013 +0100 > +++ b/src/share/classes/java/util/concurrent/AbstractExecutorService.java Thu Jul 25 10:04:28 2013 +0100 > @@ -76,6 +76,7 @@ public abstract class AbstractExecutorSe > * > * @param runnable the runnable task being wrapped > * @param value the default value for the returned future > + * @param the type of the given value > * @return a {@code RunnableFuture} which, when run, will run the > * underlying runnable and which, as a {@code Future}, will yield > * the given value as its result and provide for cancellation of > @@ -90,6 +91,7 @@ public abstract class AbstractExecutorSe > * Returns a {@code RunnableFuture} for the given callable task. > * > * @param callable the callable task being wrapped > + * @param the type of the callable's result > * @return a {@code RunnableFuture} which, when run, will call the > * underlying callable and which, as a {@code Future}, will yield > * the callable's result as its result and provide for > diff -r fd1b5adcfdf0 src/share/classes/java/util/concurrent/ExecutorService.java > --- a/src/share/classes/java/util/concurrent/ExecutorService.java Wed Jul 24 22:52:01 2013 +0100 > +++ b/src/share/classes/java/util/concurrent/ExecutorService.java Thu Jul 25 10:04:28 2013 +0100 > @@ -227,6 +227,7 @@ public interface ExecutorService extends > * {@link Callable} form so they can be submitted. > * > * @param task the task to submit > + * @param the type of the task's result > * @return a Future representing pending completion of the task > * @throws RejectedExecutionException if the task cannot be > * scheduled for execution > @@ -241,6 +242,7 @@ public interface ExecutorService extends > * > * @param task the task to submit > * @param result the result to return > + * @param the type of the result > * @return a Future representing pending completion of the task > * @throws RejectedExecutionException if the task cannot be > * scheduled for execution > @@ -272,6 +274,7 @@ public interface ExecutorService extends > * collection is modified while this operation is in progress. > * > * @param tasks the collection of tasks > + * @param the type of the values returned from the tasks > * @return a list of Futures representing the tasks, in the same > * sequential order as produced by the iterator for the > * given task list, each of which has completed > @@ -299,6 +302,7 @@ public interface ExecutorService extends > * @param tasks the collection of tasks > * @param timeout the maximum time to wait > * @param unit the time unit of the timeout argument > + * @param the type of the values returned from the tasks > * @return a list of Futures representing the tasks, in the same > * sequential order as produced by the iterator for the > * given task list. If the operation did not time out, > @@ -324,6 +328,7 @@ public interface ExecutorService extends > * collection is modified while this operation is in progress. > * > * @param tasks the collection of tasks > + * @param the type of the values returned from the tasks > * @return the result returned by one of the tasks > * @throws InterruptedException if interrupted while waiting > * @throws NullPointerException if tasks or any element task > @@ -348,6 +353,7 @@ public interface ExecutorService extends > * @param tasks the collection of tasks > * @param timeout the maximum time to wait > * @param unit the time unit of the timeout argument > + * @param the type of the values returned from the tasks > * @return the result returned by one of the tasks > * @throws InterruptedException if interrupted while waiting > * @throws NullPointerException if tasks, or unit, or any element > diff -r fd1b5adcfdf0 src/share/classes/java/util/concurrent/Executors.java > --- a/src/share/classes/java/util/concurrent/Executors.java Wed Jul 24 22:52:01 2013 +0100 > +++ b/src/share/classes/java/util/concurrent/Executors.java Thu Jul 25 10:04:28 2013 +0100 > @@ -397,6 +397,7 @@ public class Executors { > * {@code Callable} to an otherwise resultless action. > * @param task the task to run > * @param result the result to return > + * @param the type of the result > * @return a callable object > * @throws NullPointerException if task null > */ > @@ -458,6 +459,7 @@ public class Executors { > * action; or if not possible, throw an associated {@link > * AccessControlException}. > * @param callable the underlying task > + * @param the type of the callable's result > * @return a callable object > * @throws NullPointerException if callable null > */ > @@ -480,6 +482,7 @@ public class Executors { > * AccessControlException}. > * > * @param callable the underlying task > + * @param the type of the callable's result > * @return a callable object > * @throws NullPointerException if callable null > * @throws AccessControlException if the current access control > diff -r fd1b5adcfdf0 src/share/classes/java/util/concurrent/ForkJoinPool.java > --- a/src/share/classes/java/util/concurrent/ForkJoinPool.java Wed Jul 24 22:52:01 2013 +0100 > +++ b/src/share/classes/java/util/concurrent/ForkJoinPool.java Thu Jul 25 10:04:28 2013 +0100 > @@ -561,8 +561,8 @@ public class ForkJoinPool extends Abstra > * Returns a new worker thread operating in the given pool. > * > * @param pool the pool this thread works in > + * @return the new worker thread > * @throws NullPointerException if the pool is null > - * @return the new worker thread > */ > public ForkJoinWorkerThread newThread(ForkJoinPool pool); > } > @@ -2497,6 +2497,7 @@ public class ForkJoinPool extends Abstra > * minimally only the latter. > * > * @param task the task > + * @param the type of the task's result > * @return the task's result > * @throws NullPointerException if the task is null > * @throws RejectedExecutionException if the task cannot be > @@ -2545,6 +2546,7 @@ public class ForkJoinPool extends Abstra > * Submits a ForkJoinTask for execution. > * > * @param task the task to submit > + * @param the type of the task's result > * @return the task > * @throws NullPointerException if the task is null > * @throws RejectedExecutionException if the task cannot be > diff -r fd1b5adcfdf0 src/share/classes/java/util/concurrent/ForkJoinTask.java > --- a/src/share/classes/java/util/concurrent/ForkJoinTask.java Wed Jul 24 22:52:01 2013 +0100 > +++ b/src/share/classes/java/util/concurrent/ForkJoinTask.java Thu Jul 25 10:04:28 2013 +0100 > @@ -810,6 +810,7 @@ public abstract class ForkJoinTask im > * unprocessed. > * > * @param tasks the collection of tasks > + * @param the type of the values returned from the tasks > * @return the tasks argument, to simplify usage > * @throws NullPointerException if tasks or any element are null > */ > @@ -1472,6 +1473,7 @@ public abstract class ForkJoinTask im > * > * @param runnable the runnable action > * @param result the result upon completion > + * @param the type of the result > * @return the task > */ > public static ForkJoinTask adapt(Runnable runnable, T result) { > @@ -1485,6 +1487,7 @@ public abstract class ForkJoinTask im > * encountered into {@code RuntimeException}. > * > * @param callable the callable action > + * @param the type of the callable's result > * @return the task > */ > public static ForkJoinTask adapt(Callable callable) { > @@ -1498,6 +1501,8 @@ public abstract class ForkJoinTask im > /** > * Saves this task to a stream (that is, serializes it). > * > + * @param s the stream > + * @throws java.io.IOException if an I/O error occurs > * @serialData the current run status and the exception thrown > * during execution, or {@code null} if none > */ > @@ -1509,6 +1514,10 @@ public abstract class ForkJoinTask im > > /** > * Reconstitutes this task from a stream (that is, deserializes it). > + * @param s the stream > + * @throws ClassNotFoundException if the class of a serialized object > + * could not be found > + * @throws java.io.IOException if an I/O error occurs > */ > private void readObject(java.io.ObjectInputStream s) > throws java.io.IOException, ClassNotFoundException { > diff -r fd1b5adcfdf0 src/share/classes/java/util/concurrent/ScheduledExecutorService.java > --- a/src/share/classes/java/util/concurrent/ScheduledExecutorService.java Wed Jul 24 22:52:01 2013 +0100 > +++ b/src/share/classes/java/util/concurrent/ScheduledExecutorService.java Thu Jul 25 10:04:28 2013 +0100 > @@ -117,6 +117,7 @@ public interface ScheduledExecutorServic > * @param callable the function to execute > * @param delay the time from now to delay execution > * @param unit the time unit of the delay parameter > + * @param the type of the callable's result > * @return a ScheduledFuture that can be used to extract result or cancel > * @throws RejectedExecutionException if the task cannot be > * scheduled for execution > diff -r fd1b5adcfdf0 src/share/classes/java/util/concurrent/ScheduledThreadPoolExecutor.java > --- a/src/share/classes/java/util/concurrent/ScheduledThreadPoolExecutor.java Wed Jul 24 22:52:01 2013 +0100 > +++ b/src/share/classes/java/util/concurrent/ScheduledThreadPoolExecutor.java Thu Jul 25 10:04:28 2013 +0100 > @@ -392,6 +392,7 @@ public class ScheduledThreadPoolExecutor > * > * @param runnable the submitted Runnable > * @param task the task created to execute the runnable > + * @param the type of the task's result > * @return a task that can execute the runnable > * @since 1.6 > */ > @@ -408,6 +409,7 @@ public class ScheduledThreadPoolExecutor > * > * @param callable the submitted Callable > * @param task the task created to execute the callable > + * @param the type of the task's result > * @return a task that can execute the callable > * @since 1.6 > */ > diff -r fd1b5adcfdf0 src/share/classes/java/util/concurrent/TimeUnit.java > --- a/src/share/classes/java/util/concurrent/TimeUnit.java Wed Jul 24 22:52:01 2013 +0100 > +++ b/src/share/classes/java/util/concurrent/TimeUnit.java Thu Jul 25 10:04:28 2013 +0100 > @@ -69,6 +69,9 @@ package java.util.concurrent; > * @author Doug Lea > */ > public enum TimeUnit { > + /** > + * Time unit representing one thousandth of a microsecond > + */ > NANOSECONDS { > public long toNanos(long d) { return d; } > public long toMicros(long d) { return d/(C1/C0); } > @@ -80,6 +83,10 @@ public enum TimeUnit { > public long convert(long d, TimeUnit u) { return u.toNanos(d); } > int excessNanos(long d, long m) { return (int)(d - (m*C2)); } > }, > + > + /** > + * Time unit representing one thousandth of a millisecond > + */ > MICROSECONDS { > public long toNanos(long d) { return x(d, C1/C0, MAX/(C1/C0)); } > public long toMicros(long d) { return d; } > @@ -91,6 +98,10 @@ public enum TimeUnit { > public long convert(long d, TimeUnit u) { return u.toMicros(d); } > int excessNanos(long d, long m) { return (int)((d*C1) - (m*C2)); } > }, > + > + /** > + * Time unit representing one thousandth of a second > + */ > MILLISECONDS { > public long toNanos(long d) { return x(d, C2/C0, MAX/(C2/C0)); } > public long toMicros(long d) { return x(d, C2/C1, MAX/(C2/C1)); } > @@ -102,6 +113,10 @@ public enum TimeUnit { > public long convert(long d, TimeUnit u) { return u.toMillis(d); } > int excessNanos(long d, long m) { return 0; } > }, > + > + /** > + * Time unit representing one second > + */ > SECONDS { > public long toNanos(long d) { return x(d, C3/C0, MAX/(C3/C0)); } > public long toMicros(long d) { return x(d, C3/C1, MAX/(C3/C1)); } > @@ -113,6 +128,10 @@ public enum TimeUnit { > public long convert(long d, TimeUnit u) { return u.toSeconds(d); } > int excessNanos(long d, long m) { return 0; } > }, > + > + /** > + * Time unit representing sixty seconds > + */ > MINUTES { > public long toNanos(long d) { return x(d, C4/C0, MAX/(C4/C0)); } > public long toMicros(long d) { return x(d, C4/C1, MAX/(C4/C1)); } > @@ -124,6 +143,10 @@ public enum TimeUnit { > public long convert(long d, TimeUnit u) { return u.toMinutes(d); } > int excessNanos(long d, long m) { return 0; } > }, > + > + /** > + * Time unit representing sixty minutes > + */ > HOURS { > public long toNanos(long d) { return x(d, C5/C0, MAX/(C5/C0)); } > public long toMicros(long d) { return x(d, C5/C1, MAX/(C5/C1)); } > @@ -135,6 +158,10 @@ public enum TimeUnit { > public long convert(long d, TimeUnit u) { return u.toHours(d); } > int excessNanos(long d, long m) { return 0; } > }, > + > + /** > + * Time unit representing twenty four hours > + */ > DAYS { > public long toNanos(long d) { return x(d, C6/C0, MAX/(C6/C0)); } > public long toMicros(long d) { return x(d, C6/C1, MAX/(C6/C1)); } > > > -Chris. From Lance.Andersen at oracle.com Thu Jul 25 09:36:59 2013 From: Lance.Andersen at oracle.com (Lance Andersen) Date: Thu, 25 Jul 2013 05:36:59 -0400 Subject: RFR doclint issues in j.u.c.atomic In-Reply-To: <51F0E4B2.6000607@oracle.com> References: <51F0E4B2.6000607@oracle.com> Message-ID: <26F9B2EC-8BA8-426F-9093-089E2B5EC060@oracle.com> Looks fine Best Lance -- Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 Oracle Java Engineering 1 Network Drive Burlington, MA 01803 Lance.Andersen at oracle.com Sent from my iPhone On Jul 25, 2013, at 4:41 AM, Chris Hegarty wrote: > These changes are already committed in the jsr166 CVS, this is a request to pull them into jdk8. > > > diff -r fd1b5adcfdf0 src/share/classes/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java > --- a/src/share/classes/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java Wed Jul 24 22:52:01 2013 +0100 > +++ b/src/share/classes/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java Thu Jul 25 09:37:25 2013 +0100 > @@ -71,6 +71,7 @@ public abstract class AtomicIntegerField > * > * @param tclass the class of the objects holding the field > * @param fieldName the name of the field to be updated > + * @param the type of instances of tclass > * @return the updater > * @throws IllegalArgumentException if the field is not a > * volatile integer type > diff -r fd1b5adcfdf0 src/share/classes/java/util/concurrent/atomic/AtomicLongFieldUpdater.java > --- a/src/share/classes/java/util/concurrent/atomic/AtomicLongFieldUpdater.java Wed Jul 24 22:52:01 2013 +0100 > +++ b/src/share/classes/java/util/concurrent/atomic/AtomicLongFieldUpdater.java Thu Jul 25 09:37:25 2013 +0100 > @@ -71,6 +71,7 @@ public abstract class AtomicLongFieldUpd > * > * @param tclass the class of the objects holding the field > * @param fieldName the name of the field to be updated > + * @param the type of instances of tclass > * @return the updater > * @throws IllegalArgumentException if the field is not a > * volatile long type > diff -r fd1b5adcfdf0 src/share/classes/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java > --- a/src/share/classes/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java Wed Jul 24 22:52:01 2013 +0100 > +++ b/src/share/classes/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java Thu Jul 25 09:37:25 2013 +0100 > @@ -91,6 +91,8 @@ public abstract class AtomicReferenceFie > * @param tclass the class of the objects holding the field > * @param vclass the class of the field > * @param fieldName the name of the field to be updated > + * @param the type of instances of tclass > + * @param the type of instances of vclass > * @return the updater > * @throws ClassCastException if the field is of the wrong type > * @throws IllegalArgumentException if the field is not volatile > > -Chris. From daniel.fuchs at oracle.com Thu Jul 25 09:58:56 2013 From: daniel.fuchs at oracle.com (Daniel Fuchs) Date: Thu, 25 Jul 2013 11:58:56 +0200 Subject: RFR: 8019948: java/util/logging/bundlesearch/ResourceBundleSearchTest.java is failing intermitently In-Reply-To: <51EEAA35.4090009@oracle.com> References: <51EE8060.2060105@oracle.com> <51EEAA35.4090009@oracle.com> Message-ID: <51F0F6E0.5030409@oracle.com> Hi, For the record I have updated the webrev with Mandy's suggestion: -- daniel On 7/23/13 6:07 PM, Mandy Chung wrote: > On 7/23/2013 9:08 PM, Daniel Fuchs wrote: >> Hi, >> >> Please find below a changeset for fixing >> 8019948: java/util/logging/bundlesearch/ResourceBundleSearchTest.java >> is failing intermittently [1] >> >> This appears to be a test bug due to a bizarre use of synchronization >> in the test. The test was failing regularly before the fix (= often >> enough), but I haven't managed to reproduce since I changed >> lr.wait() into lr.join(); >> >> http://cr.openjdk.java.net/~dfuchs/webrev_8019948/webrev.00/ > > Looks okay. All traces have this call: > > newDate(System.currentTimeMillis()) > > Maybe simply move System.currentTimeMillis() to the newDate method > instead of calling it in the parameter. > > Mandy From chris.hegarty at oracle.com Thu Jul 25 10:00:50 2013 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Thu, 25 Jul 2013 11:00:50 +0100 Subject: RFR doclint issues in java.net Message-ID: <51F0F752.3080301@oracle.com> This is a request for review for some doclint warnings in the java.net package. Trivially, the list type should be left to the CSS. Note: with these changes there are still warnings for two DatagramPacket constructors that are missing @throws for SocketException. I do not see any reason that these constructors need to throw SE, and I will file a separate bug to follow up. diff -r fd1b5adcfdf0 src/share/classes/java/net/URI.java --- a/src/share/classes/java/net/URI.java Wed Jul 24 22:52:01 2013 +0100 +++ b/src/share/classes/java/net/URI.java Thu Jul 25 10:56:25 2013 +0100 @@ -530,7 +530,7 @@ public final class URI * href="http://www.ietf.org/rfc/rfc2396.txt">RFC 2396, * Appendix A, except for the following deviations:

    * - *
      + *
        * *
      • An empty authority component is permitted as long as it is * followed by a non-empty path, a query component, or a fragment @@ -993,7 +993,7 @@ public final class URI *

      • Otherwise the new URI's authority component is copied from * this URI, and its path is computed as follows:

        * - *
          + *
            * *
          1. If the given URI's path is absolute then the new URI's path * is taken from the given URI.

          2. @@ -1241,7 +1241,7 @@ public final class URI *

            The host component of a URI, if defined, will have one of the * following forms:

            * - *
              + *
                * *
              • A domain name consisting of one or more labels * separated by period characters ('.'), optionally followed by @@ -1495,7 +1495,7 @@ public final class URI * *

                The ordering of URIs is defined as follows:

                * - *
                  + *
                    * *
                  • Two URIs with different schemes are ordered according the * ordering of their schemes, without regard to case.

                  • @@ -1513,7 +1513,7 @@ public final class URI *
                  • Two hierarchical URIs with identical schemes are ordered * according to the ordering of their authority components:

                    * - *
                      + *
                        * *
                      • If both authority components are server-based then the URIs * are ordered according to their user-information components; if these -Chris. From Lance.Andersen at oracle.com Thu Jul 25 10:16:16 2013 From: Lance.Andersen at oracle.com (Lance Andersen - Oracle) Date: Thu, 25 Jul 2013 06:16:16 -0400 Subject: RFR doclint issues in java.net In-Reply-To: <51F0F752.3080301@oracle.com> References: <51F0F752.3080301@oracle.com> Message-ID: <9288E251-9A4E-43C4-AB60-622462CDE427@oracle.com> Good to go On Jul 25, 2013, at 6:00 AM, Chris Hegarty wrote: > This is a request for review for some doclint warnings in the java.net package. Trivially, the list type should be left to the CSS. > > Note: with these changes there are still warnings for two DatagramPacket constructors that are missing @throws for SocketException. I do not see any reason that these constructors need to throw SE, and I will file a separate bug to follow up. > > diff -r fd1b5adcfdf0 src/share/classes/java/net/URI.java > --- a/src/share/classes/java/net/URI.java Wed Jul 24 22:52:01 2013 +0100 > +++ b/src/share/classes/java/net/URI.java Thu Jul 25 10:56:25 2013 +0100 > @@ -530,7 +530,7 @@ public final class URI > * href="http://www.ietf.org/rfc/rfc2396.txt">RFC 2396, > * Appendix A, except for the following deviations:

                        > * > - *
                          > + *
                            > * > *
                          • An empty authority component is permitted as long as it is > * followed by a non-empty path, a query component, or a fragment > @@ -993,7 +993,7 @@ public final class URI > *

                          • Otherwise the new URI's authority component is copied from > * this URI, and its path is computed as follows:

                            > * > - *
                              > + *
                                > * > *
                              1. If the given URI's path is absolute then the new URI's path > * is taken from the given URI.

                              2. > @@ -1241,7 +1241,7 @@ public final class URI > *

                                The host component of a URI, if defined, will have one of the > * following forms:

                                > * > - *
                                  > + *
                                    > * > *
                                  • A domain name consisting of one or more labels > * separated by period characters ('.'), optionally followed by > @@ -1495,7 +1495,7 @@ public final class URI > * > *

                                    The ordering of URIs is defined as follows:

                                    > * > - *
                                      > + *
                                        > * > *
                                      • Two URIs with different schemes are ordered according the > * ordering of their schemes, without regard to case.

                                      • > @@ -1513,7 +1513,7 @@ public final class URI > *
                                      • Two hierarchical URIs with identical schemes are ordered > * according to the ordering of their authority components:

                                        > * > - *
                                          > + *
                                            > * > *
                                          • If both authority components are server-based then the URIs > * are ordered according to their user-information components; if these > > > -Chris. -------------- next part -------------- Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 Oracle Java Engineering 1 Network Drive Burlington, MA 01803 Lance.Andersen at oracle.com From lance.andersen at oracle.com Thu Jul 25 10:25:41 2013 From: lance.andersen at oracle.com (Lance Andersen - Oracle) Date: Thu, 25 Jul 2013 06:25:41 -0400 Subject: RFR: JAXP in JDK8/7u40 : 8021148 Regression in SAXParserImpl in 7u40 b34 (NPE) In-Reply-To: <51F0C61F.7020306@oracle.com> References: <51EF3596.7010602@oracle.com> <51EF6D98.4030804@oracle.com> <51EF7B38.4080903@oracle.com> <51EF988E.3080304@oracle.com> <799C1DF4-E39B-4E7D-A346-A4AD96660180@oracle.com> <51F0C61F.7020306@oracle.com> Message-ID: looks fine Joe On Jul 25, 2013, at 2:30 AM, huizhe wang wrote: > I received test from the NetBeans team. The NetBeans did reference the internal JAXPSAXParser directly. This is not a usage supported by the spec. I would suggest them remove it and use the default parser instead. I'm asking the NetBeans team what are the features they rely on that the default parser couldn't provide. In the meantime, we're making this fix so that existing NetBeans continue to work properly when 7u40 is used. > > Here's an updated webrev (test included): > http://cr.openjdk.java.net/~joehw/7u40/8021148/webrev/ > > Thanks, > Joe > > On 7/24/2013 3:41 AM, Lance Andersen - Oracle wrote: >> Agree with the change and making fSecurityPropertyMgr final >> >> Best >> Lance >> On Jul 24, 2013, at 5:04 AM, chris Hegarty wrote: >> >>> Joe, >>> >>> I can see in SAXParserImpl constructor, setFeature0 could throw, leaving the fSecurityPropertyMgr uninitialized. There my be other code paths too. >>> >>> I agree with this change, and Daniel's comments to make both fSecurityPropertyMgr fields final. Consider it reviewed ( at least on my side ). >>> >>> -Chris. >>> >>> On 24/07/2013 07:59, huizhe wang wrote: >>>> On 7/23/2013 11:00 PM, Daniel Fuchs wrote: >>>>> Hi Joe, >>>>> >>>>> This looks reasonable. >>>>> Out of curiosity - could it be that it was fSAXParser that was null, >>>>> and not fSecurityPropertyMgr? >>>>> JAXPSAXParser has a no arg public constructor that could have lead to >>>>> that... >>>> That was my suspicion as well. I thought NetBeans was referencing the >>>> internal class directly since the new JAXPSAXParser(this) inside >>>> SAXParserImpl was the only call in the entire jaxp code. I was therefore >>>> thinking it really should have been a private class. Of course, once >>>> NetBeans bugzilla became accessible (it was down at the time), I was >>>> able to get the error stacktrace. >>>> >>>> There is still something strange since XMLReaderManager.getXMLReader >>>> calls XMLReaderFactory which should have returned SAXParser since it's >>>> hardcoded default. In a manual test, I could only get a JAXPSAXParser if >>>> I intentionally set "org.xml.sax.driver" to a "bogus parser". I'm asking >>>> the NetBeans reporter and haven't heard from him yet. >>>> >>>>> I have only one remark: >>>>> >>>>> It looks as if fSecurityPropertyMgr could be declared final in both >>>>> classes - and I think it >>>>> would be better if it were: it would make it clear that it's never >>>>> replaced in fSAXParser >>>>> and that therefore your new code is strictly equivalent to the old in >>>>> that respect. >>>> Make sense. >>>> >>>> Thanks, >>>> Joe >>>> >>>>> best regards, >>>>> >>>>> -- daniel >>>>> >>>>> On 7/24/13 4:01 AM, huizhe wang wrote: >>>>>> Hi Lance, Chris, >>>>>> >>>>>> Looking at the affected class [1], and the error stack trace [2] , it >>>>>> appeared that in SAXParserImpl$JAXPSAXParser , line 545, >>>>>> fSAXParser.fSecurityPropertyMgr is null when setProperty is called. >>>>>> fSecurityPropertyMgr was instantiated in SAXParserImpl's constructor >>>>>> after JAXPSAXParser was. I can see a chance where the NetBeans got a >>>>>> copy of JAXPSAXParser instance with fSecurityPropertyMgr not >>>>>> initialized. The fix is to remove the reference of >>>>>> fSecurityPropertyMgr in JAXPSAXParser, and pass it in when >>>>>> JAXPSAXParser is created. >>>>>> >>>>>> Here is the webrev: >>>>>> http://cr.openjdk.java.net/~joehw/7u40/8021148/webrev/ >>>>>> >>>>>> [1] >>>>>> http://cr.openjdk.java.net/~joehw/7u40/8021148/webrev/src/com/sun/org/apache/xerces/internal/jaxp/SAXParserImpl.java.html >>>>>> >>>>>> [2] >>>>>> >>>>>> Caused by: java.lang.NullPointerException >>>>>> at >>>>>> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.access$300(SAXParserImpl.java:69) >>>>>> >>>>>> at >>>>>> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.setProperty(SAXParserImpl.java:545) >>>>>> >>>>>> at >>>>>> com.sun.org.apache.xml.internal.utils.XMLReaderManager.getXMLReader(XMLReaderManager.java:161) >>>>>> >>>>>> at >>>>>> com.sun.org.apache.xml.internal.dtm.ref.DTMManagerDefault.getXMLReader(DTMManagerDefault.java:613) >>>>>> >>>>>> at >>>>>> com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager.getDTM(XSLTCDTMManager.java:401) >>>>>> >>>>>> at >>>>>> com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager.getDTM(XSLTCDTMManager.java:252) >>>>>> >>>>>> at >>>>>> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.getDOM(TransformerImpl.java:559) >>>>>> >>>>>> ... 43 more >>>>>> --------- >>>>>> javax.xml.transform.TransformerException: java.lang.NullPointerException >>>>>> at >>>>>> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.getDOM(TransformerImpl.java:581) >>>>>> >>>>>> at >>>>>> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:742) >>>>>> >>>>>> at >>>>>> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:353) >>>>>> >>>>>> at >>>>>> org.netbeans.spi.project.support.ant.GeneratedFilesHelper$1$1.run(GeneratedFilesHelper.java:332) >>>>>> >>>>>> >>>>>> Thanks, >>>>>> Joe >>>>>> >> >> >> Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 >> Oracle Java Engineering >> 1 Network Drive >> Burlington, MA 01803 >> Lance.Andersen at oracle.com >> > Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 Oracle Java Engineering 1 Network Drive Burlington, MA 01803 Lance.Andersen at oracle.com From heliofrota at gmail.com Thu Jul 25 11:12:20 2013 From: heliofrota at gmail.com (Helio Frota) Date: Thu, 25 Jul 2013 08:12:20 -0300 Subject: Build error with GCC4.8 on Fedora19 In-Reply-To: References: <20130709045501.4D23E3B6274@msgw008-05.ocn.ad.jp> <51DBA3CD.9020605@oracle.com> <51DBBE7C.6070801@oracle.com> <51DDAF72.4000909@redhat.com> <51F01E07.3070808@oracle.com> <51F030E1.6090407@redhat.com> <51F038A3.1010001@redhat.com> Message-ID: Hi Omair and Alan, I get this error: In file included from /home/hf/adopt_openjdk/openjdk8/build/linux-x86-normal-server-release/jdk/gensrc_x11wrappers/sizer.32.c:11:0: /home/hf/adopt_openjdk/openjdk8/jdk/src/solaris/native/sun/awt/awt_p.h:44:27: fatal error: X11/Intrinsic.h: No such file or directory #include ^ compilation terminated. gmake[2]: *** [/home/hf/adopt_openjdk/openjdk8/build/linux-x86-normal-server-release/jdk/gensrc_x11wrappers/sizer.32.exe] Error 1 gmake[2]: *** Waiting for unfinished jobs.... gmake[1]: *** [gensrc-only] Error 2 make: *** [jdk-only] Error 2 Omair thanks for the tip "make DEBUG_BINARIES=true all" works. Regards, Helio 2013/7/24 Helio Frota > Hi Omair, > > > The only problem is that modern gcc versions don't produce stabs either. > Try: > $ make DEBUG_BINARIES=true all > > Thanks for the tip ! > > I will try again tomorrow on job (fedora19) machine. > > Regards, > Helio > > > > 2013/7/24 Omair Majid > >> On 07/24/2013 04:11 PM, Helio Frota wrote: >> > Hi, >> > >> > I got the same problem with GCC 4.8.1 and Manjaro distribution ( distro >> > son of archlinux ) >> > >> > Generating precompiled header precompiled.hpp.gch >> > cc1plus: error: the "stabs" debug format cannot be used with >> > pre-compiled headers [-Werror=deprecated] >> > cc1plus: all warnings being treated as errors >> > gmake[6]: *** [precompiled.hpp.gch] Error 1 >> > gmake[5]: *** [the_vm] Error 2 >> > gmake[4]: *** [product] Error 2 >> > gmake[3]: *** [generic_build2] Error 2 >> > gmake[2]: *** [product] Error 2 >> > gmake[1]: *** >> > >> [/home/hf/adopt_openjdk/openjdk8/build/linux-x86-normal-server-release/hotspot/_hotspot.timestamp] >> > Error 2 >> > make: *** [hotspot-only] Error 2 >> >> from hotspot/make/linux/makefiles/gcc.make: >> >> # DEBUG_BINARIES uses full -g debug information for all configs >> ifeq ($(DEBUG_BINARIES), true) >> CFLAGS += -g >> else >> # Use the stabs format for debugging information (this is the default >> # on gcc-2.91). It's good enough, has all the information about line >> # numbers and local variables, and libjvm.so is only about 16M. >> # Change this back to "-g" if you want the most expressive format. >> # (warning: that could easily inflate libjvm.so to 150M!) >> >> The only problem is that modern gcc versions don't produce stabs either. >> >> Try: >> >> $ make DEBUG_BINARIES=true all >> >> Cheers, >> Omair >> >> -- >> PGP Key: 66484681 (http://pgp.mit.edu/) >> Fingerprint = F072 555B 0A17 3957 4E95 0056 F286 F14F 6648 4681 >> > > > > -- > Helio Frota > JUG Leader - CEJUG > http://www.cejug.org/ > http://www.linkedin.com/in/heliofrota > > > -- Helio Frota JUG Leader - CEJUG http://www.cejug.org/ http://www.linkedin.com/in/heliofrota From heliofrota at gmail.com Thu Jul 25 11:52:44 2013 From: heliofrota at gmail.com (Helio Frota) Date: Thu, 25 Jul 2013 08:52:44 -0300 Subject: Build error with GCC4.8 on Fedora19 In-Reply-To: References: <20130709045501.4D23E3B6274@msgw008-05.ocn.ad.jp> <51DBA3CD.9020605@oracle.com> <51DBBE7C.6070801@oracle.com> <51DDAF72.4000909@redhat.com> <51F01E07.3070808@oracle.com> <51F030E1.6090407@redhat.com> <51F038A3.1010001@redhat.com> Message-ID: Hi sudo yum install libXt-devel solve the dependency problem. but i get other... cc1: all warnings being treated as errors gmake[2]: *** [/home/hf/adopt_openjdk/openjdk8/build/linux-x86-normal-server-release/jdk/objs/libsctp/SctpChannelImpl.o] Error 1 gmake[2]: *** Waiting for unfinished jobs.... cc1: all warnings being treated as errors gmake[2]: *** [/home/hf/adopt_openjdk/openjdk8/build/linux-x86-normal-server-release/jdk/objs/libsctp/SctpNet.o] Error 1 gmake[1]: *** [libs-only] Error 2 make: *** [jdk-only] Error 2 is right disable warnings treated as errors ? Regards, Helio 2013/7/25 Helio Frota > Hi Omair and Alan, > > > I get this error: > > In file included from > /home/hf/adopt_openjdk/openjdk8/build/linux-x86-normal-server-release/jdk/gensrc_x11wrappers/sizer.32.c:11:0: > /home/hf/adopt_openjdk/openjdk8/jdk/src/solaris/native/sun/awt/awt_p.h:44:27: > fatal error: X11/Intrinsic.h: No such file or directory > #include > ^ > compilation terminated. > gmake[2]: *** > [/home/hf/adopt_openjdk/openjdk8/build/linux-x86-normal-server-release/jdk/gensrc_x11wrappers/sizer.32.exe] > Error 1 > gmake[2]: *** Waiting for unfinished jobs.... > gmake[1]: *** [gensrc-only] Error 2 > > make: *** [jdk-only] Error 2 > > Omair thanks for the tip "make DEBUG_BINARIES=true all" works. > > Regards, > Helio > > > > 2013/7/24 Helio Frota > >> Hi Omair, >> >> >> The only problem is that modern gcc versions don't produce stabs either. >> Try: >> $ make DEBUG_BINARIES=true all >> >> Thanks for the tip ! >> >> I will try again tomorrow on job (fedora19) machine. >> >> Regards, >> Helio >> >> >> >> 2013/7/24 Omair Majid >> >>> On 07/24/2013 04:11 PM, Helio Frota wrote: >>> > Hi, >>> > >>> > I got the same problem with GCC 4.8.1 and Manjaro distribution ( distro >>> > son of archlinux ) >>> > >>> > Generating precompiled header precompiled.hpp.gch >>> > cc1plus: error: the "stabs" debug format cannot be used with >>> > pre-compiled headers [-Werror=deprecated] >>> > cc1plus: all warnings being treated as errors >>> > gmake[6]: *** [precompiled.hpp.gch] Error 1 >>> > gmake[5]: *** [the_vm] Error 2 >>> > gmake[4]: *** [product] Error 2 >>> > gmake[3]: *** [generic_build2] Error 2 >>> > gmake[2]: *** [product] Error 2 >>> > gmake[1]: *** >>> > >>> [/home/hf/adopt_openjdk/openjdk8/build/linux-x86-normal-server-release/hotspot/_hotspot.timestamp] >>> > Error 2 >>> > make: *** [hotspot-only] Error 2 >>> >>> from hotspot/make/linux/makefiles/gcc.make: >>> >>> # DEBUG_BINARIES uses full -g debug information for all configs >>> ifeq ($(DEBUG_BINARIES), true) >>> CFLAGS += -g >>> else >>> # Use the stabs format for debugging information (this is the default >>> # on gcc-2.91). It's good enough, has all the information about line >>> # numbers and local variables, and libjvm.so is only about 16M. >>> # Change this back to "-g" if you want the most expressive format. >>> # (warning: that could easily inflate libjvm.so to 150M!) >>> >>> The only problem is that modern gcc versions don't produce stabs either. >>> >>> Try: >>> >>> $ make DEBUG_BINARIES=true all >>> >>> Cheers, >>> Omair >>> >>> -- >>> PGP Key: 66484681 (http://pgp.mit.edu/) >>> Fingerprint = F072 555B 0A17 3957 4E95 0056 F286 F14F 6648 4681 >>> >> >> >> >> -- >> Helio Frota >> JUG Leader - CEJUG >> http://www.cejug.org/ >> http://www.linkedin.com/in/heliofrota >> >> >> > > > -- > Helio Frota > JUG Leader - CEJUG > http://www.cejug.org/ > http://www.linkedin.com/in/heliofrota > > > -- Helio Frota JUG Leader - CEJUG http://www.cejug.org/ http://www.linkedin.com/in/heliofrota From roger.riggs at oracle.com Thu Jul 25 13:42:22 2013 From: roger.riggs at oracle.com (roger riggs) Date: Thu, 25 Jul 2013 09:42:22 -0400 Subject: RFR [8020669] java.nio.file.Files.readAllBytes() does not read any data when Files.size() is 0 In-Reply-To: <51F06789.1050403@oracle.com> References: <51E97416.20506@oracle.com> <51E98043.6030102@oracle.com> <51E9853E.8020409@redhat.com> <51E985AD.60401@redhat.com> <51EB0BFF.3030106@oracle.com> <51ED57D8.90001@oracle.com> <51EE55AC.5000902@oracle.com> <51EE8E9A.6040806@redhat.com> <51EF1B43.9030200@oracle.com> <51F06789.1050403@oracle.com> Message-ID: <51F12B3E.4010603@oracle.com> Hi Ivan, Thank you for your diligence. 1) Should the test use an alternate mechanism to read the file (FileInputStream) and confirm the length of the array? 2) There is an edge case where the file size is between MAX_ARRAY_SIZE and Integer.MAX_VALUE that should be avoided. The lines at L3022 are confusing. If the max array size is MAX_BUFFER_SIZE then it should be used also at L3063 in readAllBytes. L3015-3026: The logic around the 3 nested if's is a bit confusing for the actions being taken. By switching to a long for newCapacity this can be easier to read. if (capacity == MAX_INTEGER) { throw ... } long newCapacity = ((long)capacity) << 1; newCapacity = Math.max(newCapacity, BUFFER_SIZE); // at least BUFFER_SIZE newCapacity = Math.min(newCapacity, MAX_BUFFER_SIZE); // at most MAX_BUFFER_SIZE capacity = (int) newCapacity; buf = Arrays.copyOf(buf, capacity); buf[nread++] = (byte)n; rem = buf.length - nread; Thanks, Roger BTW, I'm not an official reviewer On 7/24/2013 7:47 PM, Ivan Gerasimov wrote: > Hello everybody! > > Would you please review an updated webrev? > http://cr.openjdk.java.net/~igerasim/8020669/3/webrev/ > > > Thanks in advance, > Ivan > > > On 24.07.2013 23:36, Martin Buchholz wrote: >> Use javadoc style even in private methods. >> s/Read/Reads/ >> Use @param initialSize >> /** >> + * Read all the bytes from an input stream. The {@code initialSize} >> + * parameter indicates the initial size of the byte[] to allocate. >> + */ >> --- >> >> This needs to be tested for an ordinary zero-length file. It looks >> like for the zero case >> + int newCapacity = capacity << 1; >> will infloop not actually increasing the buffer. >> >> --- >> >> You might want to copy this technique from ArrayList et al: >> >> >> /** >> * The maximum size of array to allocate. >> * Some VMs reserve some header words in an array. >> * Attempts to allocate larger arrays may result in >> * OutOfMemoryError: Requested array size exceeds VM limit >> */ >> private static final int MAX_ARRAY_SIZE = Integer.MAX_VALUE - 8; >> >> >> >> >> On Tue, Jul 23, 2013 at 5:09 PM, Ivan Gerasimov >> > wrote: >> >> Would you please take a look at the updated webrev? >> http://cr.openjdk.java.net/~igerasim/8020669/2/webrev/ >> >> >> readAllBytes() was recently (in b93) changed by Alan Bateman to >> fix 8014928. >> >> Here's what I've done: >> - reverted readAllBytes() to its implementation prior b93. >> - modified it to address both 8020669 and 8014928. >> >> http://bugs.sun.com/view_bug.do?bug_id=8020669 >> >> http://bugs.sun.com/view_bug.do?bug_id=8014928 >> >> Sincerely yours, >> Ivan >> >> >> On 23.07.2013 18:09, David M. Lloyd wrote: >> >> Here's how it should behave: >> >> - allocate 'size' byte byte array >> - if size > 0: >> - use simple old I/O to read into the array >> - do a one-byte read(), if not EOF then expand the array, >> using a simple growth pattern like 3/2 (with a special case >> for 0), and continue reading until EOF >> - if the array matches the size of the file, return the >> array, else use copyOf() to shrink it >> >> This way you only ever copy the array size() was wrong. >> >> On 07/23/2013 05:06 AM, Ivan Gerasimov wrote: >> >> Hi Roger! >> >> This is how my implementation behaves: >> - allocate 'size' bytes in BAOS >> - allocate 8k for temp buffer >> - in cycle read 8k or less bytes from input stream and >> copy them into BAOS >> - if capacity of BAOS isn't sufficient (file had grown), >> its buffer will >> be reallocated >> Thus, 1 reallocation and 1 copying of already read data >> on each 8k piece >> of additional bytes. >> >> In normal case, i.e. when fc.size() is correct, we have >> overhead of 1 >> allocation and copying 'size' bytes in size/8k iterations. >> >> And this is how current implementation does >> - allocate 'size' bytes >> - allocate 'size' bytes of native memory for temp buffer >> in IOUtil.read() >> - read the whole file into temp buffer >> - copy the temp buffer back into our buffer >> >> In common when fc.size() is right, we have 1 allocation >> and copying >> 'size' bytes from temp buffer back. >> >> So there is a difference in allocations/copying, but in >> my opinion it's >> not that significant for this particular task. >> >> Sincerely yours, >> Ivan >> >> On 22.07.2013 20:03, roger riggs wrote: >> >> Hi Ivan, >> >> I'm concerned about the change in behavior for the >> existing working >> cases. >> >> How many times are the bytes copied in your proposed >> implementation? >> How many arrays are allocated and discarded? >> Files.copy() uses an extra array for the copies. >> >> BAOS should only be used for size == 0; that would >> address the issue >> without changing the current behavior or allocations. >> >> Roger >> >> >> >> >> On 7/20/2013 6:15 PM, Ivan Gerasimov wrote: >> >> Roger, David thanks for suggestions! >> >> Would you please take a look at an updated webrev? >> http://cr.openjdk.java.net/~igerasim/8020669/1/webrev/ >> >> >> - File size is used as an initial size of BAOS's >> buffer. >> - BAOS avoids copying its buffer in >> toByteArray(), if size is correct . >> >> I don't want to initialize BAOS with a positive >> number if size >> happened to be zero. >> Because zero could indicate that the file is >> really empty. >> >> Sincerely yours, >> Ivan >> >> On 19.07.2013 22:30, David M. Lloyd wrote: >> >> My mistake, we're not talking about strings. >> Still you can subclass >> and determine whether the buffer size guess >> was right, and if so >> return the array as-is (swap in an empty >> array or something as needed). >> >> On 07/19/2013 01:28 PM, David M. Lloyd wrote: >> >> It's trivial to subclass >> ByteArrayOutputStream and add a method which >> converts its contents to a string using >> the two protected fields which >> give you all the info you need to do so. >> So no extra copy is needed >> that you aren't already doing. >> >> On 07/19/2013 01:06 PM, roger riggs wrote: >> >> Hi Ivan, >> >> I think this change takes too big a >> hit for the cases where the >> size is >> correct. >> >> No real file system can be wrong >> about the size of a file so this >> is a >> problem >> only for special file systems. If the >> problem is with size >> reporting zero >> then maybe using the incremental read >> only for size == would be a >> better >> fix. >> >> At least you could pass the size to >> the constructor for BAOS and >> avoid >> the thrashing for every re-size; but >> still it will allocate and >> create >> an extra copy >> of the every time. >> >> $.02, Roger >> >> >> On 7/19/2013 1:15 PM, Ivan Gerasimov >> wrote: >> >> Hello everybody! >> >> Would you please review a fix for >> the problem with >> j.n.f.Files.readAllBytes() function? >> The current implementation relies >> on FileChannel.size() to >> preallocate >> a buffer for the whole file's >> content. >> However, some special filesystems >> can report a wrong size. >> An example is procfs under Linux, >> which reports many files under >> /proc >> to be zero sized. >> >> Thus it is proposed not to rely >> on the size() and instead >> continuously >> read until EOF. >> >> The downside is reallocation and >> copying file content between >> buffers. >> But taking into account that the >> doc says: "It is not intended for >> reading in large files." it >> should not be a big problem. >> >> http://bugs.sun.com/view_bug.do?bug_id=8020669 >> http://cr.openjdk.java.net/~igerasim/8020669/0/webrev/ >> >> >> The fix is for JDK8. If it is >> approved, it can be applied to >> JDK7 as >> well. >> >> Sincerely yours, >> Ivan Gerasimov >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> > From maurizio.cimadamore at oracle.com Thu Jul 25 13:52:31 2013 From: maurizio.cimadamore at oracle.com (maurizio.cimadamore at oracle.com) Date: Thu, 25 Jul 2013 13:52:31 +0000 Subject: hg: jdk8/tl/langtools: 3 new changesets Message-ID: <20130725135244.67F7B4836A@hg.openjdk.java.net> Changeset: 3155e77d2676 Author: mcimadamore Date: 2013-07-25 14:47 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/3155e77d2676 8020804: javac crashes when speculative attribution infers intersection type with array component Summary: Assertion is causing javac to crash because of lack of support for arrays in intersection types Reviewed-by: jjg ! src/share/classes/com/sun/tools/javac/code/Types.java ! src/share/classes/com/sun/tools/javac/comp/Attr.java ! src/share/classes/com/sun/tools/javac/comp/Infer.java + test/tools/javac/lambda/8020804/T8020804.java Changeset: b02f28bf7f1c Author: mcimadamore Date: 2013-07-25 14:49 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/b02f28bf7f1c 8016081: field initialized with lambda in annotation types doesn't compile Summary: check for annotation attributes should skip over synthetic methods Reviewed-by: jjg ! src/share/classes/com/sun/tools/javac/comp/Check.java + test/tools/javac/lambda/8016081/T8016081.java Changeset: dae52d74c1fc Author: mcimadamore Date: 2013-07-25 14:51 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/dae52d74c1fc 8020843: javac crashes on accessibility check with method reference with typevar receiver Summary: method reference overload check doesn't walk through type-variable receivers Reviewed-by: jjg ! src/share/classes/com/sun/tools/javac/comp/Resolve.java ! src/share/classes/com/sun/tools/javac/resources/compiler.properties + test/tools/javac/diags/examples/ReportAccessFragment.java + test/tools/javac/lambda/8020843/T8020843a.java + test/tools/javac/lambda/8020843/T8020843a.out + test/tools/javac/lambda/8020843/T8020843b.java + test/tools/javac/lambda/8020843/T8020843b.out ! test/tools/javac/lambda/MethodReference28.out From dl at cs.oswego.edu Thu Jul 25 14:15:28 2013 From: dl at cs.oswego.edu (Doug Lea) Date: Thu, 25 Jul 2013 10:15:28 -0400 Subject: RFR : 6799426 : (xs) Add constructor PriorityQueue(Comparator) In-Reply-To: References: Message-ID: <51F13300.2080709@cs.oswego.edu> On 07/24/13 19:30, Martin Buchholz wrote: > PriorityQueue is unusual in that Doug maintains a copy in jsr166 CVS even though > it is a non-thread-safe collection. I think it makes sense, > because PriorityQueue and PriorityBlockingQueue have parallel APIs and parallel > implementations. Many changes to one file require a matching change to the other. > The history is that we introduced java.util.concurrent.PriorityBlockingQueue, for JDK1.5 which of course led to people wanting plain java.util.PriorityQueue, which Josh started working on while at Sun. But for sake of JCP approval, we pulled into jsr166 and have adopted ever since, because the two classes share code. The capacity constructor was added in JDK1.6, but I have no recollection why there is not one with comparator but no capacity. It seems reasonable to add one. > Regarding this particular change, if PriorityQueue gets a new constructor taking > a Comparator, then PriorityBlockingQueue probably should too Yes. *** PriorityBlockingQueue.java.~1.99.~ Wed Jul 24 11:23:05 2013 --- PriorityBlockingQueue.java Thu Jul 25 10:13:47 2013 *************** *** 200,205 **** --- 200,219 ---- } /** + * Creates a {@code PriorityBlockingQueue} with the default + * initial capacity that orders its elements according to the + * specified comparator. + * + * @param comparator the comparator that will be used to order this + * priority queue. If {@code null}, the {@linkplain Comparable + * natural ordering} of the elements will be used. + * @since 1.8 + */ + public PriorityBlockingQueue(Comparator comparator) { + this(DEFAULT_INITIAL_CAPACITY, comparator); + } + + /** * Creates a {@code PriorityBlockingQueue} containing the elements * in the specified collection. If the specified collection is a * {@link SortedSet} or a {@link PriorityQueue}, this From joel.franck at oracle.com Thu Jul 25 14:21:44 2013 From: joel.franck at oracle.com (=?windows-1252?Q?Joel_Borggr=E9n-Franck?=) Date: Thu, 25 Jul 2013 16:21:44 +0200 Subject: Code Review Request: More tests for 7184826: (reflect) Add support for Project Lambda concepts in core reflection In-Reply-To: <0805A1F1-E808-428B-ABFE-EC5764A81044@oracle.com> References: <519E2C52.20203@oracle.com> <51B91AA5.6090807@oracle.com> <20130710141722.GA23047@jfranck-desktop.jrpg.bea.com> <51ED2FC9.5040200@oracle.com> <0805A1F1-E808-428B-ABFE-EC5764A81044@oracle.com> Message-ID: <81C32970-7AB6-41FC-B03D-CC79A365A0F4@oracle.com> Hi Dan, Thanks for looking at this, On Jul 23, 2013, at 11:12 PM, Dan Smith wrote: > Hi. > > Per a request from Joel, I've taken a look at DefaultStaticTestData. I don't really have the full context here, but I'm assuming that the annotations get translated into tests that guarantee 1) the result of Class.getMethods is exactly (no more -- excepting Object methods -- and no less) those methods named by MethodDesc annotations; and 2) the result of Class.getDeclaredMethods is exactly (no more, no less) those methods that are marked "declared=YES". This is the intention. Sorry if I was vague on the format, but I suppose this proves it is possible to decipher the expected results even though you lack the full context. cheers /Joel From joel.franck at oracle.com Thu Jul 25 14:25:50 2013 From: joel.franck at oracle.com (=?windows-1252?Q?Joel_Borggr=E9n-Franck?=) Date: Thu, 25 Jul 2013 16:25:50 +0200 Subject: Code Review Request: More tests for 7184826: (reflect) Add support for Project Lambda concepts in core reflection In-Reply-To: <51EF2E32.5080301@oracle.com> References: <519E2C52.20203@oracle.com> <51B91AA5.6090807@oracle.com> <20130710141722.GA23047@jfranck-desktop.jrpg.bea.com> <51ED2FC9.5040200@oracle.com> <0805A1F1-E808-428B-ABFE-EC5764A81044@oracle.com> <51EF2E32.5080301@oracle.com> Message-ID: Hi Amy, On Jul 24, 2013, at 3:30 AM, Amy Lu wrote: > Thank you Dan ! > > Please see my comments inline... > > On 7/24/13 5:12 AM, Dan Smith wrote: >> Hi. >> >> Per a request from Joel, I've taken a look at DefaultStaticTestData. I don't really have the full context here, but I'm assuming that the annotations get translated into tests that guarantee 1) the result of Class.getMethods is exactly (no more -- excepting Object methods -- and no less) those methods named by MethodDesc annotations; and 2) the result of Class.getDeclaredMethods is exactly (no more, no less) those methods that are marked "declared=YES". >> >> The expected results seem accurate. I would personally focus testing more on different inheritance shapes and less on different combinations of (unrelated) method declarations or presence/absence type variables (!?), but it's a valid test in any case. >> >> There ought to be some testing for scenarios that javac won't generate, like conflicting default method declarations. >> > Testing on "javac" is out of this scope, it's covered by langtools tests, say test/tools/javac/defaultMethods/ I sort of agree with Dan here. This wouldn't be testing of javac, rather testing that Core Reflection works for combinations that javac doesn't currently emit. However I think that is an excellent candidate for a follow up test, we can address that after these test are finished. I will file a bug for this. cheers /Joel From paul.sandoz at oracle.com Thu Jul 25 14:33:46 2013 From: paul.sandoz at oracle.com (Paul Sandoz) Date: Thu, 25 Jul 2013 15:33:46 +0100 Subject: Possible HashMap update In-Reply-To: <51DAD99F.9030705@cs.oswego.edu> References: <51D4ABDA.7010801@cs.oswego.edu> <51DAD99F.9030705@cs.oswego.edu> Message-ID: On Jul 8, 2013, at 4:24 PM, Doug Lea

                                            wrote: > > On 07/05/13 04:55, Paul Sandoz wrote: >>> I played with these in the lambda repo. >>> >>> I needed to make the following additional change for things to compile: >>> >>> --- a/src/share/classes/java/io/ExpiringCache.java Fri Jul 05 10:04:00 2013 +0200 >>> +++ b/src/share/classes/java/io/ExpiringCache.java Fri Jul 05 10:45:10 2013 +0200 >>> ... > > Thanks to those chasing this down, now recorded as a CR at: > http://bugs.sun.com/view_bug.do?bug_id=8017219 > > Some might think this is a fun javac corner case to read about, > but for present purposes, the moral is that the name of > the internal LinkedHashMap.Entry class, even though it is never > exported, cannot be changed without impacting re-compilability of > some external usages. Fine. We can cope. > > For people still following along, see updates at... > > http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/src/dl/java/util/HashMap.java?view=log > > http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/src/dl/java/util/LinkedHashMap.java?view=log I gave the updates another test drive in the lamba repo. All looks OK. Paul. From huizhe.wang at oracle.com Thu Jul 25 16:06:41 2013 From: huizhe.wang at oracle.com (huizhe wang) Date: Thu, 25 Jul 2013 09:06:41 -0700 Subject: RFR: JAXP in JDK8/7u40 : 8021148 Regression in SAXParserImpl in 7u40 b34 (NPE) In-Reply-To: <51F0DC97.5010000@oracle.com> References: <51EF3596.7010602@oracle.com> <51EF6D98.4030804@oracle.com> <51EF7B38.4080903@oracle.com> <51EF988E.3080304@oracle.com> <799C1DF4-E39B-4E7D-A346-A4AD96660180@oracle.com> <51F0C61F.7020306@oracle.com> <51F0D643.6060004@oracle.com> <51F0DC97.5010000@oracle.com> Message-ID: <51F14D11.9070803@oracle.com> On 7/25/2013 1:06 AM, Chris Hegarty wrote: > On 07/25/2013 08:39 AM, Daniel Fuchs wrote: >> Hi Joe, >> >> Looks good. > +1 > >> >> Small nit: you could keep fSecurityPropertyManager final by using: >> >> if (spm != null) { >> fSecurityPropertyManager = spm; >> } else { >> fSecurityPropertyManager = new ... >> ... >> } >> >> Don't feel obliged to do it though - your fix is good as it is. > +1 > > Additionally, and don't feel obliged either, the (fSecurityPropertyMgr > != null) is no longer needed, since this can never be the case. Though > I do understand that you may not want to take any chances ;-) That was exactly what went through my mind :-) Two bugs reported against the update to jaxp 1.5, both related to NPE. > > For JDK8, in the future, I think you should remove this constructor. > NetBeans can do the right thing to support a new major release. I haven't heard from NetBeans regarding this. But yes, I'll create a bug report and ccc request to change the inner class to private and remove the constructor. -Joe > > -Chris. >> >> best regards, >> >> -- daniel >> >> On 7/25/13 8:30 AM, huizhe wang wrote: >>> I received test from the NetBeans team. The NetBeans did reference the >>> internal JAXPSAXParser directly. This is not a usage supported by the >>> spec. I would suggest them remove it and use the default parser >>> instead. I'm asking the NetBeans team what are the features they rely >>> on that the default parser couldn't provide. In the meantime, we're >>> making this fix so that existing NetBeans continue to work properly >>> when 7u40 is used. >>> >>> Here's an updated webrev (test included): >>> http://cr.openjdk.java.net/~joehw/7u40/8021148/webrev/ >>> >>> Thanks, >>> Joe >>> >>> On 7/24/2013 3:41 AM, Lance Andersen - Oracle wrote: >>>> Agree with the change and making fSecurityPropertyMgr final >>>> >>>> Best >>>> Lance >>>> On Jul 24, 2013, at 5:04 AM, chris Hegarty wrote: >>>> >>>>> Joe, >>>>> >>>>> I can see in SAXParserImpl constructor, setFeature0 could throw, >>>>> leaving the fSecurityPropertyMgr uninitialized. There my be other >>>>> code paths too. >>>>> >>>>> I agree with this change, and Daniel's comments to make both >>>>> fSecurityPropertyMgr fields final. Consider it reviewed ( at least >>>>> on my side ). >>>>> >>>>> -Chris. >>>>> >>>>> On 24/07/2013 07:59, huizhe wang wrote: >>>>>> On 7/23/2013 11:00 PM, Daniel Fuchs wrote: >>>>>>> Hi Joe, >>>>>>> >>>>>>> This looks reasonable. >>>>>>> Out of curiosity - could it be that it was fSAXParser that was >>>>>>> null, >>>>>>> and not fSecurityPropertyMgr? >>>>>>> JAXPSAXParser has a no arg public constructor that could have >>>>>>> lead to >>>>>>> that... >>>>>> That was my suspicion as well. I thought NetBeans was referencing >>>>>> the >>>>>> internal class directly since the new JAXPSAXParser(this) inside >>>>>> SAXParserImpl was the only call in the entire jaxp code. I was >>>>>> therefore >>>>>> thinking it really should have been a private class. Of course, once >>>>>> NetBeans bugzilla became accessible (it was down at the time), I was >>>>>> able to get the error stacktrace. >>>>>> >>>>>> There is still something strange since XMLReaderManager.getXMLReader >>>>>> calls XMLReaderFactory which should have returned SAXParser since >>>>>> it's >>>>>> hardcoded default. In a manual test, I could only get a >>>>>> JAXPSAXParser if >>>>>> I intentionally set "org.xml.sax.driver" to a "bogus parser". I'm >>>>>> asking >>>>>> the NetBeans reporter and haven't heard from him yet. >>>>>> >>>>>>> I have only one remark: >>>>>>> >>>>>>> It looks as if fSecurityPropertyMgr could be declared final in both >>>>>>> classes - and I think it >>>>>>> would be better if it were: it would make it clear that it's never >>>>>>> replaced in fSAXParser >>>>>>> and that therefore your new code is strictly equivalent to the >>>>>>> old in >>>>>>> that respect. >>>>>> Make sense. >>>>>> >>>>>> Thanks, >>>>>> Joe >>>>>> >>>>>>> best regards, >>>>>>> >>>>>>> -- daniel >>>>>>> >>>>>>> On 7/24/13 4:01 AM, huizhe wang wrote: >>>>>>>> Hi Lance, Chris, >>>>>>>> >>>>>>>> Looking at the affected class [1], and the error stack trace [2] >>>>>>>> , it >>>>>>>> appeared that in SAXParserImpl$JAXPSAXParser , line 545, >>>>>>>> fSAXParser.fSecurityPropertyMgr is null when setProperty is >>>>>>>> called. >>>>>>>> fSecurityPropertyMgr was instantiated in SAXParserImpl's >>>>>>>> constructor >>>>>>>> after JAXPSAXParser was. I can see a chance where the NetBeans >>>>>>>> got a >>>>>>>> copy of JAXPSAXParser instance with fSecurityPropertyMgr not >>>>>>>> initialized. The fix is to remove the reference of >>>>>>>> fSecurityPropertyMgr in JAXPSAXParser, and pass it in when >>>>>>>> JAXPSAXParser is created. >>>>>>>> >>>>>>>> Here is the webrev: >>>>>>>> http://cr.openjdk.java.net/~joehw/7u40/8021148/webrev/ >>>>>>>> >>>>>>>> [1] >>>>>>>> http://cr.openjdk.java.net/~joehw/7u40/8021148/webrev/src/com/sun/org/apache/xerces/internal/jaxp/SAXParserImpl.java.html >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> [2] >>>>>>>> >>>>>>>> Caused by: java.lang.NullPointerException >>>>>>>> at >>>>>>>> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.access$300(SAXParserImpl.java:69) >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> at >>>>>>>> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.setProperty(SAXParserImpl.java:545) >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> at >>>>>>>> com.sun.org.apache.xml.internal.utils.XMLReaderManager.getXMLReader(XMLReaderManager.java:161) >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> at >>>>>>>> com.sun.org.apache.xml.internal.dtm.ref.DTMManagerDefault.getXMLReader(DTMManagerDefault.java:613) >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> at >>>>>>>> com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager.getDTM(XSLTCDTMManager.java:401) >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> at >>>>>>>> com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager.getDTM(XSLTCDTMManager.java:252) >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> at >>>>>>>> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.getDOM(TransformerImpl.java:559) >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> ... 43 more >>>>>>>> --------- >>>>>>>> javax.xml.transform.TransformerException: >>>>>>>> java.lang.NullPointerException >>>>>>>> at >>>>>>>> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.getDOM(TransformerImpl.java:581) >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> at >>>>>>>> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:742) >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> at >>>>>>>> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:353) >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> at >>>>>>>> org.netbeans.spi.project.support.ant.GeneratedFilesHelper$1$1.run(GeneratedFilesHelper.java:332) >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> Thanks, >>>>>>>> Joe >>>>>>>> >>>> >>>> >>>> Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 >>>> Oracle Java Engineering >>>> 1 Network Drive >>>> Burlington, MA 01803 >>>> Lance.Andersen at oracle.com >>>> >>> >> From huizhe.wang at oracle.com Thu Jul 25 16:07:11 2013 From: huizhe.wang at oracle.com (huizhe wang) Date: Thu, 25 Jul 2013 09:07:11 -0700 Subject: RFR: JAXP in JDK8/7u40 : 8021148 Regression in SAXParserImpl in 7u40 b34 (NPE) In-Reply-To: References: <51EF3596.7010602@oracle.com> <51EF6D98.4030804@oracle.com> <51EF7B38.4080903@oracle.com> <51EF988E.3080304@oracle.com> <799C1DF4-E39B-4E7D-A346-A4AD96660180@oracle.com> <51F0C61F.7020306@oracle.com> Message-ID: <51F14D2F.5030408@oracle.com> Thanks! Joe On 7/25/2013 3:25 AM, Lance Andersen - Oracle wrote: > looks fine Joe > On Jul 25, 2013, at 2:30 AM, huizhe wang wrote: > >> I received test from the NetBeans team. The NetBeans did reference >> the internal JAXPSAXParser directly. This is not a usage supported by >> the spec. I would suggest them remove it and use the default parser >> instead. I'm asking the NetBeans team what are the features they rely >> on that the default parser couldn't provide. In the meantime, we're >> making this fix so that existing NetBeans continue to work properly >> when 7u40 is used. >> >> Here's an updated webrev (test included): >> http://cr.openjdk.java.net/~joehw/7u40/8021148/webrev/ >> >> Thanks, >> Joe >> >> On 7/24/2013 3:41 AM, Lance Andersen - Oracle wrote: >>> Agree with the change and making fSecurityPropertyMgr final >>> >>> Best >>> Lance >>> On Jul 24, 2013, at 5:04 AM, chris Hegarty wrote: >>> >>>> Joe, >>>> >>>> I can see in SAXParserImpl constructor, setFeature0 could throw, leaving the fSecurityPropertyMgr uninitialized. There my be other code paths too. >>>> >>>> I agree with this change, and Daniel's comments to make both fSecurityPropertyMgr fields final. Consider it reviewed ( at least on my side ). >>>> >>>> -Chris. >>>> >>>> On 24/07/2013 07:59, huizhe wang wrote: >>>>> On 7/23/2013 11:00 PM, Daniel Fuchs wrote: >>>>>> Hi Joe, >>>>>> >>>>>> This looks reasonable. >>>>>> Out of curiosity - could it be that it was fSAXParser that was null, >>>>>> and not fSecurityPropertyMgr? >>>>>> JAXPSAXParser has a no arg public constructor that could have lead to >>>>>> that... >>>>> That was my suspicion as well. I thought NetBeans was referencing the >>>>> internal class directly since the new JAXPSAXParser(this) inside >>>>> SAXParserImpl was the only call in the entire jaxp code. I was therefore >>>>> thinking it really should have been a private class. Of course, once >>>>> NetBeans bugzilla became accessible (it was down at the time), I was >>>>> able to get the error stacktrace. >>>>> >>>>> There is still something strange since XMLReaderManager.getXMLReader >>>>> calls XMLReaderFactory which should have returned SAXParser since it's >>>>> hardcoded default. In a manual test, I could only get a JAXPSAXParser if >>>>> I intentionally set "org.xml.sax.driver" to a "bogus parser". I'm asking >>>>> the NetBeans reporter and haven't heard from him yet. >>>>> >>>>>> I have only one remark: >>>>>> >>>>>> It looks as if fSecurityPropertyMgr could be declared final in both >>>>>> classes - and I think it >>>>>> would be better if it were: it would make it clear that it's never >>>>>> replaced in fSAXParser >>>>>> and that therefore your new code is strictly equivalent to the old in >>>>>> that respect. >>>>> Make sense. >>>>> >>>>> Thanks, >>>>> Joe >>>>> >>>>>> best regards, >>>>>> >>>>>> -- daniel >>>>>> >>>>>> On 7/24/13 4:01 AM, huizhe wang wrote: >>>>>>> Hi Lance, Chris, >>>>>>> >>>>>>> Looking at the affected class [1], and the error stack trace [2] , it >>>>>>> appeared that in SAXParserImpl$JAXPSAXParser , line 545, >>>>>>> fSAXParser.fSecurityPropertyMgr is null when setProperty is called. >>>>>>> fSecurityPropertyMgr was instantiated in SAXParserImpl's constructor >>>>>>> after JAXPSAXParser was. I can see a chance where the NetBeans got a >>>>>>> copy of JAXPSAXParser instance with fSecurityPropertyMgr not >>>>>>> initialized. The fix is to remove the reference of >>>>>>> fSecurityPropertyMgr in JAXPSAXParser, and pass it in when >>>>>>> JAXPSAXParser is created. >>>>>>> >>>>>>> Here is the webrev: >>>>>>> http://cr.openjdk.java.net/~joehw/7u40/8021148/webrev/ >>>>>>> >>>>>>> [1] >>>>>>> http://cr.openjdk.java.net/~joehw/7u40/8021148/webrev/src/com/sun/org/apache/xerces/internal/jaxp/SAXParserImpl.java.html >>>>>>> >>>>>>> [2] >>>>>>> >>>>>>> Caused by: java.lang.NullPointerException >>>>>>> at >>>>>>> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.access$300(SAXParserImpl.java:69) >>>>>>> >>>>>>> at >>>>>>> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.setProperty(SAXParserImpl.java:545) >>>>>>> >>>>>>> at >>>>>>> com.sun.org.apache.xml.internal.utils.XMLReaderManager.getXMLReader(XMLReaderManager.java:161) >>>>>>> >>>>>>> at >>>>>>> com.sun.org.apache.xml.internal.dtm.ref.DTMManagerDefault.getXMLReader(DTMManagerDefault.java:613) >>>>>>> >>>>>>> at >>>>>>> com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager.getDTM(XSLTCDTMManager.java:401) >>>>>>> >>>>>>> at >>>>>>> com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager.getDTM(XSLTCDTMManager.java:252) >>>>>>> >>>>>>> at >>>>>>> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.getDOM(TransformerImpl.java:559) >>>>>>> >>>>>>> ... 43 more >>>>>>> --------- >>>>>>> javax.xml.transform.TransformerException: java.lang.NullPointerException >>>>>>> at >>>>>>> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.getDOM(TransformerImpl.java:581) >>>>>>> >>>>>>> at >>>>>>> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:742) >>>>>>> >>>>>>> at >>>>>>> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:353) >>>>>>> >>>>>>> at >>>>>>> org.netbeans.spi.project.support.ant.GeneratedFilesHelper$1$1.run(GeneratedFilesHelper.java:332) >>>>>>> >>>>>>> >>>>>>> Thanks, >>>>>>> Joe >>>>>>> >>> >>> >>> Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 >>> Oracle Java Engineering >>> 1 Network Drive >>> Burlington, MA 01803 >>> Lance.Andersen at oracle.com >>> >> > > > Lance > Andersen| Principal Member of Technical Staff | +1.781.442.2037 > Oracle Java Engineering > 1 Network Drive > Burlington, MA 01803 > Lance.Andersen at oracle.com > From joe.darcy at oracle.com Thu Jul 25 16:13:19 2013 From: joe.darcy at oracle.com (Joe Darcy) Date: Thu, 25 Jul 2013 09:13:19 -0700 Subject: RFR doclint issues in java.net In-Reply-To: <9288E251-9A4E-43C4-AB60-622462CDE427@oracle.com> References: <51F0F752.3080301@oracle.com> <9288E251-9A4E-43C4-AB60-622462CDE427@oracle.com> Message-ID: <51F14E9F.6080809@oracle.com> FWIW, I've filed a bug against doclint to allow ordered lists of the form
                                              JDK-8021324 [doclint] Doclint need not warn over use of ordered lists with styles In any case, the changes below look fine to go back; if you want to leave the
                                                in java.net, that would be fine by me too. Thanks, -Joe On 07/25/2013 03:16 AM, Lance Andersen - Oracle wrote: > Good to go > On Jul 25, 2013, at 6:00 AM, Chris Hegarty wrote: > >> This is a request for review for some doclint warnings in the java.net package. Trivially, the list type should be left to the CSS. >> >> Note: with these changes there are still warnings for two DatagramPacket constructors that are missing @throws for SocketException. I do not see any reason that these constructors need to throw SE, and I will file a separate bug to follow up. >> >> diff -r fd1b5adcfdf0 src/share/classes/java/net/URI.java >> --- a/src/share/classes/java/net/URI.java Wed Jul 24 22:52:01 2013 +0100 >> +++ b/src/share/classes/java/net/URI.java Thu Jul 25 10:56:25 2013 +0100 >> @@ -530,7 +530,7 @@ public final class URI >> * href="http://www.ietf.org/rfc/rfc2396.txt">RFC 2396, >> * Appendix A, except for the following deviations:

                                                >> * >> - *
                                                  >> + *
                                                    >> * >> *
                                                  • An empty authority component is permitted as long as it is >> * followed by a non-empty path, a query component, or a fragment >> @@ -993,7 +993,7 @@ public final class URI >> *

                                                  • Otherwise the new URI's authority component is copied from >> * this URI, and its path is computed as follows:

                                                    >> * >> - *
                                                      >> + *
                                                        >> * >> *
                                                      1. If the given URI's path is absolute then the new URI's path >> * is taken from the given URI.

                                                      2. >> @@ -1241,7 +1241,7 @@ public final class URI >> *

                                                        The host component of a URI, if defined, will have one of the >> * following forms:

                                                        >> * >> - *
                                                          >> + *
                                                            >> * >> *
                                                          • A domain name consisting of one or more labels >> * separated by period characters ('.'), optionally followed by >> @@ -1495,7 +1495,7 @@ public final class URI >> * >> *

                                                            The ordering of URIs is defined as follows:

                                                            >> * >> - *
                                                              >> + *
                                                                >> * >> *
                                                              • Two URIs with different schemes are ordered according the >> * ordering of their schemes, without regard to case.

                                                              • >> @@ -1513,7 +1513,7 @@ public final class URI >> *
                                                              • Two hierarchical URIs with identical schemes are ordered >> * according to the ordering of their authority components:

                                                                >> * >> - *
                                                                  >> + *
                                                                    >> * >> *
                                                                  • If both authority components are server-based then the URIs >> * are ordered according to their user-information components; if these >> >> >> -Chris. > > > Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 > Oracle Java Engineering > 1 Network Drive > Burlington, MA 01803 > Lance.Andersen at oracle.com > From rob.mckenna at oracle.com Thu Jul 25 16:17:09 2013 From: rob.mckenna at oracle.com (Rob McKenna) Date: Thu, 25 Jul 2013 17:17:09 +0100 Subject: Request for Review: 5049299: (process) Use posix_spawn, not fork, on S10 to avoid swap exhaustion In-Reply-To: <51D674B5.7020100@oracle.com> References: <50AE98B1.2040200@oracle.com> <50B81A8D.2040403@oracle.com> <50B82C94.90109@oracle.com> <50D277BE.8060705@oracle.com> <50D65C3F.2040004@oracle.com> <51D2F496.6050400@oracle.com> <51D57B88.3050707@oracle.com> <51D674B5.7020100@oracle.com> Message-ID: <51F14F85.1010601@oracle.com> Thanks a lot Erik, I've added the dependency to the makefile here: http://cr.openjdk.java.net/~robm/5049299/webrev.05/ Is it ok between the ifeq block? Alan, I've altered the launchMechanism code to use valueOf (and lower case names) - much cleaner, thanks for that. I've also limited each platform to supported mechanisms only. With the new layout I don't believe a separate test is needed here. (the default is now posix_spawn/vfork and Basic.java has been altered to run with fork too) -Rob On 05/07/13 08:24, Erik Joelsson wrote: > Build changes are looking pretty good. Just one thing that I would > like to add. Since the executable jspawnhelper is linking in an object > file from libjava, it would be good to declare that dependency. See > unpack200 for a similar situation. > > $(BUILD_JSPAWNHELPER): $(LINK_JSPAWNHELPER_OBJECTS) > > /Erik > > On 2013-07-04 15:41, Rob McKenna wrote: >> Hi Alan, >> >> I've just uploaded the latest changes which rebase the fix to the >> current repo. (required post 8008118) I've also swapped out useFork >> for jdk.lang.Process.launchMechanism. (it affords us the flexibility >> to enable or disable other mechanisms on the various platforms at a >> later date) I have a couple of questions about this: >> >> 1) I'm thinking of including a unit test which will run through the >> various permutations across each platform making sure we fail when >> expected. >> >> 2) Should we simply ignore the flag on Windows or should we throw the >> same error if its provided? >> >> cc'ing Erik for a build review. >> >> http://cr.openjdk.java.net/~robm/5049299/webrev.04/ >> >> -Rob >> >> >> On 02/07/13 16:41, Alan Bateman wrote: >>> On 23/12/2012 01:19, Rob McKenna wrote: >>>> Hi Martin, thanks a lot for this. >>>> >>>> I've renamed LINKFLAG to the more appropriate (and common) >>>> ARCHFLAG. It seems to pop up all around our source but if build-dev >>>> know of a better (or canonical) way of doing it I'll take it! >>>> >>>> The BUILD_JEXEC differences don't show up in my webrev or hg diff, >>>> but I see them in the jdk.patch generated by webrev. I have no idea >>>> why this is. (I did use the JEXEC stuff as a template for the >>>> JSPAWNHELPER code, but I don't recall altering the JEXEC stuff in >>>> any way. It looks like its limited to indentation. Strange.) >>>> >>>> W.r.t. useFork, I'll discuss this with Alan once he has a spare >>>> minute. I believe he may have had some concerns, but I'll let you >>>> know how that goes either way. >>>> >>>> The only __APPLE__ should be to get the call to _NSGetEnviron(). >>>> Everything else should be bsd. >>>> >>>> I've put a webrev at: >>>> >>>> http://cr.openjdk.java.net/~robm/5049299/webrev.03/ >>>> >>>> >>>> I hope this addresses the rest of your comments. >>>> >>>> -Rob >>> Rob - this was great work but I don't think we brought it to a >>> conclusion. Are you planning to re-base the patch and send out a new >>> webrev? >>> >>> -Alan >> From sundararajan.athijegannathan at oracle.com Thu Jul 25 16:21:11 2013 From: sundararajan.athijegannathan at oracle.com (sundararajan.athijegannathan at oracle.com) Date: Thu, 25 Jul 2013 16:21:11 +0000 Subject: hg: jdk8/tl/nashorn: 3 new changesets Message-ID: <20130725162115.0DB0B4836F@hg.openjdk.java.net> Changeset: 5c035c4ccc61 Author: sundar Date: 2013-07-25 14:05 +0530 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/5c035c4ccc61 8021252: invokeMethod throws NoSuchMethodException when script object is from different script context Reviewed-by: lagergren, hannesw ! src/jdk/nashorn/api/scripting/NashornScriptEngine.java ! src/jdk/nashorn/api/scripting/ScriptObjectMirror.java ! test/src/jdk/nashorn/api/scripting/ScriptEngineTest.java Changeset: f74faac51bfb Author: hannesw Date: 2013-07-25 11:56 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/f74faac51bfb 8021244: Inconsistent stackmap with splitter threshold set very low Reviewed-by: sundar, lagergren ! src/jdk/nashorn/internal/codegen/Lower.java ! src/jdk/nashorn/internal/ir/Block.java Changeset: f22ca0f9b6ee Author: sundar Date: 2013-07-25 20:10 +0530 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/f22ca0f9b6ee 8021361: ClassCastException:.ScriptObjectMirror -> ScriptObject when getInterface called on object from different ScriptContext Reviewed-by: jlaskey, attila ! src/jdk/nashorn/api/scripting/NashornScriptEngine.java ! src/jdk/nashorn/api/scripting/ScriptObjectMirror.java + src/jdk/nashorn/api/scripting/resources/Messages.properties ! src/jdk/nashorn/internal/runtime/ScriptObject.java ! test/src/jdk/nashorn/api/scripting/ScriptEngineTest.java From sean.mullan at oracle.com Thu Jul 25 16:58:17 2013 From: sean.mullan at oracle.com (sean.mullan at oracle.com) Date: Thu, 25 Jul 2013 16:58:17 +0000 Subject: hg: jdk8/tl/jdk: 2 new changesets Message-ID: <20130725165931.644E848373@hg.openjdk.java.net> Changeset: a834ab2c1354 Author: mullan Date: 2013-07-25 10:58 -0400 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/a834ab2c1354 8010748: Add PKIXRevocationChecker NO_FALLBACK option and improve SOFT_FAIL option Reviewed-by: vinnie ! src/share/classes/java/security/cert/PKIXRevocationChecker.java ! src/share/classes/sun/security/provider/certpath/OCSP.java ! src/share/classes/sun/security/provider/certpath/OCSPResponse.java ! src/share/classes/sun/security/provider/certpath/PKIXCertPathValidator.java ! src/share/classes/sun/security/provider/certpath/ReverseState.java ! src/share/classes/sun/security/provider/certpath/RevocationChecker.java ! src/share/classes/sun/security/provider/certpath/SunCertPathBuilder.java ! test/java/security/cert/PKIXRevocationChecker/UnitTest.java Changeset: 22a391706a0b Author: mullan Date: 2013-07-25 11:09 -0400 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/22a391706a0b Merge - make/sun/xawt/ToBin.java - makefiles/sun/awt/X11/ToBin.java - src/share/classes/com/sun/org/apache/xml/internal/security/resource/log4j.properties - src/share/classes/com/sun/org/apache/xml/internal/security/transforms/implementations/FuncHereContext.java - src/share/classes/com/sun/org/apache/xml/internal/security/utils/CachedXPathAPIHolder.java - src/share/classes/com/sun/org/apache/xml/internal/security/utils/CachedXPathFuncHereAPI.java - src/share/classes/com/sun/org/apache/xml/internal/security/utils/XPathFuncHereAPI.java - src/share/classes/java/security/acl/package.html - src/share/classes/java/security/cert/package.html - src/share/classes/java/security/interfaces/package.html - src/share/classes/java/security/package.html - src/share/classes/java/security/spec/package.html - src/share/classes/java/util/stream/StreamBuilder.java - src/share/classes/javax/security/auth/callback/package.html - src/share/classes/javax/security/auth/kerberos/package.html - src/share/classes/javax/security/auth/login/package.html - src/share/classes/javax/security/auth/package.html - src/share/classes/javax/security/auth/spi/package.html - src/share/classes/javax/security/auth/x500/package.html - src/share/classes/javax/security/cert/package.html - src/share/classes/javax/security/sasl/package.html - src/share/classes/sun/misc/Hashing.java - src/share/classes/sun/security/krb5/internal/rcache/CacheTable.java - src/share/classes/sun/security/krb5/internal/rcache/ReplayCache.java ! src/share/classes/sun/security/provider/certpath/RevocationChecker.java - src/solaris/classes/sun/awt/X11/XIconInfo.java - src/solaris/classes/sun/awt/X11/security-icon-bw16.png - src/solaris/classes/sun/awt/X11/security-icon-bw24.png - src/solaris/classes/sun/awt/X11/security-icon-bw32.png - src/solaris/classes/sun/awt/X11/security-icon-bw48.png - src/solaris/classes/sun/awt/X11/security-icon-interim16.png - src/solaris/classes/sun/awt/X11/security-icon-interim24.png - src/solaris/classes/sun/awt/X11/security-icon-interim32.png - src/solaris/classes/sun/awt/X11/security-icon-interim48.png - src/solaris/classes/sun/awt/X11/security-icon-yellow16.png - src/solaris/classes/sun/awt/X11/security-icon-yellow24.png - src/solaris/classes/sun/awt/X11/security-icon-yellow32.png - src/solaris/classes/sun/awt/X11/security-icon-yellow48.png - src/solaris/classes/sun/awt/fontconfigs/linux.fontconfig.Fedora.properties - src/solaris/classes/sun/awt/fontconfigs/linux.fontconfig.SuSE.properties - src/solaris/classes/sun/awt/fontconfigs/linux.fontconfig.Ubuntu.properties - src/solaris/classes/sun/awt/fontconfigs/linux.fontconfig.properties - test/java/lang/invoke/7196190/MHProxyTest.java - test/java/util/Collections/EmptySortedSet.java - test/java/util/Comparators/BasicTest.java - test/sun/misc/Hashing.java - test/sun/security/krb5/auto/ReplayCache.java From joe.darcy at oracle.com Thu Jul 25 17:00:14 2013 From: joe.darcy at oracle.com (joe.darcy at oracle.com) Date: Thu, 25 Jul 2013 17:00:14 +0000 Subject: hg: jdk8/tl/jdk: 8021408: Fix misc doclint issues in java.util and java.io Message-ID: <20130725170036.1CC8A48374@hg.openjdk.java.net> Changeset: 21120e3682ef Author: darcy Date: 2013-07-25 09:59 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/21120e3682ef 8021408: Fix misc doclint issues in java.util and java.io Reviewed-by: dholmes, chegar, psandoz ! src/share/classes/java/io/ObjectInputStream.java ! src/share/classes/java/io/ObjectOutputStream.java ! src/share/classes/java/util/jar/Attributes.java ! src/share/classes/java/util/jar/JarEntry.java ! src/share/classes/java/util/jar/JarFile.java ! src/share/classes/java/util/stream/StreamSupport.java From nicholas+openjdk at nicholaswilliams.net Thu Jul 25 17:27:47 2013 From: nicholas+openjdk at nicholaswilliams.net (Nick Williams) Date: Thu, 25 Jul 2013 12:27:47 -0500 Subject: Invalid "self-closing element not allowed" JavaDoc error Message-ID: My apologies if this is not the right place to address this. If so, please forgive and direct me to the correct list. There are a lot of people/projects complaining about Java 8's new "self-closing element not allowed" error when compiling JavaDoc that has legal
                                                                    tags in it (just google "self-closing element not allowed" in quotes). Some (including myself) are asking, "Why should we fix this? The problem is not in the JavaDoc, it's in the JavDoc compiler." However, I haven't been able to find anyone who has actually broached the subject on any mailing lists.
                                                                    is completely legal. While it is not strictly required by the HTML standard (unless you're using XHTML), using self-closing tags is /preferred/ because it's more obvious what the intention is. Perhaps most importantly,
                                                                    is supported on 100% of browsers and is used throughout JavaDoc all over the place. I have a feeling that once more projects start compiling on a released Java 8, this is going to make a fair number of people angry that hey have to "fix" (read: needlessly change) potentially thousands of classes' worth of JavaDoc. What was the motivation behind the new "self-closing element not allowed" check and how can we make it go away? Thanks, Nick From david.lloyd at redhat.com Thu Jul 25 17:41:55 2013 From: david.lloyd at redhat.com (David M. Lloyd) Date: Thu, 25 Jul 2013 12:41:55 -0500 Subject: Invalid "self-closing element not allowed" JavaDoc error In-Reply-To: References: Message-ID: <51F16363.7070405@redhat.com> On 07/25/2013 12:27 PM, Nick Williams wrote: > My apologies if this is not the right place to address this. If so, please forgive and direct me to the correct list. > > There are a lot of people/projects complaining about Java 8's new "self-closing element not allowed" error when compiling JavaDoc that has legal
                                                                    tags in it (just google "self-closing element not allowed" in quotes). Some (including myself) are asking, "Why should we fix this? The problem is not in the JavaDoc, it's in the JavDoc compiler." However, I haven't been able to find anyone who has actually broached the subject on any mailing lists. > >
                                                                    is completely legal. While it is not strictly required by the HTML standard (unless you're using XHTML), using self-closing tags is /preferred/ because it's more obvious what the intention is. Perhaps most importantly,
                                                                    is supported on 100% of browsers and is used throughout JavaDoc all over the place. I have a feeling that once more projects start compiling on a released Java 8, this is going to make a fair number of people angry that hey have to "fix" (read: needlessly change) potentially thousands of classes' worth of JavaDoc. > > What was the motivation behind the new "self-closing element not allowed" check and how can we make it go away? Not really having a stake in this, I just want to observe a couple things. First, from what I can see, the HTML 4.x specifications make no reference to self-closing elements or their syntactical realization. As far as I can tell (not being any kind of SGML expert), self-closing elements are not valid or meaningful HTML according to its SGML definition. Finally, even if they were allowed, the BR tag is explicitly defined to forbid an end tag; self-closing elements imply an end tag (at least they do in XML, which appears to be the next-nearest concrete specification that has anything to say on the matter). See http://www.w3.org/TR/html401/struct/text.html#edef-BR for more info. So I'm curious when you say "using self-closing tags is /preferred/", do you have any sources to cite? -- - DML From scolebourne at joda.org Thu Jul 25 17:59:58 2013 From: scolebourne at joda.org (Stephen Colebourne) Date: Thu, 25 Jul 2013 18:59:58 +0100 Subject: Invalid "self-closing element not allowed" JavaDoc error In-Reply-To: <51F16363.7070405@redhat.com> References: <51F16363.7070405@redhat.com> Message-ID: Its complicated, see for example: http://stackoverflow.com/questions/3558119/are-self-closing-tags-valid-in-html5 The key point here is not whether its in the standard or not, but what people actually *do*. There is no doubt in my mind that
                                                                    br space slash is very common indeed. Its certainly my default. The javadoc validator should be as lenient as browsers are in this case. Stephen On 25 July 2013 18:41, David M. Lloyd wrote: > On 07/25/2013 12:27 PM, Nick Williams wrote: >> >> My apologies if this is not the right place to address this. If so, please >> forgive and direct me to the correct list. >> >> There are a lot of people/projects complaining about Java 8's new >> "self-closing element not allowed" error when compiling JavaDoc that has >> legal
                                                                    tags in it (just google "self-closing element not allowed" in >> quotes). Some (including myself) are asking, "Why should we fix this? The >> problem is not in the JavaDoc, it's in the JavDoc compiler." However, I >> haven't been able to find anyone who has actually broached the subject on >> any mailing lists. >> >>
                                                                    is completely legal. While it is not strictly required by the HTML >> standard (unless you're using XHTML), using self-closing tags is /preferred/ >> because it's more obvious what the intention is. Perhaps most importantly, >>
                                                                    is supported on 100% of browsers and is used throughout JavaDoc all >> over the place. I have a feeling that once more projects start compiling on >> a released Java 8, this is going to make a fair number of people angry that >> hey have to "fix" (read: needlessly change) potentially thousands of >> classes' worth of JavaDoc. >> >> What was the motivation behind the new "self-closing element not allowed" >> check and how can we make it go away? > > > Not really having a stake in this, I just want to observe a couple things. > First, from what I can see, the HTML 4.x specifications make no reference to > self-closing elements or their syntactical realization. As far as I can > tell (not being any kind of SGML expert), self-closing elements are not > valid or meaningful HTML according to its SGML definition. > > Finally, even if they were allowed, the BR tag is explicitly defined to > forbid an end tag; self-closing elements imply an end tag (at least they do > in XML, which appears to be the next-nearest concrete specification that has > anything to say on the matter). > > See http://www.w3.org/TR/html401/struct/text.html#edef-BR for more info. > > So I'm curious when you say "using self-closing tags is /preferred/", do you > have any sources to cite? > -- > - DML From david.lloyd at redhat.com Thu Jul 25 18:13:30 2013 From: david.lloyd at redhat.com (David M. Lloyd) Date: Thu, 25 Jul 2013 13:13:30 -0500 Subject: Invalid "self-closing element not allowed" JavaDoc error In-Reply-To: References: <51F16363.7070405@redhat.com> Message-ID: <51F16ACA.3000400@redhat.com> It all hinges on whether the tool is generating HTML 4 or HTML 5. If 4, then the output should be HTML 4 "strict" and this kind of input should either be translated or forced to be valid. If the output is going to be HTML 5 - which I suspect is going to be considered "premature" given the usual glacial pace of these kinds of changes - then perhaps it's time to revisit some other crustiness, like the use of frames. On 07/25/2013 12:59 PM, Stephen Colebourne wrote: > Its complicated, see for example: > http://stackoverflow.com/questions/3558119/are-self-closing-tags-valid-in-html5 > > The key point here is not whether its in the standard or not, but what > people actually *do*. > > There is no doubt in my mind that
                                                                    br space slash is very common > indeed. Its certainly my default. The javadoc validator should be as > lenient as browsers are in this case. > > Stephen > > > On 25 July 2013 18:41, David M. Lloyd wrote: >> On 07/25/2013 12:27 PM, Nick Williams wrote: >>> >>> My apologies if this is not the right place to address this. If so, please >>> forgive and direct me to the correct list. >>> >>> There are a lot of people/projects complaining about Java 8's new >>> "self-closing element not allowed" error when compiling JavaDoc that has >>> legal
                                                                    tags in it (just google "self-closing element not allowed" in >>> quotes). Some (including myself) are asking, "Why should we fix this? The >>> problem is not in the JavaDoc, it's in the JavDoc compiler." However, I >>> haven't been able to find anyone who has actually broached the subject on >>> any mailing lists. >>> >>>
                                                                    is completely legal. While it is not strictly required by the HTML >>> standard (unless you're using XHTML), using self-closing tags is /preferred/ >>> because it's more obvious what the intention is. Perhaps most importantly, >>>
                                                                    is supported on 100% of browsers and is used throughout JavaDoc all >>> over the place. I have a feeling that once more projects start compiling on >>> a released Java 8, this is going to make a fair number of people angry that >>> hey have to "fix" (read: needlessly change) potentially thousands of >>> classes' worth of JavaDoc. >>> >>> What was the motivation behind the new "self-closing element not allowed" >>> check and how can we make it go away? >> >> >> Not really having a stake in this, I just want to observe a couple things. >> First, from what I can see, the HTML 4.x specifications make no reference to >> self-closing elements or their syntactical realization. As far as I can >> tell (not being any kind of SGML expert), self-closing elements are not >> valid or meaningful HTML according to its SGML definition. >> >> Finally, even if they were allowed, the BR tag is explicitly defined to >> forbid an end tag; self-closing elements imply an end tag (at least they do >> in XML, which appears to be the next-nearest concrete specification that has >> anything to say on the matter). >> >> See http://www.w3.org/TR/html401/struct/text.html#edef-BR for more info. >> >> So I'm curious when you say "using self-closing tags is /preferred/", do you >> have any sources to cite? >> -- >> - DML -- - DML From chris.hegarty at oracle.com Thu Jul 25 18:39:28 2013 From: chris.hegarty at oracle.com (chris.hegarty at oracle.com) Date: Thu, 25 Jul 2013 18:39:28 +0000 Subject: hg: jdk8/tl/jdk: 8021417: Fix doclint issues in java.util.concurrent Message-ID: <20130725183956.0B76E48382@hg.openjdk.java.net> Changeset: 690dcbaa69b7 Author: chegar Date: 2013-07-25 19:37 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/690dcbaa69b7 8021417: Fix doclint issues in java.util.concurrent Reviewed-by: chegar, lancea Contributed-by: Doug Lea

                                                                    ! src/share/classes/java/util/concurrent/AbstractExecutorService.java ! src/share/classes/java/util/concurrent/ExecutorService.java ! src/share/classes/java/util/concurrent/Executors.java ! src/share/classes/java/util/concurrent/ForkJoinPool.java ! src/share/classes/java/util/concurrent/ForkJoinTask.java ! src/share/classes/java/util/concurrent/ScheduledExecutorService.java ! src/share/classes/java/util/concurrent/ScheduledThreadPoolExecutor.java ! src/share/classes/java/util/concurrent/TimeUnit.java ! src/share/classes/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java ! src/share/classes/java/util/concurrent/atomic/AtomicLongFieldUpdater.java ! src/share/classes/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java From chris.hegarty at oracle.com Thu Jul 25 18:45:59 2013 From: chris.hegarty at oracle.com (chris.hegarty at oracle.com) Date: Thu, 25 Jul 2013 18:45:59 +0000 Subject: hg: jdk8/tl/jdk: 8021421: More doclint fixes in java.net Message-ID: <20130725184635.1F4FD48383@hg.openjdk.java.net> Changeset: 9cd5159fa870 Author: chegar Date: 2013-07-25 19:45 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/9cd5159fa870 8021421: More doclint fixes in java.net Reviewed-by: lancea, darcy ! src/share/classes/java/net/URI.java From brian.burkhalter at oracle.com Thu Jul 25 18:55:04 2013 From: brian.burkhalter at oracle.com (Brian Burkhalter) Date: Thu, 25 Jul 2013 11:55:04 -0700 Subject: Still need a review for Java 8 RFR 8014319: Faster division of large integers Message-ID: <481BC79A-5015-456B-BC9B-FAFBBC9ED3A4@oracle.com> JDK 8 Reviewers: This patch is still pending approval by: http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-July/018922.html Thanks, Brian From rieberandreas at gmail.com Thu Jul 25 18:55:10 2013 From: rieberandreas at gmail.com (Andreas Rieber) Date: Thu, 25 Jul 2013 20:55:10 +0200 Subject: Invalid "self-closing element not allowed" JavaDoc error In-Reply-To: <51F16ACA.3000400@redhat.com> References: <51F16363.7070405@redhat.com> <51F16ACA.3000400@redhat.com> Message-ID: <51F1748E.4010205@gmail.com> Hi, the documents are HTML 4. I checked a sample with w3c validator and there i get only a warning (not an error). << Warning Line 180, Column 4: NET-enabling start-tag requires SHORTTAG YES
                                                                    ? The sequence can be interpreted in at least two different ways, depending on the DOCTYPE of the document. For HTML 4.01 Strict, the '/' terminates the tag '). However, since many browsers don't interpret it this way, even in the presence of an HTML 4.01 Strict DOCTYPE, it is best to avoid it completely in pure HTML documents and reserve its use solely for those written in XHTML. << Standalone tags like
                                                                    , , .... are XHTML. Warning or error, hard to decide? I would also assume warning. Andreas On 25.07.13 20:13, David M. Lloyd wrote: > It all hinges on whether the tool is generating HTML 4 or HTML 5. If 4, > then the output should be HTML 4 "strict" and this kind of input should > either be translated or forced to be valid. > > If the output is going to be HTML 5 - which I suspect is going to be > considered "premature" given the usual glacial pace of these kinds of > changes - then perhaps it's time to revisit some other crustiness, like > the use of frames. > > On 07/25/2013 12:59 PM, Stephen Colebourne wrote: >> Its complicated, see for example: >> http://stackoverflow.com/questions/3558119/are-self-closing-tags-valid-in-html5 >> >> >> The key point here is not whether its in the standard or not, but what >> people actually *do*. >> >> There is no doubt in my mind that
                                                                    br space slash is very common >> indeed. Its certainly my default. The javadoc validator should be as >> lenient as browsers are in this case. >> >> Stephen >> >> >> On 25 July 2013 18:41, David M. Lloyd wrote: >>> On 07/25/2013 12:27 PM, Nick Williams wrote: >>>> >>>> My apologies if this is not the right place to address this. If so, >>>> please >>>> forgive and direct me to the correct list. >>>> >>>> There are a lot of people/projects complaining about Java 8's new >>>> "self-closing element not allowed" error when compiling JavaDoc that >>>> has >>>> legal
                                                                    tags in it (just google "self-closing element not >>>> allowed" in >>>> quotes). Some (including myself) are asking, "Why should we fix >>>> this? The >>>> problem is not in the JavaDoc, it's in the JavDoc compiler." However, I >>>> haven't been able to find anyone who has actually broached the >>>> subject on >>>> any mailing lists. >>>> >>>>
                                                                    is completely legal. While it is not strictly required by the >>>> HTML >>>> standard (unless you're using XHTML), using self-closing tags is >>>> /preferred/ >>>> because it's more obvious what the intention is. Perhaps most >>>> importantly, >>>>
                                                                    is supported on 100% of browsers and is used throughout >>>> JavaDoc all >>>> over the place. I have a feeling that once more projects start >>>> compiling on >>>> a released Java 8, this is going to make a fair number of people >>>> angry that >>>> hey have to "fix" (read: needlessly change) potentially thousands of >>>> classes' worth of JavaDoc. >>>> >>>> What was the motivation behind the new "self-closing element not >>>> allowed" >>>> check and how can we make it go away? >>> >>> >>> Not really having a stake in this, I just want to observe a couple >>> things. >>> First, from what I can see, the HTML 4.x specifications make no >>> reference to >>> self-closing elements or their syntactical realization. As far as I can >>> tell (not being any kind of SGML expert), self-closing elements are not >>> valid or meaningful HTML according to its SGML definition. >>> >>> Finally, even if they were allowed, the BR tag is explicitly defined to >>> forbid an end tag; self-closing elements imply an end tag (at least >>> they do >>> in XML, which appears to be the next-nearest concrete specification >>> that has >>> anything to say on the matter). >>> >>> See http://www.w3.org/TR/html401/struct/text.html#edef-BR for more info. >>> >>> So I'm curious when you say "using self-closing tags is /preferred/", >>> do you >>> have any sources to cite? >>> -- >>> - DML > > From jonathan.gibbons at oracle.com Thu Jul 25 18:59:47 2013 From: jonathan.gibbons at oracle.com (Jonathan Gibbons) Date: Thu, 25 Jul 2013 11:59:47 -0700 Subject: Fwd: Invalid "self-closing element not allowed" JavaDoc error In-Reply-To: <51F16AEC.70203@oracle.com> References: <51F16363.7070405@redhat.com> <51F16AEC.70203@oracle.com> Message-ID: <51F175A3.4010302@oracle.com> The message about "self-closing element not allowed" is because self-closing elements are not allowed in HTML 4. The message is generated by the new "doclint" feature available in javac and javadoc, which is specifically intended to detect issues in javadoc comments. If you do not wish to use the new doclint feature, you can disable it with -Xdoclint:none. As confirmation that this is not legal HTML, try typing a code fragment such as the following into the W3c validator at http://validator.w3.org/check > "http://www.w3.org/TR/html4/loose.dtd"> > > test > > >
                                                                    > > You will get the following warning: > 1. /Line 6 , Column 4/: > NET-enabling start-tag requires SHORTTAG YES > || > > For the current document, the validator interprets strings like > || according to legacy rules that break the expectations of > most authors and thus cause confusing warnings and error messages > from the validator. This interpretation is triggered by HTML 4 > documents or other SGML-based HTML documents. To avoid the > messages, simply remove the "/" character in such contexts. NB: If > you expect || to be interpreted as an XML-compatible > "self-closing" tag, then you need to use XHTML or HTML5. > > This warning and related errors may also be caused by an unquoted > attribute value containing one or more "/". Example: | href=http://w3c.org>W3C|. In such cases, the solution is to > put quotation marks around the value. > -- Jon On 07/25/2013 11:14 AM, Alan Bateman wrote: > Re: Invalid "self-closing element not allowed" JavaDoc error.eml > > Subject: > Re: Invalid "self-closing element not allowed" JavaDoc error > From: > "David M. Lloyd" > Date: > 07/25/2013 10:41 AM > > To: > core-libs-dev at openjdk.java.net > > > On 07/25/2013 12:27 PM, Nick Williams wrote: >> My apologies if this is not the right place to address this. If so, >> please forgive and direct me to the correct list. >> >> There are a lot of people/projects complaining about Java 8's new >> "self-closing element not allowed" error when compiling JavaDoc that >> has legal
                                                                    tags in it (just google "self-closing element not >> allowed" in quotes). Some (including myself) are asking, "Why should >> we fix this? The problem is not in the JavaDoc, it's in the JavDoc >> compiler." However, I haven't been able to find anyone who has >> actually broached the subject on any mailing lists. >> >>
                                                                    is completely legal. While it is not strictly required by the >> HTML standard (unless you're using XHTML), using self-closing tags is >> /preferred/ because it's more obvious what the intention is. Perhaps >> most importantly,
                                                                    is supported on 100% of browsers and is used >> throughout JavaDoc all over the place. I have a feeling that once >> more projects start compiling on a released Java 8, this is going to >> make a fair number of people angry that hey have to "fix" (read: >> needlessly change) potentially thousands of classes' worth of JavaDoc. >> >> What was the motivation behind the new "self-closing element not >> allowed" check and how can we make it go away? > > Not really having a stake in this, I just want to observe a couple > things. First, from what I can see, the HTML 4.x specifications make > no reference to self-closing elements or their syntactical > realization. As far as I can tell (not being any kind of SGML > expert), self-closing elements are not valid or meaningful HTML > according to its SGML definition. > > Finally, even if they were allowed, the BR tag is explicitly defined > to forbid an end tag; self-closing elements imply an end tag (at least > they do in XML, which appears to be the next-nearest concrete > specification that has anything to say on the matter). > > See http://www.w3.org/TR/html401/struct/text.html#edef-BR for more info. > > So I'm curious when you say "using self-closing tags is /preferred/", > do you have any sources to cite? > -- > - DML > > Re: Invalid "self-closing element not allowed" JavaDoc error.eml > > Subject: > Re: Invalid "self-closing element not allowed" JavaDoc error > From: > Stephen Colebourne > Date: > 07/25/2013 10:59 AM > > To: > core-libs-dev at openjdk.java.net > > > Its complicated, see for example: > http://stackoverflow.com/questions/3558119/are-self-closing-tags-valid-in-html5 > > The key point here is not whether its in the standard or not, but what > people actually*do*. > > There is no doubt in my mind that
                                                                    br space slash is very common > indeed. Its certainly my default. The javadoc validator should be as > lenient as browsers are in this case. > > Stephen > > > On 25 July 2013 18:41, David M. Lloyd wrote: >> >On 07/25/2013 12:27 PM, Nick Williams wrote: >>> >> >>> >>My apologies if this is not the right place to address this. If so, please >>> >>forgive and direct me to the correct list. >>> >> >>> >>There are a lot of people/projects complaining about Java 8's new >>> >>"self-closing element not allowed" error when compiling JavaDoc that has >>> >>legal
                                                                    tags in it (just google "self-closing element not allowed" in >>> >>quotes). Some (including myself) are asking, "Why should we fix this? The >>> >>problem is not in the JavaDoc, it's in the JavDoc compiler." However, I >>> >>haven't been able to find anyone who has actually broached the subject on >>> >>any mailing lists. >>> >> >>> >>
                                                                    is completely legal. While it is not strictly required by the HTML >>> >>standard (unless you're using XHTML), using self-closing tags is/preferred/ >>> >>because it's more obvious what the intention is. Perhaps most importantly, >>> >>
                                                                    is supported on 100% of browsers and is used throughout JavaDoc all >>> >>over the place. I have a feeling that once more projects start compiling on >>> >>a released Java 8, this is going to make a fair number of people angry that >>> >>hey have to "fix" (read: needlessly change) potentially thousands of >>> >>classes' worth of JavaDoc. >>> >> >>> >>What was the motivation behind the new "self-closing element not allowed" >>> >>check and how can we make it go away? >> > >> > >> >Not really having a stake in this, I just want to observe a couple things. >> >First, from what I can see, the HTML 4.x specifications make no reference to >> >self-closing elements or their syntactical realization. As far as I can >> >tell (not being any kind of SGML expert), self-closing elements are not >> >valid or meaningful HTML according to its SGML definition. >> > >> >Finally, even if they were allowed, the BR tag is explicitly defined to >> >forbid an end tag; self-closing elements imply an end tag (at least they do >> >in XML, which appears to be the next-nearest concrete specification that has >> >anything to say on the matter). >> > >> >Seehttp://www.w3.org/TR/html401/struct/text.html#edef-BR for more info. >> > >> >So I'm curious when you say "using self-closing tags is/preferred/", do you >> >have any sources to cite? >> >-- >> >- DML From mike.duigou at oracle.com Thu Jul 25 19:41:42 2013 From: mike.duigou at oracle.com (Mike Duigou) Date: Thu, 25 Jul 2013 12:41:42 -0700 Subject: RFR 8020156/8020009 TreeMap.values should report ORDERED/TreeMap.entrySet comparator should not be null In-Reply-To: References: Message-ID: The changes look OK to me. I do prefer the later form but will accept either. Mike On Jul 25 2013, at 02:31 , Paul Sandoz wrote: > Hi, > > Please review the following patch that fixes two issues with TreeMap spliterators: > > http://cr.openjdk.java.net/~psandoz/tl/JDK-8020156-8020009-TreeMap/webrev/ > > It's unfortunate and damn ugly that i resorted to using raw types and a cast for the EntrySet Spliterator.getComparator method: > > + // Since SORTED is reported and Map.Entry elements are not comparable > + // then a non-null comparator needs to be returned > + if (tree.comparator != null) { > + // Adapt the existing non-null comparator to compare entries > + // by key > + return Map.Entry.comparingByKey(tree.comparator); > + } > + else { > + // Return a comparator of entries by key, with K assumed to be > + // of Comparable > + // First obtain the Map.Entry.comparingByKey() comparator > + // as a raw type since K is not declared with > + // a upper bound of Comparable, then cast to the return type > + @SuppressWarnings("rawtypes") > + Comparator craw = Map.Entry.comparingByKey(); > + @SuppressWarnings("unchecked") > + Comparator> c = > + (Comparator>) craw; > + return c; > + } > > > Perhaps rather than reusing a Map.Entry comparator method it is clearer to do the following: > > return (Comparator> & Serializable) (e1, e2) -> { > @SuppressWarnings("unchecked") > Comparable k1 = (Comparable) e1.getKey(); > return k1.compareTo(e2.getKey()); > }; > > ? I marginally prefer that. > > I created a new test java/util/Spliterators/SpliteratorCharacteristics that we can fill out over time for other collections as and when needed. > > Paul. From huizhe.wang at oracle.com Thu Jul 25 20:08:49 2013 From: huizhe.wang at oracle.com (huizhe.wang at oracle.com) Date: Thu, 25 Jul 2013 20:08:49 +0000 Subject: hg: jdk8/tl/jaxp: 8021148: Regression in SAXParserImpl in 7u40 b34 (NPE) Message-ID: <20130725200856.A53EC4839E@hg.openjdk.java.net> Changeset: 251ca1e2ccd3 Author: joehw Date: 2013-07-25 13:02 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jaxp/rev/251ca1e2ccd3 8021148: Regression in SAXParserImpl in 7u40 b34 (NPE) Reviewed-by: chegar, lancea, dfuchs ! src/com/sun/org/apache/xerces/internal/jaxp/SAXParserImpl.java From nicholas+openjdk at nicholaswilliams.net Thu Jul 25 20:19:26 2013 From: nicholas+openjdk at nicholaswilliams.net (Nick Williams) Date: Thu, 25 Jul 2013 15:19:26 -0500 Subject: Invalid "self-closing element not allowed" JavaDoc error In-Reply-To: <51F16ACA.3000400@redhat.com> References: <51F16363.7070405@redhat.com> <51F16ACA.3000400@redhat.com> Message-ID: <7534FE33-925A-4E2F-BE88-CBB41610A0A2@nicholaswilliams.net> Point of interest: JavaDoc uses the HTML 4 "Loose" specification, not the HTML 4 "Strict" specification. By using frames, JavaDoc is in violation of the HTML 4.01 Loose specification (see below). There are void elements and there are empty elements. Void elements are elements that ARE NOT ALLOWED to have content. They are: area, base, br, col, command, embed, hr, img, input, keygen, link, meta, param, source, track, wbr, and some foreign/extension elements. Empty elements are elements that ARE ALLOWED to have content but don't, for whatever reason. This is any element not listed above. In HTML (all versions), empty elements CANNOT be self-closing, they MUST have start and end tags (like ) because they MAY have content. Void elements MUST NOT have start and end tags because they MAY NOT have content. Browsers MAY permit self-closing void tags, and all browsers do. There is no syntax difference between Strict, Transitional (Loose), and Frameset. Strict prohibits frame sets, presentational elements (like ), and deprecated elements. Transitional (Loose) allows presentational elements and deprecated elements but prohibits frame sets. Frameset allows presentational elements, deprecated elements, and frame sets. /If/ the motivation behind "self-closing element not allowed" is abiding by the spec, then we should get rid of frames, too. In XHTML (all versions), both empty elements and void elements MUST EITHER have a start and an end tag OR be self-closing (http://www.w3.org/TR/xhtml1/#h-4.6). Furthermore, the spec recommends for compatibility reasons that you always put a space before the forward slash in a self-closing element (http://www.w3.org/TR/xhtml1/#C_2). Special Note: In HTML5, the SVG and MathML elements MUST EITHER have a start and an end tag OR be self-closing. Nick On Jul 25, 2013, at 1:13 PM, David M. Lloyd wrote: > It all hinges on whether the tool is generating HTML 4 or HTML 5. If 4, then the output should be HTML 4 "strict" and this kind of input should either be translated or forced to be valid. > > If the output is going to be HTML 5 - which I suspect is going to be considered "premature" given the usual glacial pace of these kinds of changes - then perhaps it's time to revisit some other crustiness, like the use of frames. > > On 07/25/2013 12:59 PM, Stephen Colebourne wrote: >> Its complicated, see for example: >> http://stackoverflow.com/questions/3558119/are-self-closing-tags-valid-in-html5 >> >> The key point here is not whether its in the standard or not, but what >> people actually *do*. >> >> There is no doubt in my mind that
                                                                    br space slash is very common >> indeed. Its certainly my default. The javadoc validator should be as >> lenient as browsers are in this case. >> >> Stephen >> >> >> On 25 July 2013 18:41, David M. Lloyd wrote: >>> On 07/25/2013 12:27 PM, Nick Williams wrote: >>>> >>>> My apologies if this is not the right place to address this. If so, please >>>> forgive and direct me to the correct list. >>>> >>>> There are a lot of people/projects complaining about Java 8's new >>>> "self-closing element not allowed" error when compiling JavaDoc that has >>>> legal
                                                                    tags in it (just google "self-closing element not allowed" in >>>> quotes). Some (including myself) are asking, "Why should we fix this? The >>>> problem is not in the JavaDoc, it's in the JavDoc compiler." However, I >>>> haven't been able to find anyone who has actually broached the subject on >>>> any mailing lists. >>>> >>>>
                                                                    is completely legal. While it is not strictly required by the HTML >>>> standard (unless you're using XHTML), using self-closing tags is /preferred/ >>>> because it's more obvious what the intention is. Perhaps most importantly, >>>>
                                                                    is supported on 100% of browsers and is used throughout JavaDoc all >>>> over the place. I have a feeling that once more projects start compiling on >>>> a released Java 8, this is going to make a fair number of people angry that >>>> hey have to "fix" (read: needlessly change) potentially thousands of >>>> classes' worth of JavaDoc. >>>> >>>> What was the motivation behind the new "self-closing element not allowed" >>>> check and how can we make it go away? >>> >>> >>> Not really having a stake in this, I just want to observe a couple things. >>> First, from what I can see, the HTML 4.x specifications make no reference to >>> self-closing elements or their syntactical realization. As far as I can >>> tell (not being any kind of SGML expert), self-closing elements are not >>> valid or meaningful HTML according to its SGML definition. >>> >>> Finally, even if they were allowed, the BR tag is explicitly defined to >>> forbid an end tag; self-closing elements imply an end tag (at least they do >>> in XML, which appears to be the next-nearest concrete specification that has >>> anything to say on the matter). >>> >>> See http://www.w3.org/TR/html401/struct/text.html#edef-BR for more info. >>> >>> So I'm curious when you say "using self-closing tags is /preferred/", do you >>> have any sources to cite? >>> -- >>> - DML > > > -- > - DML From nicholas+openjdk at nicholaswilliams.net Thu Jul 25 20:20:09 2013 From: nicholas+openjdk at nicholaswilliams.net (Nick Williams) Date: Thu, 25 Jul 2013 15:20:09 -0500 Subject: Invalid "self-closing element not allowed" JavaDoc error In-Reply-To: <7534FE33-925A-4E2F-BE88-CBB41610A0A2@nicholaswilliams.net> References: <51F16363.7070405@redhat.com> <51F16ACA.3000400@redhat.com> <7534FE33-925A-4E2F-BE88-CBB41610A0A2@nicholaswilliams.net> Message-ID: <1E41F84B-58F0-4E4E-9D73-B5B644B1E8EC@nicholaswilliams.net> Correction: I see now that we're using Frameset doctype for the parent page and Transitional for the pages within frames. I misunderstood that. My bad. On Jul 25, 2013, at 3:19 PM, Nick Williams wrote: > Point of interest: JavaDoc uses the HTML 4 "Loose" specification, not the HTML 4 "Strict" specification. By using frames, JavaDoc is in violation of the HTML 4.01 Loose specification (see below). > > There are void elements and there are empty elements. > > Void elements are elements that ARE NOT ALLOWED to have content. They are: area, base, br, col, command, embed, hr, img, input, keygen, link, meta, param, source, track, wbr, and some foreign/extension elements. > > Empty elements are elements that ARE ALLOWED to have content but don't, for whatever reason. This is any element not listed above. > > In HTML (all versions), empty elements CANNOT be self-closing, they MUST have start and end tags (like ) because they MAY have content. Void elements MUST NOT have start and end tags because they MAY NOT have content. Browsers MAY permit self-closing void tags, and all browsers do. There is no syntax difference between Strict, Transitional (Loose), and Frameset. Strict prohibits frame sets, presentational elements (like ), and deprecated elements. Transitional (Loose) allows presentational elements and deprecated elements but prohibits frame sets. Frameset allows presentational elements, deprecated elements, and frame sets. /If/ the motivation behind "self-closing element not allowed" is abiding by the spec, then we should get rid of frames, too. > > In XHTML (all versions), both empty elements and void elements MUST EITHER have a start and an end tag OR be self-closing (http://www.w3.org/TR/xhtml1/#h-4.6). Furthermore, the spec recommends for compatibility reasons that you always put a space before the forward slash in a self-closing element (http://www.w3.org/TR/xhtml1/#C_2). > > Special Note: In HTML5, the SVG and MathML elements MUST EITHER have a start and an end tag OR be self-closing. > > Nick > > On Jul 25, 2013, at 1:13 PM, David M. Lloyd wrote: > >> It all hinges on whether the tool is generating HTML 4 or HTML 5. If 4, then the output should be HTML 4 "strict" and this kind of input should either be translated or forced to be valid. >> >> If the output is going to be HTML 5 - which I suspect is going to be considered "premature" given the usual glacial pace of these kinds of changes - then perhaps it's time to revisit some other crustiness, like the use of frames. >> >> On 07/25/2013 12:59 PM, Stephen Colebourne wrote: >>> Its complicated, see for example: >>> http://stackoverflow.com/questions/3558119/are-self-closing-tags-valid-in-html5 >>> >>> The key point here is not whether its in the standard or not, but what >>> people actually *do*. >>> >>> There is no doubt in my mind that
                                                                    br space slash is very common >>> indeed. Its certainly my default. The javadoc validator should be as >>> lenient as browsers are in this case. >>> >>> Stephen >>> >>> >>> On 25 July 2013 18:41, David M. Lloyd wrote: >>>> On 07/25/2013 12:27 PM, Nick Williams wrote: >>>>> >>>>> My apologies if this is not the right place to address this. If so, please >>>>> forgive and direct me to the correct list. >>>>> >>>>> There are a lot of people/projects complaining about Java 8's new >>>>> "self-closing element not allowed" error when compiling JavaDoc that has >>>>> legal
                                                                    tags in it (just google "self-closing element not allowed" in >>>>> quotes). Some (including myself) are asking, "Why should we fix this? The >>>>> problem is not in the JavaDoc, it's in the JavDoc compiler." However, I >>>>> haven't been able to find anyone who has actually broached the subject on >>>>> any mailing lists. >>>>> >>>>>
                                                                    is completely legal. While it is not strictly required by the HTML >>>>> standard (unless you're using XHTML), using self-closing tags is /preferred/ >>>>> because it's more obvious what the intention is. Perhaps most importantly, >>>>>
                                                                    is supported on 100% of browsers and is used throughout JavaDoc all >>>>> over the place. I have a feeling that once more projects start compiling on >>>>> a released Java 8, this is going to make a fair number of people angry that >>>>> hey have to "fix" (read: needlessly change) potentially thousands of >>>>> classes' worth of JavaDoc. >>>>> >>>>> What was the motivation behind the new "self-closing element not allowed" >>>>> check and how can we make it go away? >>>> >>>> >>>> Not really having a stake in this, I just want to observe a couple things. >>>> First, from what I can see, the HTML 4.x specifications make no reference to >>>> self-closing elements or their syntactical realization. As far as I can >>>> tell (not being any kind of SGML expert), self-closing elements are not >>>> valid or meaningful HTML according to its SGML definition. >>>> >>>> Finally, even if they were allowed, the BR tag is explicitly defined to >>>> forbid an end tag; self-closing elements imply an end tag (at least they do >>>> in XML, which appears to be the next-nearest concrete specification that has >>>> anything to say on the matter). >>>> >>>> See http://www.w3.org/TR/html401/struct/text.html#edef-BR for more info. >>>> >>>> So I'm curious when you say "using self-closing tags is /preferred/", do you >>>> have any sources to cite? >>>> -- >>>> - DML >> >> >> -- >> - DML > From huizhe.wang at oracle.com Thu Jul 25 20:20:59 2013 From: huizhe.wang at oracle.com (huizhe.wang at oracle.com) Date: Thu, 25 Jul 2013 20:20:59 +0000 Subject: hg: jdk8/tl/jdk: 8021148: Regression in SAXParserImpl in 7u40 b34 (NPE) Message-ID: <20130725202149.07ABC483A0@hg.openjdk.java.net> Changeset: 662ec7782102 Author: joehw Date: 2013-07-25 13:20 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/662ec7782102 8021148: Regression in SAXParserImpl in 7u40 b34 (NPE) Reviewed-by: chegar, lancea, dfuchs + test/javax/xml/jaxp/parsers/8021148/JAXPSAXParserTest.java + test/javax/xml/jaxp/parsers/8021148/TestBase.java From nicholas+openjdk at nicholaswilliams.net Thu Jul 25 20:22:22 2013 From: nicholas+openjdk at nicholaswilliams.net (Nick Williams) Date: Thu, 25 Jul 2013 15:22:22 -0500 Subject: Invalid "self-closing element not allowed" JavaDoc error In-Reply-To: <51F175A3.4010302@oracle.com> References: <51F16363.7070405@redhat.com> <51F16AEC.70203@oracle.com> <51F175A3.4010302@oracle.com> Message-ID: <83836065-9553-4D00-B65D-314DAF502391@nicholaswilliams.net> Jonathan, I don't see the "confirmation that this is not legal HTML" that you reference. I see a warning that some browsers may not interpret it correctly. But IE 5+ and all Firefox, Chrome, Netscape, Opera, etc. versions interpret it correctly. I understand your point about the spec not specifically allowing it. HOWEVER, I promise you there are TENS OF THOUSANDS of existing JavaDoc'd classes that will break JavaDoc generation as a result of this change. Maybe doclint (what does that stand for, by the way?) could be a default-off feature instead of a default-on feature? Nick On Jul 25, 2013, at 1:59 PM, Jonathan Gibbons wrote: > The message about "self-closing element not allowed" is because self-closing elements are not allowed in HTML 4. The message is generated by the new "doclint" feature available in javac and javadoc, which is specifically intended to detect issues in javadoc comments. If you do not wish to use the new doclint feature, you can disable it with -Xdoclint:none. > > > As confirmation that this is not legal HTML, try typing a code fragment such as the following into the W3c validator at http://validator.w3.org/check > >> >> >> test >> >> >>
                                                                    >> >> > > You will get the following warning: > >> 1. /Line 6 , Column 4/: >> NET-enabling start-tag requires SHORTTAG YES >> || >> >> For the current document, the validator interprets strings like >> || according to legacy rules that break the expectations of >> most authors and thus cause confusing warnings and error messages >> from the validator. This interpretation is triggered by HTML 4 >> documents or other SGML-based HTML documents. To avoid the >> messages, simply remove the "/" character in such contexts. NB: If >> you expect || to be interpreted as an XML-compatible >> "self-closing" tag, then you need to use XHTML or HTML5. >> >> This warning and related errors may also be caused by an unquoted >> attribute value containing one or more "/". Example: |> href=http://w3c.org>W3C|. In such cases, the solution is to >> put quotation marks around the value. >> > > -- Jon > > > > On 07/25/2013 11:14 AM, Alan Bateman wrote: >> Re: Invalid "self-closing element not allowed" JavaDoc error.eml >> >> Subject: >> Re: Invalid "self-closing element not allowed" JavaDoc error >> From: >> "David M. Lloyd" >> Date: >> 07/25/2013 10:41 AM >> >> To: >> core-libs-dev at openjdk.java.net >> >> >> On 07/25/2013 12:27 PM, Nick Williams wrote: >>> My apologies if this is not the right place to address this. If so, please forgive and direct me to the correct list. >>> >>> There are a lot of people/projects complaining about Java 8's new "self-closing element not allowed" error when compiling JavaDoc that has legal
                                                                    tags in it (just google "self-closing element not allowed" in quotes). Some (including myself) are asking, "Why should we fix this? The problem is not in the JavaDoc, it's in the JavDoc compiler." However, I haven't been able to find anyone who has actually broached the subject on any mailing lists. >>> >>>
                                                                    is completely legal. While it is not strictly required by the HTML standard (unless you're using XHTML), using self-closing tags is /preferred/ because it's more obvious what the intention is. Perhaps most importantly,
                                                                    is supported on 100% of browsers and is used throughout JavaDoc all over the place. I have a feeling that once more projects start compiling on a released Java 8, this is going to make a fair number of people angry that hey have to "fix" (read: needlessly change) potentially thousands of classes' worth of JavaDoc. >>> >>> What was the motivation behind the new "self-closing element not allowed" check and how can we make it go away? >> >> Not really having a stake in this, I just want to observe a couple things. First, from what I can see, the HTML 4.x specifications make no reference to self-closing elements or their syntactical realization. As far as I can tell (not being any kind of SGML expert), self-closing elements are not valid or meaningful HTML according to its SGML definition. >> >> Finally, even if they were allowed, the BR tag is explicitly defined to forbid an end tag; self-closing elements imply an end tag (at least they do in XML, which appears to be the next-nearest concrete specification that has anything to say on the matter). >> >> See http://www.w3.org/TR/html401/struct/text.html#edef-BR for more info. >> >> So I'm curious when you say "using self-closing tags is /preferred/", do you have any sources to cite? >> -- >> - DML >> >> Re: Invalid "self-closing element not allowed" JavaDoc error.eml >> >> Subject: >> Re: Invalid "self-closing element not allowed" JavaDoc error >> From: >> Stephen Colebourne >> Date: >> 07/25/2013 10:59 AM >> >> To: >> core-libs-dev at openjdk.java.net >> >> >> Its complicated, see for example: >> http://stackoverflow.com/questions/3558119/are-self-closing-tags-valid-in-html5 >> >> The key point here is not whether its in the standard or not, but what >> people actually*do*. >> >> There is no doubt in my mind that
                                                                    br space slash is very common >> indeed. Its certainly my default. The javadoc validator should be as >> lenient as browsers are in this case. >> >> Stephen >> >> >> On 25 July 2013 18:41, David M. Lloyd wrote: >>> >On 07/25/2013 12:27 PM, Nick Williams wrote: >>>> >> >>>> >>My apologies if this is not the right place to address this. If so, please >>>> >>forgive and direct me to the correct list. >>>> >> >>>> >>There are a lot of people/projects complaining about Java 8's new >>>> >>"self-closing element not allowed" error when compiling JavaDoc that has >>>> >>legal
                                                                    tags in it (just google "self-closing element not allowed" in >>>> >>quotes). Some (including myself) are asking, "Why should we fix this? The >>>> >>problem is not in the JavaDoc, it's in the JavDoc compiler." However, I >>>> >>haven't been able to find anyone who has actually broached the subject on >>>> >>any mailing lists. >>>> >> >>>> >>
                                                                    is completely legal. While it is not strictly required by the HTML >>>> >>standard (unless you're using XHTML), using self-closing tags is/preferred/ >>>> >>because it's more obvious what the intention is. Perhaps most importantly, >>>> >>
                                                                    is supported on 100% of browsers and is used throughout JavaDoc all >>>> >>over the place. I have a feeling that once more projects start compiling on >>>> >>a released Java 8, this is going to make a fair number of people angry that >>>> >>hey have to "fix" (read: needlessly change) potentially thousands of >>>> >>classes' worth of JavaDoc. >>>> >> >>>> >>What was the motivation behind the new "self-closing element not allowed" >>>> >>check and how can we make it go away? >>> > >>> > >>> >Not really having a stake in this, I just want to observe a couple things. >>> >First, from what I can see, the HTML 4.x specifications make no reference to >>> >self-closing elements or their syntactical realization. As far as I can >>> >tell (not being any kind of SGML expert), self-closing elements are not >>> >valid or meaningful HTML according to its SGML definition. >>> > >>> >Finally, even if they were allowed, the BR tag is explicitly defined to >>> >forbid an end tag; self-closing elements imply an end tag (at least they do >>> >in XML, which appears to be the next-nearest concrete specification that has >>> >anything to say on the matter). >>> > >>> >Seehttp://www.w3.org/TR/html401/struct/text.html#edef-BR for more info. >>> > >>> >So I'm curious when you say "using self-closing tags is/preferred/", do you >>> >have any sources to cite? >>> >-- >>> >- DML > From martinrb at google.com Thu Jul 25 20:25:48 2013 From: martinrb at google.com (Martin Buchholz) Date: Thu, 25 Jul 2013 13:25:48 -0700 Subject: RFR doclint issues in j.u.concurrent In-Reply-To: References: <51F0EC11.2000700@oracle.com> Message-ID: Thanks as always for your help integrating jsr166! Looks good to me. On Thu, Jul 25, 2013 at 2:35 AM, Lance Andersen wrote: > Looks fine > > Best > Lance > > -- > > Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 > Oracle Java Engineering > 1 Network Drive > Burlington, MA 01803 > Lance.Andersen at oracle.com > > Sent from my iPhone > > On Jul 25, 2013, at 5:12 AM, Chris Hegarty > wrote: > > > These changes are already committed in the jsr166 CVS, this is a request > to pull them into jdk8. > > > > With these changes all but CompletableFuture are doclint warning free. > There is a separate effort to overhaul CF, which will address the warnings. > > > > diff -r fd1b5adcfdf0 > src/share/classes/java/util/concurrent/AbstractExecutorService.java > > --- > a/src/share/classes/java/util/concurrent/AbstractExecutorService.java > Wed Jul 24 22:52:01 2013 +0100 > > +++ > b/src/share/classes/java/util/concurrent/AbstractExecutorService.java > Thu Jul 25 10:04:28 2013 +0100 > > @@ -76,6 +76,7 @@ public abstract class AbstractExecutorSe > > * > > * @param runnable the runnable task being wrapped > > * @param value the default value for the returned future > > + * @param the type of the given value > > * @return a {@code RunnableFuture} which, when run, will run the > > * underlying runnable and which, as a {@code Future}, will yield > > * the given value as its result and provide for cancellation of > > @@ -90,6 +91,7 @@ public abstract class AbstractExecutorSe > > * Returns a {@code RunnableFuture} for the given callable task. > > * > > * @param callable the callable task being wrapped > > + * @param the type of the callable's result > > * @return a {@code RunnableFuture} which, when run, will call the > > * underlying callable and which, as a {@code Future}, will yield > > * the callable's result as its result and provide for > > diff -r fd1b5adcfdf0 > src/share/classes/java/util/concurrent/ExecutorService.java > > --- a/src/share/classes/java/util/concurrent/ExecutorService.java Wed > Jul 24 22:52:01 2013 +0100 > > +++ b/src/share/classes/java/util/concurrent/ExecutorService.java Thu > Jul 25 10:04:28 2013 +0100 > > @@ -227,6 +227,7 @@ public interface ExecutorService extends > > * {@link Callable} form so they can be submitted. > > * > > * @param task the task to submit > > + * @param the type of the task's result > > * @return a Future representing pending completion of the task > > * @throws RejectedExecutionException if the task cannot be > > * scheduled for execution > > @@ -241,6 +242,7 @@ public interface ExecutorService extends > > * > > * @param task the task to submit > > * @param result the result to return > > + * @param the type of the result > > * @return a Future representing pending completion of the task > > * @throws RejectedExecutionException if the task cannot be > > * scheduled for execution > > @@ -272,6 +274,7 @@ public interface ExecutorService extends > > * collection is modified while this operation is in progress. > > * > > * @param tasks the collection of tasks > > + * @param the type of the values returned from the tasks > > * @return a list of Futures representing the tasks, in the same > > * sequential order as produced by the iterator for the > > * given task list, each of which has completed > > @@ -299,6 +302,7 @@ public interface ExecutorService extends > > * @param tasks the collection of tasks > > * @param timeout the maximum time to wait > > * @param unit the time unit of the timeout argument > > + * @param the type of the values returned from the tasks > > * @return a list of Futures representing the tasks, in the same > > * sequential order as produced by the iterator for the > > * given task list. If the operation did not time out, > > @@ -324,6 +328,7 @@ public interface ExecutorService extends > > * collection is modified while this operation is in progress. > > * > > * @param tasks the collection of tasks > > + * @param the type of the values returned from the tasks > > * @return the result returned by one of the tasks > > * @throws InterruptedException if interrupted while waiting > > * @throws NullPointerException if tasks or any element task > > @@ -348,6 +353,7 @@ public interface ExecutorService extends > > * @param tasks the collection of tasks > > * @param timeout the maximum time to wait > > * @param unit the time unit of the timeout argument > > + * @param the type of the values returned from the tasks > > * @return the result returned by one of the tasks > > * @throws InterruptedException if interrupted while waiting > > * @throws NullPointerException if tasks, or unit, or any element > > diff -r fd1b5adcfdf0 > src/share/classes/java/util/concurrent/Executors.java > > --- a/src/share/classes/java/util/concurrent/Executors.java Wed Jul > 24 22:52:01 2013 +0100 > > +++ b/src/share/classes/java/util/concurrent/Executors.java Thu Jul > 25 10:04:28 2013 +0100 > > @@ -397,6 +397,7 @@ public class Executors { > > * {@code Callable} to an otherwise resultless action. > > * @param task the task to run > > * @param result the result to return > > + * @param the type of the result > > * @return a callable object > > * @throws NullPointerException if task null > > */ > > @@ -458,6 +459,7 @@ public class Executors { > > * action; or if not possible, throw an associated {@link > > * AccessControlException}. > > * @param callable the underlying task > > + * @param the type of the callable's result > > * @return a callable object > > * @throws NullPointerException if callable null > > */ > > @@ -480,6 +482,7 @@ public class Executors { > > * AccessControlException}. > > * > > * @param callable the underlying task > > + * @param the type of the callable's result > > * @return a callable object > > * @throws NullPointerException if callable null > > * @throws AccessControlException if the current access control > > diff -r fd1b5adcfdf0 > src/share/classes/java/util/concurrent/ForkJoinPool.java > > --- a/src/share/classes/java/util/concurrent/ForkJoinPool.java Wed Jul > 24 22:52:01 2013 +0100 > > +++ b/src/share/classes/java/util/concurrent/ForkJoinPool.java Thu Jul > 25 10:04:28 2013 +0100 > > @@ -561,8 +561,8 @@ public class ForkJoinPool extends Abstra > > * Returns a new worker thread operating in the given pool. > > * > > * @param pool the pool this thread works in > > + * @return the new worker thread > > * @throws NullPointerException if the pool is null > > - * @return the new worker thread > > */ > > public ForkJoinWorkerThread newThread(ForkJoinPool pool); > > } > > @@ -2497,6 +2497,7 @@ public class ForkJoinPool extends Abstra > > * minimally only the latter. > > * > > * @param task the task > > + * @param the type of the task's result > > * @return the task's result > > * @throws NullPointerException if the task is null > > * @throws RejectedExecutionException if the task cannot be > > @@ -2545,6 +2546,7 @@ public class ForkJoinPool extends Abstra > > * Submits a ForkJoinTask for execution. > > * > > * @param task the task to submit > > + * @param the type of the task's result > > * @return the task > > * @throws NullPointerException if the task is null > > * @throws RejectedExecutionException if the task cannot be > > diff -r fd1b5adcfdf0 > src/share/classes/java/util/concurrent/ForkJoinTask.java > > --- a/src/share/classes/java/util/concurrent/ForkJoinTask.java Wed Jul > 24 22:52:01 2013 +0100 > > +++ b/src/share/classes/java/util/concurrent/ForkJoinTask.java Thu Jul > 25 10:04:28 2013 +0100 > > @@ -810,6 +810,7 @@ public abstract class ForkJoinTask im > > * unprocessed. > > * > > * @param tasks the collection of tasks > > + * @param the type of the values returned from the tasks > > * @return the tasks argument, to simplify usage > > * @throws NullPointerException if tasks or any element are null > > */ > > @@ -1472,6 +1473,7 @@ public abstract class ForkJoinTask im > > * > > * @param runnable the runnable action > > * @param result the result upon completion > > + * @param the type of the result > > * @return the task > > */ > > public static ForkJoinTask adapt(Runnable runnable, T result) > { > > @@ -1485,6 +1487,7 @@ public abstract class ForkJoinTask im > > * encountered into {@code RuntimeException}. > > * > > * @param callable the callable action > > + * @param the type of the callable's result > > * @return the task > > */ > > public static ForkJoinTask adapt(Callable > callable) { > > @@ -1498,6 +1501,8 @@ public abstract class ForkJoinTask im > > /** > > * Saves this task to a stream (that is, serializes it). > > * > > + * @param s the stream > > + * @throws java.io.IOException if an I/O error occurs > > * @serialData the current run status and the exception thrown > > * during execution, or {@code null} if none > > */ > > @@ -1509,6 +1514,10 @@ public abstract class ForkJoinTask im > > > > /** > > * Reconstitutes this task from a stream (that is, deserializes it). > > + * @param s the stream > > + * @throws ClassNotFoundException if the class of a serialized > object > > + * could not be found > > + * @throws java.io.IOException if an I/O error occurs > > */ > > private void readObject(java.io.ObjectInputStream s) > > throws java.io.IOException, ClassNotFoundException { > > diff -r fd1b5adcfdf0 > src/share/classes/java/util/concurrent/ScheduledExecutorService.java > > --- > a/src/share/classes/java/util/concurrent/ScheduledExecutorService.java Wed > Jul 24 22:52:01 2013 +0100 > > +++ > b/src/share/classes/java/util/concurrent/ScheduledExecutorService.java Thu > Jul 25 10:04:28 2013 +0100 > > @@ -117,6 +117,7 @@ public interface ScheduledExecutorServic > > * @param callable the function to execute > > * @param delay the time from now to delay execution > > * @param unit the time unit of the delay parameter > > + * @param the type of the callable's result > > * @return a ScheduledFuture that can be used to extract result or > cancel > > * @throws RejectedExecutionException if the task cannot be > > * scheduled for execution > > diff -r fd1b5adcfdf0 > src/share/classes/java/util/concurrent/ScheduledThreadPoolExecutor.java > > --- > a/src/share/classes/java/util/concurrent/ScheduledThreadPoolExecutor.java > Wed Jul 24 22:52:01 2013 +0100 > > +++ > b/src/share/classes/java/util/concurrent/ScheduledThreadPoolExecutor.java > Thu Jul 25 10:04:28 2013 +0100 > > @@ -392,6 +392,7 @@ public class ScheduledThreadPoolExecutor > > * > > * @param runnable the submitted Runnable > > * @param task the task created to execute the runnable > > + * @param the type of the task's result > > * @return a task that can execute the runnable > > * @since 1.6 > > */ > > @@ -408,6 +409,7 @@ public class ScheduledThreadPoolExecutor > > * > > * @param callable the submitted Callable > > * @param task the task created to execute the callable > > + * @param the type of the task's result > > * @return a task that can execute the callable > > * @since 1.6 > > */ > > diff -r fd1b5adcfdf0 src/share/classes/java/util/concurrent/TimeUnit.java > > --- a/src/share/classes/java/util/concurrent/TimeUnit.java Wed Jul > 24 22:52:01 2013 +0100 > > +++ b/src/share/classes/java/util/concurrent/TimeUnit.java Thu Jul > 25 10:04:28 2013 +0100 > > @@ -69,6 +69,9 @@ package java.util.concurrent; > > * @author Doug Lea > > */ > > public enum TimeUnit { > > + /** > > + * Time unit representing one thousandth of a microsecond > > + */ > > NANOSECONDS { > > public long toNanos(long d) { return d; } > > public long toMicros(long d) { return d/(C1/C0); } > > @@ -80,6 +83,10 @@ public enum TimeUnit { > > public long convert(long d, TimeUnit u) { return u.toNanos(d); } > > int excessNanos(long d, long m) { return (int)(d - (m*C2)); } > > }, > > + > > + /** > > + * Time unit representing one thousandth of a millisecond > > + */ > > MICROSECONDS { > > public long toNanos(long d) { return x(d, C1/C0, MAX/(C1/C0)); > } > > public long toMicros(long d) { return d; } > > @@ -91,6 +98,10 @@ public enum TimeUnit { > > public long convert(long d, TimeUnit u) { return u.toMicros(d); } > > int excessNanos(long d, long m) { return (int)((d*C1) - (m*C2)); > } > > }, > > + > > + /** > > + * Time unit representing one thousandth of a second > > + */ > > MILLISECONDS { > > public long toNanos(long d) { return x(d, C2/C0, MAX/(C2/C0)); > } > > public long toMicros(long d) { return x(d, C2/C1, MAX/(C2/C1)); > } > > @@ -102,6 +113,10 @@ public enum TimeUnit { > > public long convert(long d, TimeUnit u) { return u.toMillis(d); } > > int excessNanos(long d, long m) { return 0; } > > }, > > + > > + /** > > + * Time unit representing one second > > + */ > > SECONDS { > > public long toNanos(long d) { return x(d, C3/C0, MAX/(C3/C0)); > } > > public long toMicros(long d) { return x(d, C3/C1, MAX/(C3/C1)); > } > > @@ -113,6 +128,10 @@ public enum TimeUnit { > > public long convert(long d, TimeUnit u) { return u.toSeconds(d); > } > > int excessNanos(long d, long m) { return 0; } > > }, > > + > > + /** > > + * Time unit representing sixty seconds > > + */ > > MINUTES { > > public long toNanos(long d) { return x(d, C4/C0, MAX/(C4/C0)); > } > > public long toMicros(long d) { return x(d, C4/C1, MAX/(C4/C1)); > } > > @@ -124,6 +143,10 @@ public enum TimeUnit { > > public long convert(long d, TimeUnit u) { return u.toMinutes(d); > } > > int excessNanos(long d, long m) { return 0; } > > }, > > + > > + /** > > + * Time unit representing sixty minutes > > + */ > > HOURS { > > public long toNanos(long d) { return x(d, C5/C0, MAX/(C5/C0)); > } > > public long toMicros(long d) { return x(d, C5/C1, MAX/(C5/C1)); > } > > @@ -135,6 +158,10 @@ public enum TimeUnit { > > public long convert(long d, TimeUnit u) { return u.toHours(d); } > > int excessNanos(long d, long m) { return 0; } > > }, > > + > > + /** > > + * Time unit representing twenty four hours > > + */ > > DAYS { > > public long toNanos(long d) { return x(d, C6/C0, MAX/(C6/C0)); > } > > public long toMicros(long d) { return x(d, C6/C1, MAX/(C6/C1)); > } > > > > > > -Chris. > From joe.darcy at oracle.com Thu Jul 25 20:33:05 2013 From: joe.darcy at oracle.com (Joe Darcy) Date: Thu, 25 Jul 2013 13:33:05 -0700 Subject: RFR JDK 8 javac lint cleanup of java.lang.ref Message-ID: <51F18B81.4050400@oracle.com> Hello, Please review these changes to remove the javac lint warnings from the java.lang.ref package: 8021429 Fix lint warnings in java.lang.ref http://cr.openjdk.java.net/~darcy/8021429.0/ Care was taken to not change any signatures of public API elements. After doing a clean build, all the java.lang.ref regression tests pass. Full patch below. Thanks, -Joe --- old/src/share/classes/java/lang/ref/FinalReference.java 2013-07-25 13:29:12.000000000 -0700 +++ new/src/share/classes/java/lang/ref/FinalReference.java 2013-07-25 13:29:12.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,13 +25,12 @@ package java.lang.ref; - -/* Final references, used to implement finalization */ - +/** + * Final references, used to implement finalization + */ class FinalReference extends Reference { public FinalReference(T referent, ReferenceQueue q) { super(referent, q); } - } --- old/src/share/classes/java/lang/ref/Finalizer.java 2013-07-25 13:29:13.000000000 -0700 +++ new/src/share/classes/java/lang/ref/Finalizer.java 2013-07-25 13:29:13.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,16 +29,16 @@ import java.security.AccessController; -final class Finalizer extends FinalReference { /* Package-private; must be in - same package as the Reference - class */ +final class Finalizer extends FinalReference { /* Package-private; must be in + same package as the Reference + class */ /* A native method that invokes an arbitrary object's finalize method is required since the finalize method is protected */ static native void invokeFinalizeMethod(Object o) throws Throwable; - private static ReferenceQueue queue = new ReferenceQueue(); + private static ReferenceQueue queue = new ReferenceQueue<>(); private static Finalizer unfinalized = null; private static final Object lock = new Object(); --- old/src/share/classes/java/lang/ref/Reference.java 2013-07-25 13:29:14.000000000 -0700 +++ new/src/share/classes/java/lang/ref/Reference.java 2013-07-25 13:29:13.000000000 -0700 @@ -96,6 +96,7 @@ * Enqueued: next reference in queue (or this if last) * Inactive: this */ + @SuppressWarnings("rawtypes") Reference next; /* When active: next element in a discovered reference list maintained by GC (or this if last) @@ -119,7 +120,7 @@ * them. This list is protected by the above lock object. The * list uses the discovered field to link its elements. */ - private static Reference pending = null; + private static Reference pending = null; /* High-priority thread to enqueue pending References */ @@ -131,7 +132,7 @@ public void run() { for (;;) { - Reference r; + Reference r; synchronized (lock) { if (pending != null) { r = pending; @@ -166,7 +167,7 @@ continue; } - ReferenceQueue q = r.queue; + ReferenceQueue q = r.queue; if (q != ReferenceQueue.NULL) q.enqueue(r); } } --- old/src/share/classes/java/lang/ref/ReferenceQueue.java 2013-07-25 13:29:14.000000000 -0700 +++ new/src/share/classes/java/lang/ref/ReferenceQueue.java 2013-07-25 13:29:14.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,14 +40,14 @@ */ public ReferenceQueue() { } - private static class Null extends ReferenceQueue { - boolean enqueue(Reference r) { + private static class Null extends ReferenceQueue { + boolean enqueue(Reference r) { return false; } } - static ReferenceQueue NULL = new Null(); - static ReferenceQueue ENQUEUED = new Null(); + static ReferenceQueue NULL = new Null<>(); + static ReferenceQueue ENQUEUED = new Null<>(); static private class Lock { }; private Lock lock = new Lock(); @@ -58,7 +58,7 @@ synchronized (lock) { // Check that since getting the lock this reference hasn't already been // enqueued (and even then removed) - ReferenceQueue queue = r.queue; + ReferenceQueue queue = r.queue; if ((queue == NULL) || (queue == ENQUEUED)) { return false; } @@ -75,10 +75,13 @@ } } + @SuppressWarnings("unchecked") private Reference reallyPoll() { /* Must hold lock */ Reference r = head; if (r != null) { - head = (r.next == r) ? null : r.next; + head = (r.next == r) ? + null : + r.next; // Unchecked due to the next field having a raw type in Reference r.queue = NULL; r.next = r; queueLength--; From jonathan.gibbons at oracle.com Thu Jul 25 20:46:07 2013 From: jonathan.gibbons at oracle.com (Jonathan Gibbons) Date: Thu, 25 Jul 2013 13:46:07 -0700 Subject: Invalid "self-closing element not allowed" JavaDoc error In-Reply-To: <83836065-9553-4D00-B65D-314DAF502391@nicholaswilliams.net> References: <51F16363.7070405@redhat.com> <51F16AEC.70203@oracle.com> <51F175A3.4010302@oracle.com> <83836065-9553-4D00-B65D-314DAF502391@nicholaswilliams.net> Message-ID: <51F18E8F.2070001@oracle.com> First, as was pointed out earlier[1] in the original thread, the HTML 4 spec does not mention the existence of self-closing elements, and in that message, David makes a good point that
                                                                    is defined to not have an end tag, making the
                                                                    syntax doubly questionable. So what does "doclint" stand for? Read it as "doc lint" meaning it is to javadoc comments what -Xlint is to javac and lint is to C code. In other words, it is intended to be used to point out questionable (or erroneous) input. The ";" in "for (Item i: list);" is totally legal, the cast in "String s = (String) "abc"; are both legal, but we do not think it unreasonable to highlight them in code, along with all the other -X lint warnings. So too with -Xdoclint messages regarding javadoc comments. Yes, you can say that all the browsers (now) accept this syntax -- but the design intent of -Xdoclint was to highlight issues that might cause a validator to give comments. For far too long, the javadoc tool itself has generated bad code, and so the general goal in the ongoing javadoc TLC has been that given valid input, javadoc should generate valid output, where "valid" means "conforms to the published DOCTYPE" and accepted by a standard recognized validator, such as the one I cited at w3c.org. I would /strongly/ prefer that we not revert back to "is the output from javadoc accepted by all browsers?". Should -Xdoclint be opt-in or opt-out? For what its worth, this was always a controversial decision, because of the potential for discussions like this. We've ended up with a compromise. It is opt-in at javac time, which is when I'd expect most interested developers to want to use it -- as a developer, I want to see the doclint feedback at the time I'm writing my doc comments, when I'm in the compile-edit-test cycle. But it is not enabled by default for javac. But it is enabled by default in javadoc at doc-generation time. When you're generating docs, it is good for folk to know that the docs do not conform to the declared standard (i.e. HTML 4.01) If you're not interested in the feedback, you can disable it easily enough. If you are interested, a global replace of
                                                                    to
                                                                    should not be an onerous task in any modern IDE. Finally, another message [2] in the thread mentioned HTML 5. That is definitely on the upcoming radar. I would also like to see javadoc more forgiving in its input while still generating conformant output. Yes, that might mean fixing up minor transgressions. But not today. -- Jon [1] http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-July/019262.html [2] http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-July/019264.html On 07/25/2013 01:22 PM, Nick Williams wrote: > Jonathan, I don't see the "confirmation that this is not legal HTML" that you reference. I see a warning that some browsers may not interpret it correctly. But IE 5+ and all Firefox, Chrome, Netscape, Opera, etc. versions interpret it correctly. > > I understand your point about the spec not specifically allowing it. HOWEVER, I promise you there are TENS OF THOUSANDS of existing JavaDoc'd classes that will break JavaDoc generation as a result of this change. > > Maybe doclint (what does that stand for, by the way?) could be a default-off feature instead of a default-on feature? > > Nick > > On Jul 25, 2013, at 1:59 PM, Jonathan Gibbons wrote: > >> The message about "self-closing element not allowed" is because self-closing elements are not allowed in HTML 4. The message is generated by the new "doclint" feature available in javac and javadoc, which is specifically intended to detect issues in javadoc comments. If you do not wish to use the new doclint feature, you can disable it with -Xdoclint:none. >> >> >> As confirmation that this is not legal HTML, try typing a code fragment such as the following into the W3c validator at http://validator.w3.org/check >> >>> >>> >>> test >>> >>> >>>
                                                                    >>> >>> >> You will get the following warning: >> >>> 1. /Line 6 , Column 4/: >>> NET-enabling start-tag requires SHORTTAG YES >>> || >>> >>> For the current document, the validator interprets strings like >>> || according to legacy rules that break the expectations of >>> most authors and thus cause confusing warnings and error messages >>> from the validator. This interpretation is triggered by HTML 4 >>> documents or other SGML-based HTML documents. To avoid the >>> messages, simply remove the "/" character in such contexts. NB: If >>> you expect || to be interpreted as an XML-compatible >>> "self-closing" tag, then you need to use XHTML or HTML5. >>> >>> This warning and related errors may also be caused by an unquoted >>> attribute value containing one or more "/". Example: |>> href=http://w3c.org>W3C|. In such cases, the solution is to >>> put quotation marks around the value. >>> >> -- Jon >> >> >> >> On 07/25/2013 11:14 AM, Alan Bateman wrote: >>> Re: Invalid "self-closing element not allowed" JavaDoc error.eml >>> >>> Subject: >>> Re: Invalid "self-closing element not allowed" JavaDoc error >>> From: >>> "David M. Lloyd" >>> Date: >>> 07/25/2013 10:41 AM >>> >>> To: >>> core-libs-dev at openjdk.java.net >>> >>> >>> On 07/25/2013 12:27 PM, Nick Williams wrote: >>>> My apologies if this is not the right place to address this. If so, please forgive and direct me to the correct list. >>>> >>>> There are a lot of people/projects complaining about Java 8's new "self-closing element not allowed" error when compiling JavaDoc that has legal
                                                                    tags in it (just google "self-closing element not allowed" in quotes). Some (including myself) are asking, "Why should we fix this? The problem is not in the JavaDoc, it's in the JavDoc compiler." However, I haven't been able to find anyone who has actually broached the subject on any mailing lists. >>>> >>>>
                                                                    is completely legal. While it is not strictly required by the HTML standard (unless you're using XHTML), using self-closing tags is /preferred/ because it's more obvious what the intention is. Perhaps most importantly,
                                                                    is supported on 100% of browsers and is used throughout JavaDoc all over the place. I have a feeling that once more projects start compiling on a released Java 8, this is going to make a fair number of people angry that hey have to "fix" (read: needlessly change) potentially thousands of classes' worth of JavaDoc. >>>> >>>> What was the motivation behind the new "self-closing element not allowed" check and how can we make it go away? >>> Not really having a stake in this, I just want to observe a couple things. First, from what I can see, the HTML 4.x specifications make no reference to self-closing elements or their syntactical realization. As far as I can tell (not being any kind of SGML expert), self-closing elements are not valid or meaningful HTML according to its SGML definition. >>> >>> Finally, even if they were allowed, the BR tag is explicitly defined to forbid an end tag; self-closing elements imply an end tag (at least they do in XML, which appears to be the next-nearest concrete specification that has anything to say on the matter). >>> >>> See http://www.w3.org/TR/html401/struct/text.html#edef-BR for more info. >>> >>> So I'm curious when you say "using self-closing tags is /preferred/", do you have any sources to cite? >>> -- >>> - DML >>> >>> Re: Invalid "self-closing element not allowed" JavaDoc error.eml >>> >>> Subject: >>> Re: Invalid "self-closing element not allowed" JavaDoc error >>> From: >>> Stephen Colebourne >>> Date: >>> 07/25/2013 10:59 AM >>> >>> To: >>> core-libs-dev at openjdk.java.net >>> >>> >>> Its complicated, see for example: >>> http://stackoverflow.com/questions/3558119/are-self-closing-tags-valid-in-html5 >>> >>> The key point here is not whether its in the standard or not, but what >>> people actually*do*. >>> >>> There is no doubt in my mind that
                                                                    br space slash is very common >>> indeed. Its certainly my default. The javadoc validator should be as >>> lenient as browsers are in this case. >>> >>> Stephen >>> >>> >>> On 25 July 2013 18:41, David M. Lloyd wrote: >>>>> On 07/25/2013 12:27 PM, Nick Williams wrote: >>>>>>> My apologies if this is not the right place to address this. If so, please >>>>>>> forgive and direct me to the correct list. >>>>>>> >>>>>>> There are a lot of people/projects complaining about Java 8's new >>>>>>> "self-closing element not allowed" error when compiling JavaDoc that has >>>>>>> legal
                                                                    tags in it (just google "self-closing element not allowed" in >>>>>>> quotes). Some (including myself) are asking, "Why should we fix this? The >>>>>>> problem is not in the JavaDoc, it's in the JavDoc compiler." However, I >>>>>>> haven't been able to find anyone who has actually broached the subject on >>>>>>> any mailing lists. >>>>>>> >>>>>>>
                                                                    is completely legal. While it is not strictly required by the HTML >>>>>>> standard (unless you're using XHTML), using self-closing tags is/preferred/ >>>>>>> because it's more obvious what the intention is. Perhaps most importantly, >>>>>>>
                                                                    is supported on 100% of browsers and is used throughout JavaDoc all >>>>>>> over the place. I have a feeling that once more projects start compiling on >>>>>>> a released Java 8, this is going to make a fair number of people angry that >>>>>>> hey have to "fix" (read: needlessly change) potentially thousands of >>>>>>> classes' worth of JavaDoc. >>>>>>> >>>>>>> What was the motivation behind the new "self-closing element not allowed" >>>>>>> check and how can we make it go away? >>>>> >>>>> Not really having a stake in this, I just want to observe a couple things. >>>>> First, from what I can see, the HTML 4.x specifications make no reference to >>>>> self-closing elements or their syntactical realization. As far as I can >>>>> tell (not being any kind of SGML expert), self-closing elements are not >>>>> valid or meaningful HTML according to its SGML definition. >>>>> >>>>> Finally, even if they were allowed, the BR tag is explicitly defined to >>>>> forbid an end tag; self-closing elements imply an end tag (at least they do >>>>> in XML, which appears to be the next-nearest concrete specification that has >>>>> anything to say on the matter). >>>>> >>>>> Seehttp://www.w3.org/TR/html401/struct/text.html#edef-BR for more info. >>>>> >>>>> So I'm curious when you say "using self-closing tags is/preferred/", do you >>>>> have any sources to cite? >>>>> -- >>>>> - DML From Lance.Andersen at oracle.com Thu Jul 25 20:47:29 2013 From: Lance.Andersen at oracle.com (Lance Andersen - Oracle) Date: Thu, 25 Jul 2013 16:47:29 -0400 Subject: RFR JDK 8 javac lint cleanup of java.lang.ref In-Reply-To: <51F18B81.4050400@oracle.com> References: <51F18B81.4050400@oracle.com> Message-ID: <234C255C-8831-4527-906A-DAA27951918C@oracle.com> Looks fine joe On Jul 25, 2013, at 4:33 PM, Joe Darcy wrote: > Hello, > > Please review these changes to remove the javac lint warnings from the java.lang.ref package: > > 8021429 Fix lint warnings in java.lang.ref > http://cr.openjdk.java.net/~darcy/8021429.0/ > > Care was taken to not change any signatures of public API elements. After doing a clean build, all the java.lang.ref regression tests pass. Full patch below. > > Thanks, > > -Joe > > --- old/src/share/classes/java/lang/ref/FinalReference.java 2013-07-25 13:29:12.000000000 -0700 > +++ new/src/share/classes/java/lang/ref/FinalReference.java 2013-07-25 13:29:12.000000000 -0700 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved. > + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. > * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. > * > * This code is free software; you can redistribute it and/or modify it > @@ -25,13 +25,12 @@ > > package java.lang.ref; > > - > -/* Final references, used to implement finalization */ > - > +/** > + * Final references, used to implement finalization > + */ > class FinalReference extends Reference { > > public FinalReference(T referent, ReferenceQueue q) { > super(referent, q); > } > - > } > --- old/src/share/classes/java/lang/ref/Finalizer.java 2013-07-25 13:29:13.000000000 -0700 > +++ new/src/share/classes/java/lang/ref/Finalizer.java 2013-07-25 13:29:13.000000000 -0700 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. > + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. > * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. > * > * This code is free software; you can redistribute it and/or modify it > @@ -29,16 +29,16 @@ > import java.security.AccessController; > > > -final class Finalizer extends FinalReference { /* Package-private; must be in > - same package as the Reference > - class */ > +final class Finalizer extends FinalReference { /* Package-private; must be in > + same package as the Reference > + class */ > > /* A native method that invokes an arbitrary object's finalize method is > required since the finalize method is protected > */ > static native void invokeFinalizeMethod(Object o) throws Throwable; > > - private static ReferenceQueue queue = new ReferenceQueue(); > + private static ReferenceQueue queue = new ReferenceQueue<>(); > private static Finalizer unfinalized = null; > private static final Object lock = new Object(); > > --- old/src/share/classes/java/lang/ref/Reference.java 2013-07-25 13:29:14.000000000 -0700 > +++ new/src/share/classes/java/lang/ref/Reference.java 2013-07-25 13:29:13.000000000 -0700 > @@ -96,6 +96,7 @@ > * Enqueued: next reference in queue (or this if last) > * Inactive: this > */ > + @SuppressWarnings("rawtypes") > Reference next; > > /* When active: next element in a discovered reference list maintained by GC (or this if last) > @@ -119,7 +120,7 @@ > * them. This list is protected by the above lock object. The > * list uses the discovered field to link its elements. > */ > - private static Reference pending = null; > + private static Reference pending = null; > > /* High-priority thread to enqueue pending References > */ > @@ -131,7 +132,7 @@ > > public void run() { > for (;;) { > - Reference r; > + Reference r; > synchronized (lock) { > if (pending != null) { > r = pending; > @@ -166,7 +167,7 @@ > continue; > } > > - ReferenceQueue q = r.queue; > + ReferenceQueue q = r.queue; > if (q != ReferenceQueue.NULL) q.enqueue(r); > } > } > --- old/src/share/classes/java/lang/ref/ReferenceQueue.java 2013-07-25 13:29:14.000000000 -0700 > +++ new/src/share/classes/java/lang/ref/ReferenceQueue.java 2013-07-25 13:29:14.000000000 -0700 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 1997, 2005, Oracle and/or its affiliates. All rights reserved. > + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. > * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. > * > * This code is free software; you can redistribute it and/or modify it > @@ -40,14 +40,14 @@ > */ > public ReferenceQueue() { } > > - private static class Null extends ReferenceQueue { > - boolean enqueue(Reference r) { > + private static class Null extends ReferenceQueue { > + boolean enqueue(Reference r) { > return false; > } > } > > - static ReferenceQueue NULL = new Null(); > - static ReferenceQueue ENQUEUED = new Null(); > + static ReferenceQueue NULL = new Null<>(); > + static ReferenceQueue ENQUEUED = new Null<>(); > > static private class Lock { }; > private Lock lock = new Lock(); > @@ -58,7 +58,7 @@ > synchronized (lock) { > // Check that since getting the lock this reference hasn't already been > // enqueued (and even then removed) > - ReferenceQueue queue = r.queue; > + ReferenceQueue queue = r.queue; > if ((queue == NULL) || (queue == ENQUEUED)) { > return false; > } > @@ -75,10 +75,13 @@ > } > } > > + @SuppressWarnings("unchecked") > private Reference reallyPoll() { /* Must hold lock */ > Reference r = head; > if (r != null) { > - head = (r.next == r) ? null : r.next; > + head = (r.next == r) ? > + null : > + r.next; // Unchecked due to the next field having a raw type in Reference > r.queue = NULL; > r.next = r; > queueLength--; > -------------- next part -------------- Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 Oracle Java Engineering 1 Network Drive Burlington, MA 01803 Lance.Andersen at oracle.com From mike.duigou at oracle.com Thu Jul 25 20:50:21 2013 From: mike.duigou at oracle.com (Mike Duigou) Date: Thu, 25 Jul 2013 13:50:21 -0700 Subject: RFR JDK 8 javac lint cleanup of java.lang.ref In-Reply-To: <51F18B81.4050400@oracle.com> References: <51F18B81.4050400@oracle.com> Message-ID: <7C50E295-0F05-4C37-81A8-BC1BC92E0C74@oracle.com> These look fine to me. Mike On Jul 25 2013, at 13:33 , Joe Darcy wrote: > Hello, > > Please review these changes to remove the javac lint warnings from the java.lang.ref package: > > 8021429 Fix lint warnings in java.lang.ref > http://cr.openjdk.java.net/~darcy/8021429.0/ > > Care was taken to not change any signatures of public API elements. After doing a clean build, all the java.lang.ref regression tests pass. Full patch below. > > Thanks, > > -Joe > > --- old/src/share/classes/java/lang/ref/FinalReference.java 2013-07-25 13:29:12.000000000 -0700 > +++ new/src/share/classes/java/lang/ref/FinalReference.java 2013-07-25 13:29:12.000000000 -0700 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved. > + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. > * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. > * > * This code is free software; you can redistribute it and/or modify it > @@ -25,13 +25,12 @@ > > package java.lang.ref; > > - > -/* Final references, used to implement finalization */ > - > +/** > + * Final references, used to implement finalization > + */ > class FinalReference extends Reference { > > public FinalReference(T referent, ReferenceQueue q) { > super(referent, q); > } > - > } > --- old/src/share/classes/java/lang/ref/Finalizer.java 2013-07-25 13:29:13.000000000 -0700 > +++ new/src/share/classes/java/lang/ref/Finalizer.java 2013-07-25 13:29:13.000000000 -0700 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. > + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. > * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. > * > * This code is free software; you can redistribute it and/or modify it > @@ -29,16 +29,16 @@ > import java.security.AccessController; > > > -final class Finalizer extends FinalReference { /* Package-private; must be in > - same package as the Reference > - class */ > +final class Finalizer extends FinalReference { /* Package-private; must be in > + same package as the Reference > + class */ > > /* A native method that invokes an arbitrary object's finalize method is > required since the finalize method is protected > */ > static native void invokeFinalizeMethod(Object o) throws Throwable; > > - private static ReferenceQueue queue = new ReferenceQueue(); > + private static ReferenceQueue queue = new ReferenceQueue<>(); > private static Finalizer unfinalized = null; > private static final Object lock = new Object(); > > --- old/src/share/classes/java/lang/ref/Reference.java 2013-07-25 13:29:14.000000000 -0700 > +++ new/src/share/classes/java/lang/ref/Reference.java 2013-07-25 13:29:13.000000000 -0700 > @@ -96,6 +96,7 @@ > * Enqueued: next reference in queue (or this if last) > * Inactive: this > */ > + @SuppressWarnings("rawtypes") > Reference next; > > /* When active: next element in a discovered reference list maintained by GC (or this if last) > @@ -119,7 +120,7 @@ > * them. This list is protected by the above lock object. The > * list uses the discovered field to link its elements. > */ > - private static Reference pending = null; > + private static Reference pending = null; > > /* High-priority thread to enqueue pending References > */ > @@ -131,7 +132,7 @@ > > public void run() { > for (;;) { > - Reference r; > + Reference r; > synchronized (lock) { > if (pending != null) { > r = pending; > @@ -166,7 +167,7 @@ > continue; > } > > - ReferenceQueue q = r.queue; > + ReferenceQueue q = r.queue; > if (q != ReferenceQueue.NULL) q.enqueue(r); > } > } > --- old/src/share/classes/java/lang/ref/ReferenceQueue.java 2013-07-25 13:29:14.000000000 -0700 > +++ new/src/share/classes/java/lang/ref/ReferenceQueue.java 2013-07-25 13:29:14.000000000 -0700 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 1997, 2005, Oracle and/or its affiliates. All rights reserved. > + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. > * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. > * > * This code is free software; you can redistribute it and/or modify it > @@ -40,14 +40,14 @@ > */ > public ReferenceQueue() { } > > - private static class Null extends ReferenceQueue { > - boolean enqueue(Reference r) { > + private static class Null extends ReferenceQueue { > + boolean enqueue(Reference r) { > return false; > } > } > > - static ReferenceQueue NULL = new Null(); > - static ReferenceQueue ENQUEUED = new Null(); > + static ReferenceQueue NULL = new Null<>(); > + static ReferenceQueue ENQUEUED = new Null<>(); > > static private class Lock { }; > private Lock lock = new Lock(); > @@ -58,7 +58,7 @@ > synchronized (lock) { > // Check that since getting the lock this reference hasn't already been > // enqueued (and even then removed) > - ReferenceQueue queue = r.queue; > + ReferenceQueue queue = r.queue; > if ((queue == NULL) || (queue == ENQUEUED)) { > return false; > } > @@ -75,10 +75,13 @@ > } > } > > + @SuppressWarnings("unchecked") > private Reference reallyPoll() { /* Must hold lock */ > Reference r = head; > if (r != null) { > - head = (r.next == r) ? null : r.next; > + head = (r.next == r) ? > + null : > + r.next; // Unchecked due to the next field having a raw type in Reference > r.queue = NULL; > r.next = r; > queueLength--; > From Alan.Bateman at oracle.com Thu Jul 25 20:58:21 2013 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Thu, 25 Jul 2013 13:58:21 -0700 Subject: RFR JDK 8 javac lint cleanup of java.lang.ref In-Reply-To: <51F18B81.4050400@oracle.com> References: <51F18B81.4050400@oracle.com> Message-ID: <51F1916D.4080101@oracle.com> On 25/07/2013 13:33, Joe Darcy wrote: > Hello, > > Please review these changes to remove the javac lint warnings from the > java.lang.ref package: > > 8021429 Fix lint warnings in java.lang.ref > http://cr.openjdk.java.net/~darcy/8021429.0/ > > Care was taken to not change any signatures of public API elements. > After doing a clean build, all the java.lang.ref regression tests > pass. Full patch below. > > Thanks, > > -Joe This looks okay to me, just wondering Reference.next needs to be a raw type (you may have tried possible solutions to this already). Minor comment on Finalizer is that the comment on the class being package-private is now misaligned. -Alan. From nicholas+openjdk at nicholaswilliams.net Thu Jul 25 21:01:20 2013 From: nicholas+openjdk at nicholaswilliams.net (Nick Williams) Date: Thu, 25 Jul 2013 16:01:20 -0500 Subject: Invalid "self-closing element not allowed" JavaDoc error In-Reply-To: <51F18E8F.2070001@oracle.com> References: <51F16363.7070405@redhat.com> <51F16AEC.70203@oracle.com> <51F175A3.4010302@oracle.com> <83836065-9553-4D00-B65D-314DAF502391@nicholaswilliams.net> <51F18E8F.2070001@oracle.com> Message-ID: Okay. To address some of your points (not in order): - I do not interpret "no end tags" as a strict prohibition on self-closing elements. I think many people agree with me. I think the fact that browsers barf at

                                                                    but not
                                                                    reinforces this interpretation. - HTML5 does allow self-closing elements ... but ONLY for void elements (not empty elements that allow content). - So you say -Xdoclint for JavaDoc was meant to be the analog to -Xlint for JavaC, and I buy that ... except that it wasn't implemented that way. -Xlint produces /warnings/. -Xdoclint produces /errors/ and causes JavaDoc to fail. If -Xlint produces warnings and -Werror makes those warnings errors, then IMO -Xdoclint should also produce warnings and -Werror (or possibly something like -Wdocerror) should make those warnings errors. After all, the
                                                                    problem that the W3 validator points out is a WARNING, not an ERROR. - Somewhat off topic, every JavaDoc page produced by Java 8 right now has at least one W3 validator warning, because they're all missing a character encoding declaration (assumed to be UTF-8 for validation, but that's not portable). Nick On Jul 25, 2013, at 3:46 PM, Jonathan Gibbons wrote: > First, as was pointed out earlier[1] in the original thread, the HTML 4 spec > does not mention the existence of self-closing elements, and in that message, > David makes a good point that
                                                                    is defined to not have an end tag, > making the
                                                                    syntax doubly questionable. > > So what does "doclint" stand for? Read it as "doc lint" meaning it is to > javadoc comments what -Xlint is to javac and lint is to C code. In other > words, it is intended to be used to point out questionable (or erroneous) > input. The ";" in "for (Item i: list);" is totally legal, the cast in "String s = > (String) "abc"; are both legal, but we do not think it unreasonable to > highlight them in code, along with all the other -X lint warnings. So > too with -Xdoclint messages regarding javadoc comments. > > Yes, you can say that all the browsers (now) accept this syntax -- but > the design intent of -Xdoclint was to highlight issues that might cause > a validator to give comments. For far too long, the javadoc tool itself > has generated bad code, and so the general goal in the ongoing javadoc > TLC has been that given valid input, javadoc should generate valid output, > where "valid" means "conforms to the published DOCTYPE" and accepted > by a standard recognized validator, such as the one I cited at w3c.org. > > I would /strongly/ prefer that we not revert back to "is the output from javadoc > accepted by all browsers?". > > Should -Xdoclint be opt-in or opt-out? For what its worth, this was > always a controversial decision, because of the potential for discussions like > this. We've ended up with a compromise. It is opt-in at javac time, which is > when I'd expect most interested developers to want to use it -- as a developer, > I want to see the doclint feedback at the time I'm writing my doc comments, > when I'm in the compile-edit-test cycle. But it is not enabled by default for > javac. But it is enabled by default in javadoc at doc-generation time. > When you're generating docs, it is good for folk to know that the docs do > not conform to the declared standard (i.e. HTML 4.01) If you're not interested > in the feedback, you can disable it easily enough. If you are interested, > a global replace of
                                                                    to
                                                                    should not be an onerous task in any > modern IDE. > > Finally, another message [2] in the thread mentioned HTML 5. That is definitely > on the upcoming radar. I would also like to see javadoc more forgiving in > its input while still generating conformant output. Yes, that might mean fixing > up minor transgressions. But not today. > > -- Jon > > > [1] http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-July/019262.html > [2] http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-July/019264.html > > On 07/25/2013 01:22 PM, Nick Williams wrote: >> Jonathan, I don't see the "confirmation that this is not legal HTML" that you reference. I see a warning that some browsers may not interpret it correctly. But IE 5+ and all Firefox, Chrome, Netscape, Opera, etc. versions interpret it correctly. >> >> I understand your point about the spec not specifically allowing it. HOWEVER, I promise you there are TENS OF THOUSANDS of existing JavaDoc'd classes that will break JavaDoc generation as a result of this change. >> >> Maybe doclint (what does that stand for, by the way?) could be a default-off feature instead of a default-on feature? >> >> Nick >> >> On Jul 25, 2013, at 1:59 PM, Jonathan Gibbons wrote: >> >>> The message about "self-closing element not allowed" is because self-closing elements are not allowed in HTML 4. The message is generated by the new "doclint" feature available in javac and javadoc, which is specifically intended to detect issues in javadoc comments. If you do not wish to use the new doclint feature, you can disable it with -Xdoclint:none. >>> >>> >>> As confirmation that this is not legal HTML, try typing a code fragment such as the following into the W3c validator at http://validator.w3.org/check >>> >>>> >>>> >>>> test >>>> >>>> >>>>
                                                                    >>>> >>>> >>> You will get the following warning: >>> >>>> 1. /Line 6 , Column 4/: >>>> NET-enabling start-tag requires SHORTTAG YES >>>> || >>>> >>>> For the current document, the validator interprets strings like >>>> || according to legacy rules that break the expectations of >>>> most authors and thus cause confusing warnings and error messages >>>> from the validator. This interpretation is triggered by HTML 4 >>>> documents or other SGML-based HTML documents. To avoid the >>>> messages, simply remove the "/" character in such contexts. NB: If >>>> you expect || to be interpreted as an XML-compatible >>>> "self-closing" tag, then you need to use XHTML or HTML5. >>>> >>>> This warning and related errors may also be caused by an unquoted >>>> attribute value containing one or more "/". Example: |>>> href=http://w3c.org>W3C|. In such cases, the solution is to >>>> put quotation marks around the value. >>>> >>> -- Jon >>> >>> >>> >>> On 07/25/2013 11:14 AM, Alan Bateman wrote: >>>> Re: Invalid "self-closing element not allowed" JavaDoc error.eml >>>> >>>> Subject: >>>> Re: Invalid "self-closing element not allowed" JavaDoc error >>>> From: >>>> "David M. Lloyd" >>>> Date: >>>> 07/25/2013 10:41 AM >>>> >>>> To: >>>> core-libs-dev at openjdk.java.net >>>> >>>> >>>> On 07/25/2013 12:27 PM, Nick Williams wrote: >>>>> My apologies if this is not the right place to address this. If so, please forgive and direct me to the correct list. >>>>> >>>>> There are a lot of people/projects complaining about Java 8's new "self-closing element not allowed" error when compiling JavaDoc that has legal
                                                                    tags in it (just google "self-closing element not allowed" in quotes). Some (including myself) are asking, "Why should we fix this? The problem is not in the JavaDoc, it's in the JavDoc compiler." However, I haven't been able to find anyone who has actually broached the subject on any mailing lists. >>>>> >>>>>
                                                                    is completely legal. While it is not strictly required by the HTML standard (unless you're using XHTML), using self-closing tags is /preferred/ because it's more obvious what the intention is. Perhaps most importantly,
                                                                    is supported on 100% of browsers and is used throughout JavaDoc all over the place. I have a feeling that once more projects start compiling on a released Java 8, this is going to make a fair number of people angry that hey have to "fix" (read: needlessly change) potentially thousands of classes' worth of JavaDoc. >>>>> >>>>> What was the motivation behind the new "self-closing element not allowed" check and how can we make it go away? >>>> Not really having a stake in this, I just want to observe a couple things. First, from what I can see, the HTML 4.x specifications make no reference to self-closing elements or their syntactical realization. As far as I can tell (not being any kind of SGML expert), self-closing elements are not valid or meaningful HTML according to its SGML definition. >>>> >>>> Finally, even if they were allowed, the BR tag is explicitly defined to forbid an end tag; self-closing elements imply an end tag (at least they do in XML, which appears to be the next-nearest concrete specification that has anything to say on the matter). >>>> >>>> See http://www.w3.org/TR/html401/struct/text.html#edef-BR for more info. >>>> >>>> So I'm curious when you say "using self-closing tags is /preferred/", do you have any sources to cite? >>>> -- >>>> - DML >>>> >>>> Re: Invalid "self-closing element not allowed" JavaDoc error.eml >>>> >>>> Subject: >>>> Re: Invalid "self-closing element not allowed" JavaDoc error >>>> From: >>>> Stephen Colebourne >>>> Date: >>>> 07/25/2013 10:59 AM >>>> >>>> To: >>>> core-libs-dev at openjdk.java.net >>>> >>>> >>>> Its complicated, see for example: >>>> http://stackoverflow.com/questions/3558119/are-self-closing-tags-valid-in-html5 >>>> >>>> The key point here is not whether its in the standard or not, but what >>>> people actually*do*. >>>> >>>> There is no doubt in my mind that
                                                                    br space slash is very common >>>> indeed. Its certainly my default. The javadoc validator should be as >>>> lenient as browsers are in this case. >>>> >>>> Stephen >>>> >>>> >>>> On 25 July 2013 18:41, David M. Lloyd wrote: >>>>>> On 07/25/2013 12:27 PM, Nick Williams wrote: >>>>>>>> My apologies if this is not the right place to address this. If so, please >>>>>>>> forgive and direct me to the correct list. >>>>>>>> >>>>>>>> There are a lot of people/projects complaining about Java 8's new >>>>>>>> "self-closing element not allowed" error when compiling JavaDoc that has >>>>>>>> legal
                                                                    tags in it (just google "self-closing element not allowed" in >>>>>>>> quotes). Some (including myself) are asking, "Why should we fix this? The >>>>>>>> problem is not in the JavaDoc, it's in the JavDoc compiler." However, I >>>>>>>> haven't been able to find anyone who has actually broached the subject on >>>>>>>> any mailing lists. >>>>>>>> >>>>>>>>
                                                                    is completely legal. While it is not strictly required by the HTML >>>>>>>> standard (unless you're using XHTML), using self-closing tags is/preferred/ >>>>>>>> because it's more obvious what the intention is. Perhaps most importantly, >>>>>>>>
                                                                    is supported on 100% of browsers and is used throughout JavaDoc all >>>>>>>> over the place. I have a feeling that once more projects start compiling on >>>>>>>> a released Java 8, this is going to make a fair number of people angry that >>>>>>>> hey have to "fix" (read: needlessly change) potentially thousands of >>>>>>>> classes' worth of JavaDoc. >>>>>>>> >>>>>>>> What was the motivation behind the new "self-closing element not allowed" >>>>>>>> check and how can we make it go away? >>>>>> >>>>>> Not really having a stake in this, I just want to observe a couple things. >>>>>> First, from what I can see, the HTML 4.x specifications make no reference to >>>>>> self-closing elements or their syntactical realization. As far as I can >>>>>> tell (not being any kind of SGML expert), self-closing elements are not >>>>>> valid or meaningful HTML according to its SGML definition. >>>>>> >>>>>> Finally, even if they were allowed, the BR tag is explicitly defined to >>>>>> forbid an end tag; self-closing elements imply an end tag (at least they do >>>>>> in XML, which appears to be the next-nearest concrete specification that has >>>>>> anything to say on the matter). >>>>>> >>>>>> Seehttp://www.w3.org/TR/html401/struct/text.html#edef-BR for more info. >>>>>> >>>>>> So I'm curious when you say "using self-closing tags is/preferred/", do you >>>>>> have any sources to cite? >>>>>> -- >>>>>> - DML > From joe.darcy at oracle.com Thu Jul 25 21:16:40 2013 From: joe.darcy at oracle.com (Joe Darcy) Date: Thu, 25 Jul 2013 14:16:40 -0700 Subject: RFR JDK 8 javac lint cleanup of java.lang.ref In-Reply-To: <51F1916D.4080101@oracle.com> References: <51F18B81.4050400@oracle.com> <51F1916D.4080101@oracle.com> Message-ID: <51F195B8.7010206@oracle.com> On 07/25/2013 01:58 PM, Alan Bateman wrote: > On 25/07/2013 13:33, Joe Darcy wrote: >> Hello, >> >> Please review these changes to remove the javac lint warnings from >> the java.lang.ref package: >> >> 8021429 Fix lint warnings in java.lang.ref >> http://cr.openjdk.java.net/~darcy/8021429.0/ >> >> Care was taken to not change any signatures of public API elements. >> After doing a clean build, all the java.lang.ref regression tests >> pass. Full patch below. >> >> Thanks, >> >> -Joe > This looks okay to me, just wondering Reference.next needs to be a raw > type (you may have tried possible solutions to this already). After some amount of examination, I didn't find a way to fix this. The description of the protocol around that field is /* When active: NULL * pending: this * Enqueued: next reference in queue (or this if last) * Inactive: this */ None of Reference Reference Reference Reference work as the declared type of the field given other uses of the field in the package. > > Minor comment on Finalizer is that the comment on the class being > package-private is now misaligned. > > I'll fix that before I push. Thanks all for the quick reviews. -Joe From brian.burkhalter at oracle.com Thu Jul 25 21:28:03 2013 From: brian.burkhalter at oracle.com (Brian Burkhalter) Date: Thu, 25 Jul 2013 14:28:03 -0700 Subject: Java 8 RFR 6378503: In java.math.BigDecimal, division by one returns zero In-Reply-To: <51F0A329.9010802@oracle.com> References: <46EBFCD4-D336-4336-9D28-C8F2CAB9CB21@oracle.com> <51F0A329.9010802@oracle.com> Message-ID: <56486B03-4047-408D-AE25-937A28DDB5F8@oracle.com> Hi Joe, On Jul 24, 2013, at 9:01 PM, Joe Darcy wrote: > I took a look through the code and I don't see how sdiff == Integer.MIN_VALUE is handled. This case, if compareMagnitude() does not return at lines 2668 or 2670, intentionally falls through to line 2690. Otherwise, if hypothetically sdiff were equal to Integer.MIN_VALUE, then evaluating line 2677 would overflow. It is not actually apparent to me however whether line 2671 would ever be reached were sdiff == Integer.MIN_VALUE. > In any case, as long as the runtimes and memory usage are tractable, the set of test cases should be augmented to include sdiff == Integer.MIN_VALUE and (long)Integer.MIN_VALUE + 1, etc. From what I can tell by inspection, sdiff mirrors the MathContext precision (mcp) and all paths will attempt to calculate 10^e where "e" is approximately or exactly mcp. This computation would run for days. I don't yet see a way to test these cases. Thanks, Brian From ivan.gerasimov at oracle.com Thu Jul 25 23:56:18 2013 From: ivan.gerasimov at oracle.com (Ivan Gerasimov) Date: Fri, 26 Jul 2013 03:56:18 +0400 Subject: RFR [8020669] java.nio.file.Files.readAllBytes() does not read any data when Files.size() is 0 In-Reply-To: <51F12B3E.4010603@oracle.com> References: <51E97416.20506@oracle.com> <51E98043.6030102@oracle.com> <51E9853E.8020409@redhat.com> <51E985AD.60401@redhat.com> <51EB0BFF.3030106@oracle.com> <51ED57D8.90001@oracle.com> <51EE55AC.5000902@oracle.com> <51EE8E9A.6040806@redhat.com> <51EF1B43.9030200@oracle.com> <51F06789.1050403@oracle.com> <51F12B3E.4010603@oracle.com> Message-ID: <51F1BB22.6040405@oracle.com> Hi Roger! On 25.07.2013 17:42, roger riggs wrote: > Hi Ivan, > > Thank you for your diligence. Thank you for your patience :) > 1) Should the test use an alternate mechanism to read the file > (FileInputStream) > and confirm the length of the array? This file can change from read to read. But it should not be empty, and that's what we check. I moved the test from a separate file to BytesAndLines.java. I've also added testing of how Files.readAllLines() reads from procfs files (it already does well.) > 2) There is an edge case where the file size is between MAX_ARRAY_SIZE > and Integer.MAX_VALUE that should be avoided. Yes, you're right. I rewrote the logic in a simpler way with no overflowing and casting to long. Would you please help review an updated webrev? http://cr.openjdk.java.net/~igerasim/8020669/4/webrev/ Sincerely yours, Ivan > The lines at L3022 are confusing. > If the max array size is MAX_BUFFER_SIZE then it should be used > also at L3063 in readAllBytes. > > L3015-3026: The logic around the 3 nested if's is a bit confusing for > the actions being taken. > By switching to a long for newCapacity this can be easier to read. > > if (capacity == MAX_INTEGER) { > throw ... > } > long newCapacity = ((long)capacity) << 1; > newCapacity = Math.max(newCapacity, BUFFER_SIZE); // at least BUFFER_SIZE > newCapacity = Math.min(newCapacity, MAX_BUFFER_SIZE); // at most MAX_BUFFER_SIZE > capacity = (int) newCapacity; > > buf = Arrays.copyOf(buf, capacity); > buf[nread++] = (byte)n; > rem = buf.length - nread; > Thanks, Roger > > BTW, I'm not an official reviewer > > On 7/24/2013 7:47 PM, Ivan Gerasimov wrote: >> Hello everybody! >> >> Would you please review an updated webrev? >> http://cr.openjdk.java.net/~igerasim/8020669/3/webrev/ >> >> >> Thanks in advance, >> Ivan >> >> >> On 24.07.2013 23:36, Martin Buchholz wrote: >>> Use javadoc style even in private methods. >>> s/Read/Reads/ >>> Use @param initialSize >>> /** >>> + * Read all the bytes from an input stream. The {@code initialSize} >>> + * parameter indicates the initial size of the byte[] to allocate. >>> + */ >>> --- >>> >>> This needs to be tested for an ordinary zero-length file. It looks >>> like for the zero case >>> + int newCapacity = capacity << 1; >>> will infloop not actually increasing the buffer. >>> >>> --- >>> >>> You might want to copy this technique from ArrayList et al: >>> >>> >>> /** >>> * The maximum size of array to allocate. >>> * Some VMs reserve some header words in an array. >>> * Attempts to allocate larger arrays may result in >>> * OutOfMemoryError: Requested array size exceeds VM limit >>> */ >>> private static final int MAX_ARRAY_SIZE = Integer.MAX_VALUE - 8; >>> >>> >>> >>> >>> On Tue, Jul 23, 2013 at 5:09 PM, Ivan Gerasimov >>> > wrote: >>> >>> Would you please take a look at the updated webrev? >>> http://cr.openjdk.java.net/~igerasim/8020669/2/webrev/ >>> >>> >>> readAllBytes() was recently (in b93) changed by Alan Bateman to >>> fix 8014928. >>> >>> Here's what I've done: >>> - reverted readAllBytes() to its implementation prior b93. >>> - modified it to address both 8020669 and 8014928. >>> >>> http://bugs.sun.com/view_bug.do?bug_id=8020669 >>> >>> http://bugs.sun.com/view_bug.do?bug_id=8014928 >>> >>> Sincerely yours, >>> Ivan >>> >>> >>> On 23.07.2013 18:09, David M. Lloyd wrote: >>> >>> Here's how it should behave: >>> >>> - allocate 'size' byte byte array >>> - if size > 0: >>> - use simple old I/O to read into the array >>> - do a one-byte read(), if not EOF then expand the array, >>> using a simple growth pattern like 3/2 (with a special case >>> for 0), and continue reading until EOF >>> - if the array matches the size of the file, return the >>> array, else use copyOf() to shrink it >>> >>> This way you only ever copy the array size() was wrong. >>> >>> On 07/23/2013 05:06 AM, Ivan Gerasimov wrote: >>> >>> Hi Roger! >>> >>> This is how my implementation behaves: >>> - allocate 'size' bytes in BAOS >>> - allocate 8k for temp buffer >>> - in cycle read 8k or less bytes from input stream and >>> copy them into BAOS >>> - if capacity of BAOS isn't sufficient (file had grown), >>> its buffer will >>> be reallocated >>> Thus, 1 reallocation and 1 copying of already read data >>> on each 8k piece >>> of additional bytes. >>> >>> In normal case, i.e. when fc.size() is correct, we have >>> overhead of 1 >>> allocation and copying 'size' bytes in size/8k iterations. >>> >>> And this is how current implementation does >>> - allocate 'size' bytes >>> - allocate 'size' bytes of native memory for temp buffer >>> in IOUtil.read() >>> - read the whole file into temp buffer >>> - copy the temp buffer back into our buffer >>> >>> In common when fc.size() is right, we have 1 allocation >>> and copying >>> 'size' bytes from temp buffer back. >>> >>> So there is a difference in allocations/copying, but in >>> my opinion it's >>> not that significant for this particular task. >>> >>> Sincerely yours, >>> Ivan >>> >>> On 22.07.2013 20:03, roger riggs wrote: >>> >>> Hi Ivan, >>> >>> I'm concerned about the change in behavior for the >>> existing working >>> cases. >>> >>> How many times are the bytes copied in your proposed >>> implementation? >>> How many arrays are allocated and discarded? >>> Files.copy() uses an extra array for the copies. >>> >>> BAOS should only be used for size == 0; that would >>> address the issue >>> without changing the current behavior or allocations. >>> >>> Roger >>> >>> >>> >>> >>> On 7/20/2013 6:15 PM, Ivan Gerasimov wrote: >>> >>> Roger, David thanks for suggestions! >>> >>> Would you please take a look at an updated webrev? >>> http://cr.openjdk.java.net/~igerasim/8020669/1/webrev/ >>> >>> >>> - File size is used as an initial size of BAOS's >>> buffer. >>> - BAOS avoids copying its buffer in >>> toByteArray(), if size is correct . >>> >>> I don't want to initialize BAOS with a positive >>> number if size >>> happened to be zero. >>> Because zero could indicate that the file is >>> really empty. >>> >>> Sincerely yours, >>> Ivan >>> >>> On 19.07.2013 22:30, David M. Lloyd wrote: >>> >>> My mistake, we're not talking about strings. >>> Still you can subclass >>> and determine whether the buffer size guess >>> was right, and if so >>> return the array as-is (swap in an empty >>> array or something as needed). >>> >>> On 07/19/2013 01:28 PM, David M. Lloyd wrote: >>> >>> It's trivial to subclass >>> ByteArrayOutputStream and add a method which >>> converts its contents to a string using >>> the two protected fields which >>> give you all the info you need to do so. >>> So no extra copy is needed >>> that you aren't already doing. >>> >>> On 07/19/2013 01:06 PM, roger riggs wrote: >>> >>> Hi Ivan, >>> >>> I think this change takes too big a >>> hit for the cases where the >>> size is >>> correct. >>> >>> No real file system can be wrong >>> about the size of a file so this >>> is a >>> problem >>> only for special file systems. If >>> the problem is with size >>> reporting zero >>> then maybe using the incremental >>> read only for size == would be a >>> better >>> fix. >>> >>> At least you could pass the size to >>> the constructor for BAOS and >>> avoid >>> the thrashing for every re-size; but >>> still it will allocate and >>> create >>> an extra copy >>> of the every time. >>> >>> $.02, Roger >>> >>> >>> On 7/19/2013 1:15 PM, Ivan Gerasimov >>> wrote: >>> >>> Hello everybody! >>> >>> Would you please review a fix >>> for the problem with >>> j.n.f.Files.readAllBytes() function? >>> The current implementation >>> relies on FileChannel.size() to >>> preallocate >>> a buffer for the whole file's >>> content. >>> However, some special >>> filesystems can report a wrong size. >>> An example is procfs under >>> Linux, which reports many files >>> under >>> /proc >>> to be zero sized. >>> >>> Thus it is proposed not to rely >>> on the size() and instead >>> continuously >>> read until EOF. >>> >>> The downside is reallocation and >>> copying file content between >>> buffers. >>> But taking into account that the >>> doc says: "It is not intended for >>> reading in large files." it >>> should not be a big problem. >>> >>> http://bugs.sun.com/view_bug.do?bug_id=8020669 >>> http://cr.openjdk.java.net/~igerasim/8020669/0/webrev/ >>> >>> >>> The fix is for JDK8. If it is >>> approved, it can be applied to >>> JDK7 as >>> well. >>> >>> Sincerely yours, >>> Ivan Gerasimov >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >> > From jonathan.gibbons at oracle.com Fri Jul 26 00:16:41 2013 From: jonathan.gibbons at oracle.com (Jonathan Gibbons) Date: Thu, 25 Jul 2013 17:16:41 -0700 Subject: Invalid "self-closing element not allowed" JavaDoc error In-Reply-To: References: <51F16363.7070405@redhat.com> <51F16AEC.70203@oracle.com> <51F175A3.4010302@oracle.com> <83836065-9553-4D00-B65D-314DAF502391@nicholaswilliams.net> <51F18E8F.2070001@oracle.com> Message-ID: <51F1BFE9.9050607@oracle.com> On 07/25/2013 02:01 PM, Nick Williams wrote: > Okay. To address some of your points (not in order): > > - I do not interpret "no end tags" as a strict prohibition on self-closing elements. I think many people agree with me. I think the fact that browsers barf at

                                                                    but not
                                                                    reinforces this interpretation. The (implicit) prohibition on self-closing elements is that they are not mentioned/allowed in the spec we are trying to follow, which is HTML 4.01, as defined in the DOCTYPE declarations in the generated files. > > - HTML5 does allow self-closing elements ... but ONLY for void elements (not empty elements that allow content). When we convert javadoc to be able to generate HTML 5, we would obviously update doclint accordingly. > > - So you say -Xdoclint for JavaDoc was meant to be the analog to -Xlint for JavaC, and I buy that ... except that it wasn't implemented that way. -Xlint produces /warnings/. -Xdoclint produces /errors/ and causes JavaDoc to fail. If -Xlint produces warnings and -Werror makes those warnings errors, then IMO -Xdoclint should also produce warnings and -Werror (or possibly something like -Wdocerror) should make those warnings errors. After all, the
                                                                    problem that the W3 validator points out is a WARNING, not an ERROR. -Xdoclint (intentionally) generates both warnings and errors. There have been some cases where seemingly minor issues have caused incorrect documentation to be generated, which is why we generate errors as well as warnings. > > - Somewhat off topic, every JavaDoc page produced by Java 8 right now has at least one W3 validator warning, because they're all missing a character encoding declaration (assumed to be UTF-8 for validation, but that's not portable). Yes, we know about that one. We just haven't gotten around to fixing it yet. The goal is that it should be possible to generate docs that are validator-clean. There are other big boo-boos, such as invalid characters in the anchors for method documentation, and duplicate names for overloaded methods. But we'll get there. If you find other cases of javadoc output failing a validator that you think is javadoc's fault, please let us know on javadoc-dev at openjdk.java.net. -- Jon > > Nick > > On Jul 25, 2013, at 3:46 PM, Jonathan Gibbons wrote: > >> First, as was pointed out earlier[1] in the original thread, the HTML 4 spec >> does not mention the existence of self-closing elements, and in that message, >> David makes a good point that
                                                                    is defined to not have an end tag, >> making the
                                                                    syntax doubly questionable. >> >> So what does "doclint" stand for? Read it as "doc lint" meaning it is to >> javadoc comments what -Xlint is to javac and lint is to C code. In other >> words, it is intended to be used to point out questionable (or erroneous) >> input. The ";" in "for (Item i: list);" is totally legal, the cast in "String s = >> (String) "abc"; are both legal, but we do not think it unreasonable to >> highlight them in code, along with all the other -X lint warnings. So >> too with -Xdoclint messages regarding javadoc comments. >> >> Yes, you can say that all the browsers (now) accept this syntax -- but >> the design intent of -Xdoclint was to highlight issues that might cause >> a validator to give comments. For far too long, the javadoc tool itself >> has generated bad code, and so the general goal in the ongoing javadoc >> TLC has been that given valid input, javadoc should generate valid output, >> where "valid" means "conforms to the published DOCTYPE" and accepted >> by a standard recognized validator, such as the one I cited at w3c.org. >> >> I would /strongly/ prefer that we not revert back to "is the output from javadoc >> accepted by all browsers?". >> >> Should -Xdoclint be opt-in or opt-out? For what its worth, this was >> always a controversial decision, because of the potential for discussions like >> this. We've ended up with a compromise. It is opt-in at javac time, which is >> when I'd expect most interested developers to want to use it -- as a developer, >> I want to see the doclint feedback at the time I'm writing my doc comments, >> when I'm in the compile-edit-test cycle. But it is not enabled by default for >> javac. But it is enabled by default in javadoc at doc-generation time. >> When you're generating docs, it is good for folk to know that the docs do >> not conform to the declared standard (i.e. HTML 4.01) If you're not interested >> in the feedback, you can disable it easily enough. If you are interested, >> a global replace of
                                                                    to
                                                                    should not be an onerous task in any >> modern IDE. >> >> Finally, another message [2] in the thread mentioned HTML 5. That is definitely >> on the upcoming radar. I would also like to see javadoc more forgiving in >> its input while still generating conformant output. Yes, that might mean fixing >> up minor transgressions. But not today. >> >> -- Jon >> >> >> [1] http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-July/019262.html >> [2] http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-July/019264.html >> >> On 07/25/2013 01:22 PM, Nick Williams wrote: >>> Jonathan, I don't see the "confirmation that this is not legal HTML" that you reference. I see a warning that some browsers may not interpret it correctly. But IE 5+ and all Firefox, Chrome, Netscape, Opera, etc. versions interpret it correctly. >>> >>> I understand your point about the spec not specifically allowing it. HOWEVER, I promise you there are TENS OF THOUSANDS of existing JavaDoc'd classes that will break JavaDoc generation as a result of this change. >>> >>> Maybe doclint (what does that stand for, by the way?) could be a default-off feature instead of a default-on feature? >>> >>> Nick >>> >>> On Jul 25, 2013, at 1:59 PM, Jonathan Gibbons wrote: >>> >>>> The message about "self-closing element not allowed" is because self-closing elements are not allowed in HTML 4. The message is generated by the new "doclint" feature available in javac and javadoc, which is specifically intended to detect issues in javadoc comments. If you do not wish to use the new doclint feature, you can disable it with -Xdoclint:none. >>>> >>>> >>>> As confirmation that this is not legal HTML, try typing a code fragment such as the following into the W3c validator at http://validator.w3.org/check >>>> >>>>> >>>>> >>>>> test >>>>> >>>>> >>>>>
                                                                    >>>>> >>>>> >>>> You will get the following warning: >>>> >>>>> 1. /Line 6 , Column 4/: >>>>> NET-enabling start-tag requires SHORTTAG YES >>>>> || >>>>> >>>>> For the current document, the validator interprets strings like >>>>> || according to legacy rules that break the expectations of >>>>> most authors and thus cause confusing warnings and error messages >>>>> from the validator. This interpretation is triggered by HTML 4 >>>>> documents or other SGML-based HTML documents. To avoid the >>>>> messages, simply remove the "/" character in such contexts. NB: If >>>>> you expect || to be interpreted as an XML-compatible >>>>> "self-closing" tag, then you need to use XHTML or HTML5. >>>>> >>>>> This warning and related errors may also be caused by an unquoted >>>>> attribute value containing one or more "/". Example: |>>>> href=http://w3c.org>W3C|. In such cases, the solution is to >>>>> put quotation marks around the value. >>>>> >>>> -- Jon >>>> >>>> >>>> >>>> On 07/25/2013 11:14 AM, Alan Bateman wrote: >>>>> Re: Invalid "self-closing element not allowed" JavaDoc error.eml >>>>> >>>>> Subject: >>>>> Re: Invalid "self-closing element not allowed" JavaDoc error >>>>> From: >>>>> "David M. Lloyd" >>>>> Date: >>>>> 07/25/2013 10:41 AM >>>>> >>>>> To: >>>>> core-libs-dev at openjdk.java.net >>>>> >>>>> >>>>> On 07/25/2013 12:27 PM, Nick Williams wrote: >>>>>> My apologies if this is not the right place to address this. If so, please forgive and direct me to the correct list. >>>>>> >>>>>> There are a lot of people/projects complaining about Java 8's new "self-closing element not allowed" error when compiling JavaDoc that has legal
                                                                    tags in it (just google "self-closing element not allowed" in quotes). Some (including myself) are asking, "Why should we fix this? The problem is not in the JavaDoc, it's in the JavDoc compiler." However, I haven't been able to find anyone who has actually broached the subject on any mailing lists. >>>>>> >>>>>>
                                                                    is completely legal. While it is not strictly required by the HTML standard (unless you're using XHTML), using self-closing tags is /preferred/ because it's more obvious what the intention is. Perhaps most importantly,
                                                                    is supported on 100% of browsers and is used throughout JavaDoc all over the place. I have a feeling that once more projects start compiling on a released Java 8, this is going to make a fair number of people angry that hey have to "fix" (read: needlessly change) potentially thousands of classes' worth of JavaDoc. >>>>>> >>>>>> What was the motivation behind the new "self-closing element not allowed" check and how can we make it go away? >>>>> Not really having a stake in this, I just want to observe a couple things. First, from what I can see, the HTML 4.x specifications make no reference to self-closing elements or their syntactical realization. As far as I can tell (not being any kind of SGML expert), self-closing elements are not valid or meaningful HTML according to its SGML definition. >>>>> >>>>> Finally, even if they were allowed, the BR tag is explicitly defined to forbid an end tag; self-closing elements imply an end tag (at least they do in XML, which appears to be the next-nearest concrete specification that has anything to say on the matter). >>>>> >>>>> See http://www.w3.org/TR/html401/struct/text.html#edef-BR for more info. >>>>> >>>>> So I'm curious when you say "using self-closing tags is /preferred/", do you have any sources to cite? >>>>> -- >>>>> - DML >>>>> >>>>> Re: Invalid "self-closing element not allowed" JavaDoc error.eml >>>>> >>>>> Subject: >>>>> Re: Invalid "self-closing element not allowed" JavaDoc error >>>>> From: >>>>> Stephen Colebourne >>>>> Date: >>>>> 07/25/2013 10:59 AM >>>>> >>>>> To: >>>>> core-libs-dev at openjdk.java.net >>>>> >>>>> >>>>> Its complicated, see for example: >>>>> http://stackoverflow.com/questions/3558119/are-self-closing-tags-valid-in-html5 >>>>> >>>>> The key point here is not whether its in the standard or not, but what >>>>> people actually*do*. >>>>> >>>>> There is no doubt in my mind that
                                                                    br space slash is very common >>>>> indeed. Its certainly my default. The javadoc validator should be as >>>>> lenient as browsers are in this case. >>>>> >>>>> Stephen >>>>> >>>>> >>>>> On 25 July 2013 18:41, David M. Lloyd wrote: >>>>>>> On 07/25/2013 12:27 PM, Nick Williams wrote: >>>>>>>>> My apologies if this is not the right place to address this. If so, please >>>>>>>>> forgive and direct me to the correct list. >>>>>>>>> >>>>>>>>> There are a lot of people/projects complaining about Java 8's new >>>>>>>>> "self-closing element not allowed" error when compiling JavaDoc that has >>>>>>>>> legal
                                                                    tags in it (just google "self-closing element not allowed" in >>>>>>>>> quotes). Some (including myself) are asking, "Why should we fix this? The >>>>>>>>> problem is not in the JavaDoc, it's in the JavDoc compiler." However, I >>>>>>>>> haven't been able to find anyone who has actually broached the subject on >>>>>>>>> any mailing lists. >>>>>>>>> >>>>>>>>>
                                                                    is completely legal. While it is not strictly required by the HTML >>>>>>>>> standard (unless you're using XHTML), using self-closing tags is/preferred/ >>>>>>>>> because it's more obvious what the intention is. Perhaps most importantly, >>>>>>>>>
                                                                    is supported on 100% of browsers and is used throughout JavaDoc all >>>>>>>>> over the place. I have a feeling that once more projects start compiling on >>>>>>>>> a released Java 8, this is going to make a fair number of people angry that >>>>>>>>> hey have to "fix" (read: needlessly change) potentially thousands of >>>>>>>>> classes' worth of JavaDoc. >>>>>>>>> >>>>>>>>> What was the motivation behind the new "self-closing element not allowed" >>>>>>>>> check and how can we make it go away? >>>>>>> Not really having a stake in this, I just want to observe a couple things. >>>>>>> First, from what I can see, the HTML 4.x specifications make no reference to >>>>>>> self-closing elements or their syntactical realization. As far as I can >>>>>>> tell (not being any kind of SGML expert), self-closing elements are not >>>>>>> valid or meaningful HTML according to its SGML definition. >>>>>>> >>>>>>> Finally, even if they were allowed, the BR tag is explicitly defined to >>>>>>> forbid an end tag; self-closing elements imply an end tag (at least they do >>>>>>> in XML, which appears to be the next-nearest concrete specification that has >>>>>>> anything to say on the matter). >>>>>>> >>>>>>> Seehttp://www.w3.org/TR/html401/struct/text.html#edef-BR for more info. >>>>>>> >>>>>>> So I'm curious when you say "using self-closing tags is/preferred/", do you >>>>>>> have any sources to cite? >>>>>>> -- >>>>>>> - DML From nicholas+openjdk at nicholaswilliams.net Fri Jul 26 00:21:52 2013 From: nicholas+openjdk at nicholaswilliams.net (Nick Williams) Date: Thu, 25 Jul 2013 19:21:52 -0500 Subject: Invalid "self-closing element not allowed" JavaDoc error In-Reply-To: <51F1BFE9.9050607@oracle.com> References: <51F16363.7070405@redhat.com> <51F16AEC.70203@oracle.com> <51F175A3.4010302@oracle.com> <83836065-9553-4D00-B65D-314DAF502391@nicholaswilliams.net> <51F18E8F.2070001@oracle.com> <51F1BFE9.9050607@oracle.com> Message-ID: On Jul 25, 2013, at 7:16 PM, Jonathan Gibbons wrote: > On 07/25/2013 02:01 PM, Nick Williams wrote: >> Okay. To address some of your points (not in order): >> >> - I do not interpret "no end tags" as a strict prohibition on self-closing elements. I think many people agree with me. I think the fact that browsers barf at

                                                                    but not
                                                                    reinforces this interpretation. > > The (implicit) prohibition on self-closing elements is that they are not mentioned/allowed in the spec we are trying to follow, which is HTML 4.01, as defined in the DOCTYPE declarations in the generated files. > >> >> - HTML5 does allow self-closing elements ... but ONLY for void elements (not empty elements that allow content). > > When we convert javadoc to be able to generate HTML 5, we would obviously update doclint accordingly. > >> >> - So you say -Xdoclint for JavaDoc was meant to be the analog to -Xlint for JavaC, and I buy that ... except that it wasn't implemented that way. -Xlint produces /warnings/. -Xdoclint produces /errors/ and causes JavaDoc to fail. If -Xlint produces warnings and -Werror makes those warnings errors, then IMO -Xdoclint should also produce warnings and -Werror (or possibly something like -Wdocerror) should make those warnings errors. After all, the
                                                                    problem that the W3 validator points out is a WARNING, not an ERROR. > > -Xdoclint (intentionally) generates both warnings and errors. There have been some cases where seemingly minor issues have caused incorrect documentation to be generated, which is why we generate errors as well as warnings. So why is "self-closing element not allowed" considered an error when it's only a warning when validated with a W3 validator? Seems to me like a reasonable compromise to make this a warning instead of an error. Thoughts? > > >> >> - Somewhat off topic, every JavaDoc page produced by Java 8 right now has at least one W3 validator warning, because they're all missing a character encoding declaration (assumed to be UTF-8 for validation, but that's not portable). > > Yes, we know about that one. We just haven't gotten around to fixing it yet. The goal is that it should be possible to generate docs that are validator-clean. There are other big boo-boos, such as invalid characters in the anchors for method documentation, and duplicate names for overloaded methods. But we'll get there. If you find other cases of javadoc output failing a validator that you think is javadoc's fault, please let us know on javadoc-dev at openjdk.java.net. > > -- Jon > > >> >> Nick >> >> On Jul 25, 2013, at 3:46 PM, Jonathan Gibbons wrote: >> >>> First, as was pointed out earlier[1] in the original thread, the HTML 4 spec >>> does not mention the existence of self-closing elements, and in that message, >>> David makes a good point that
                                                                    is defined to not have an end tag, >>> making the
                                                                    syntax doubly questionable. >>> >>> So what does "doclint" stand for? Read it as "doc lint" meaning it is to >>> javadoc comments what -Xlint is to javac and lint is to C code. In other >>> words, it is intended to be used to point out questionable (or erroneous) >>> input. The ";" in "for (Item i: list);" is totally legal, the cast in "String s = >>> (String) "abc"; are both legal, but we do not think it unreasonable to >>> highlight them in code, along with all the other -X lint warnings. So >>> too with -Xdoclint messages regarding javadoc comments. >>> >>> Yes, you can say that all the browsers (now) accept this syntax -- but >>> the design intent of -Xdoclint was to highlight issues that might cause >>> a validator to give comments. For far too long, the javadoc tool itself >>> has generated bad code, and so the general goal in the ongoing javadoc >>> TLC has been that given valid input, javadoc should generate valid output, >>> where "valid" means "conforms to the published DOCTYPE" and accepted >>> by a standard recognized validator, such as the one I cited at w3c.org. >>> >>> I would /strongly/ prefer that we not revert back to "is the output from javadoc >>> accepted by all browsers?". >>> >>> Should -Xdoclint be opt-in or opt-out? For what its worth, this was >>> always a controversial decision, because of the potential for discussions like >>> this. We've ended up with a compromise. It is opt-in at javac time, which is >>> when I'd expect most interested developers to want to use it -- as a developer, >>> I want to see the doclint feedback at the time I'm writing my doc comments, >>> when I'm in the compile-edit-test cycle. But it is not enabled by default for >>> javac. But it is enabled by default in javadoc at doc-generation time. >>> When you're generating docs, it is good for folk to know that the docs do >>> not conform to the declared standard (i.e. HTML 4.01) If you're not interested >>> in the feedback, you can disable it easily enough. If you are interested, >>> a global replace of
                                                                    to
                                                                    should not be an onerous task in any >>> modern IDE. >>> >>> Finally, another message [2] in the thread mentioned HTML 5. That is definitely >>> on the upcoming radar. I would also like to see javadoc more forgiving in >>> its input while still generating conformant output. Yes, that might mean fixing >>> up minor transgressions. But not today. >>> >>> -- Jon >>> >>> >>> [1] http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-July/019262.html >>> [2] http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-July/019264.html >>> >>> On 07/25/2013 01:22 PM, Nick Williams wrote: >>>> Jonathan, I don't see the "confirmation that this is not legal HTML" that you reference. I see a warning that some browsers may not interpret it correctly. But IE 5+ and all Firefox, Chrome, Netscape, Opera, etc. versions interpret it correctly. >>>> >>>> I understand your point about the spec not specifically allowing it. HOWEVER, I promise you there are TENS OF THOUSANDS of existing JavaDoc'd classes that will break JavaDoc generation as a result of this change. >>>> >>>> Maybe doclint (what does that stand for, by the way?) could be a default-off feature instead of a default-on feature? >>>> >>>> Nick >>>> >>>> On Jul 25, 2013, at 1:59 PM, Jonathan Gibbons wrote: >>>> >>>>> The message about "self-closing element not allowed" is because self-closing elements are not allowed in HTML 4. The message is generated by the new "doclint" feature available in javac and javadoc, which is specifically intended to detect issues in javadoc comments. If you do not wish to use the new doclint feature, you can disable it with -Xdoclint:none. >>>>> >>>>> >>>>> As confirmation that this is not legal HTML, try typing a code fragment such as the following into the W3c validator at http://validator.w3.org/check >>>>> >>>>>> >>>>>> >>>>>> test >>>>>> >>>>>> >>>>>>
                                                                    >>>>>> >>>>>> >>>>> You will get the following warning: >>>>> >>>>>> 1. /Line 6 , Column 4/: >>>>>> NET-enabling start-tag requires SHORTTAG YES >>>>>> || >>>>>> >>>>>> For the current document, the validator interprets strings like >>>>>> || according to legacy rules that break the expectations of >>>>>> most authors and thus cause confusing warnings and error messages >>>>>> from the validator. This interpretation is triggered by HTML 4 >>>>>> documents or other SGML-based HTML documents. To avoid the >>>>>> messages, simply remove the "/" character in such contexts. NB: If >>>>>> you expect || to be interpreted as an XML-compatible >>>>>> "self-closing" tag, then you need to use XHTML or HTML5. >>>>>> >>>>>> This warning and related errors may also be caused by an unquoted >>>>>> attribute value containing one or more "/". Example: |>>>>> href=http://w3c.org>W3C|. In such cases, the solution is to >>>>>> put quotation marks around the value. >>>>>> >>>>> -- Jon >>>>> >>>>> >>>>> >>>>> On 07/25/2013 11:14 AM, Alan Bateman wrote: >>>>>> Re: Invalid "self-closing element not allowed" JavaDoc error.eml >>>>>> >>>>>> Subject: >>>>>> Re: Invalid "self-closing element not allowed" JavaDoc error >>>>>> From: >>>>>> "David M. Lloyd" >>>>>> Date: >>>>>> 07/25/2013 10:41 AM >>>>>> >>>>>> To: >>>>>> core-libs-dev at openjdk.java.net >>>>>> >>>>>> >>>>>> On 07/25/2013 12:27 PM, Nick Williams wrote: >>>>>>> My apologies if this is not the right place to address this. If so, please forgive and direct me to the correct list. >>>>>>> >>>>>>> There are a lot of people/projects complaining about Java 8's new "self-closing element not allowed" error when compiling JavaDoc that has legal
                                                                    tags in it (just google "self-closing element not allowed" in quotes). Some (including myself) are asking, "Why should we fix this? The problem is not in the JavaDoc, it's in the JavDoc compiler." However, I haven't been able to find anyone who has actually broached the subject on any mailing lists. >>>>>>> >>>>>>>
                                                                    is completely legal. While it is not strictly required by the HTML standard (unless you're using XHTML), using self-closing tags is /preferred/ because it's more obvious what the intention is. Perhaps most importantly,
                                                                    is supported on 100% of browsers and is used throughout JavaDoc all over the place. I have a feeling that once more projects start compiling on a released Java 8, this is going to make a fair number of people angry that hey have to "fix" (read: needlessly change) potentially thousands of classes' worth of JavaDoc. >>>>>>> >>>>>>> What was the motivation behind the new "self-closing element not allowed" check and how can we make it go away? >>>>>> Not really having a stake in this, I just want to observe a couple things. First, from what I can see, the HTML 4.x specifications make no reference to self-closing elements or their syntactical realization. As far as I can tell (not being any kind of SGML expert), self-closing elements are not valid or meaningful HTML according to its SGML definition. >>>>>> >>>>>> Finally, even if they were allowed, the BR tag is explicitly defined to forbid an end tag; self-closing elements imply an end tag (at least they do in XML, which appears to be the next-nearest concrete specification that has anything to say on the matter). >>>>>> >>>>>> See http://www.w3.org/TR/html401/struct/text.html#edef-BR for more info. >>>>>> >>>>>> So I'm curious when you say "using self-closing tags is /preferred/", do you have any sources to cite? >>>>>> -- >>>>>> - DML >>>>>> >>>>>> Re: Invalid "self-closing element not allowed" JavaDoc error.eml >>>>>> >>>>>> Subject: >>>>>> Re: Invalid "self-closing element not allowed" JavaDoc error >>>>>> From: >>>>>> Stephen Colebourne >>>>>> Date: >>>>>> 07/25/2013 10:59 AM >>>>>> >>>>>> To: >>>>>> core-libs-dev at openjdk.java.net >>>>>> >>>>>> >>>>>> Its complicated, see for example: >>>>>> http://stackoverflow.com/questions/3558119/are-self-closing-tags-valid-in-html5 >>>>>> >>>>>> The key point here is not whether its in the standard or not, but what >>>>>> people actually*do*. >>>>>> >>>>>> There is no doubt in my mind that
                                                                    br space slash is very common >>>>>> indeed. Its certainly my default. The javadoc validator should be as >>>>>> lenient as browsers are in this case. >>>>>> >>>>>> Stephen >>>>>> >>>>>> >>>>>> On 25 July 2013 18:41, David M. Lloyd wrote: >>>>>>>> On 07/25/2013 12:27 PM, Nick Williams wrote: >>>>>>>>>> My apologies if this is not the right place to address this. If so, please >>>>>>>>>> forgive and direct me to the correct list. >>>>>>>>>> >>>>>>>>>> There are a lot of people/projects complaining about Java 8's new >>>>>>>>>> "self-closing element not allowed" error when compiling JavaDoc that has >>>>>>>>>> legal
                                                                    tags in it (just google "self-closing element not allowed" in >>>>>>>>>> quotes). Some (including myself) are asking, "Why should we fix this? The >>>>>>>>>> problem is not in the JavaDoc, it's in the JavDoc compiler." However, I >>>>>>>>>> haven't been able to find anyone who has actually broached the subject on >>>>>>>>>> any mailing lists. >>>>>>>>>> >>>>>>>>>>
                                                                    is completely legal. While it is not strictly required by the HTML >>>>>>>>>> standard (unless you're using XHTML), using self-closing tags is/preferred/ >>>>>>>>>> because it's more obvious what the intention is. Perhaps most importantly, >>>>>>>>>>
                                                                    is supported on 100% of browsers and is used throughout JavaDoc all >>>>>>>>>> over the place. I have a feeling that once more projects start compiling on >>>>>>>>>> a released Java 8, this is going to make a fair number of people angry that >>>>>>>>>> hey have to "fix" (read: needlessly change) potentially thousands of >>>>>>>>>> classes' worth of JavaDoc. >>>>>>>>>> >>>>>>>>>> What was the motivation behind the new "self-closing element not allowed" >>>>>>>>>> check and how can we make it go away? >>>>>>>> Not really having a stake in this, I just want to observe a couple things. >>>>>>>> First, from what I can see, the HTML 4.x specifications make no reference to >>>>>>>> self-closing elements or their syntactical realization. As far as I can >>>>>>>> tell (not being any kind of SGML expert), self-closing elements are not >>>>>>>> valid or meaningful HTML according to its SGML definition. >>>>>>>> >>>>>>>> Finally, even if they were allowed, the BR tag is explicitly defined to >>>>>>>> forbid an end tag; self-closing elements imply an end tag (at least they do >>>>>>>> in XML, which appears to be the next-nearest concrete specification that has >>>>>>>> anything to say on the matter). >>>>>>>> >>>>>>>> Seehttp://www.w3.org/TR/html401/struct/text.html#edef-BR for more info. >>>>>>>> >>>>>>>> So I'm curious when you say "using self-closing tags is/preferred/", do you >>>>>>>> have any sources to cite? >>>>>>>> -- >>>>>>>> - DML > From sean.mullan at oracle.com Fri Jul 26 01:04:39 2013 From: sean.mullan at oracle.com (sean.mullan at oracle.com) Date: Fri, 26 Jul 2013 01:04:39 +0000 Subject: hg: jdk8/tl/jdk: 2 new changesets Message-ID: <20130726010515.80F4D483B6@hg.openjdk.java.net> Changeset: 1744a32d3db3 Author: mullan Date: 2013-07-25 20:12 -0400 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/1744a32d3db3 8012288: XML DSig API allows wrong tag names and extra elements in SignedInfo Reviewed-by: xuelei ! src/share/classes/org/jcp/xml/dsig/internal/dom/DOMKeyValue.java ! src/share/classes/org/jcp/xml/dsig/internal/dom/DOMManifest.java ! src/share/classes/org/jcp/xml/dsig/internal/dom/DOMReference.java ! src/share/classes/org/jcp/xml/dsig/internal/dom/DOMRetrievalMethod.java ! src/share/classes/org/jcp/xml/dsig/internal/dom/DOMSignatureProperties.java ! src/share/classes/org/jcp/xml/dsig/internal/dom/DOMSignedInfo.java ! src/share/classes/org/jcp/xml/dsig/internal/dom/DOMUtils.java ! src/share/classes/org/jcp/xml/dsig/internal/dom/DOMX509IssuerSerial.java ! src/share/classes/org/jcp/xml/dsig/internal/dom/DOMXMLSignature.java Changeset: 4100ab44ba4f Author: mullan Date: 2013-07-25 20:30 -0400 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/4100ab44ba4f Merge From jonathan.gibbons at oracle.com Fri Jul 26 01:20:48 2013 From: jonathan.gibbons at oracle.com (Jonathan Gibbons) Date: Thu, 25 Jul 2013 18:20:48 -0700 Subject: Invalid "self-closing element not allowed" JavaDoc error In-Reply-To: References: <51F16363.7070405@redhat.com> <51F16AEC.70203@oracle.com> <51F175A3.4010302@oracle.com> <83836065-9553-4D00-B65D-314DAF502391@nicholaswilliams.net> <51F18E8F.2070001@oracle.com> <51F1BFE9.9050607@oracle.com> Message-ID: <51F1CEF0.3080407@oracle.com> On 07/25/2013 05:21 PM, Nick Williams wrote: > So why is "self-closing element not allowed" considered an error when it's only a warning when validated with a W3 validator? Seems to me like a reasonable compromise to make this a warning instead of an error. Thoughts? Right now, the guideline is more along the lines of using warnings for items that do not cause any issue for a validator, but which are still questionable (such as missing javadoc comments, unnecessarily nested tags, empty tags, etc) and errors for any issues flagged by a validator. Remember, you always have the option of disabling doclint. -- Jon From joe.darcy at oracle.com Fri Jul 26 03:03:44 2013 From: joe.darcy at oracle.com (joe.darcy at oracle.com) Date: Fri, 26 Jul 2013 03:03:44 +0000 Subject: hg: jdk8/tl/jdk: 8021429: Fix lint warnings in java.lang.ref Message-ID: <20130726030410.E8ADB483BC@hg.openjdk.java.net> Changeset: 86a827321c39 Author: darcy Date: 2013-07-25 20:03 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/86a827321c39 8021429: Fix lint warnings in java.lang.ref Reviewed-by: lancea, mduigou, alanb ! src/share/classes/java/lang/ref/FinalReference.java ! src/share/classes/java/lang/ref/Finalizer.java ! src/share/classes/java/lang/ref/Reference.java ! src/share/classes/java/lang/ref/ReferenceQueue.java From joe.darcy at oracle.com Fri Jul 26 03:11:16 2013 From: joe.darcy at oracle.com (Joseph Darcy) Date: Thu, 25 Jul 2013 20:11:16 -0700 Subject: RFR JDK 8 javac lint cleanup of java.lang.ref In-Reply-To: <51F195B8.7010206@oracle.com> References: <51F18B81.4050400@oracle.com> <51F1916D.4080101@oracle.com> <51F195B8.7010206@oracle.com> Message-ID: <51F1E8D4.8030202@oracle.com> An update, I played around with the declarations a bit more, but wasn't about to find something workable so I pushed the already-reviewed version. If someone else wants to take a crack at improving the generics, I think that would be a fine refactoring. Thanks, -Joe On 7/25/2013 2:16 PM, Joe Darcy wrote: > On 07/25/2013 01:58 PM, Alan Bateman wrote: >> On 25/07/2013 13:33, Joe Darcy wrote: >>> Hello, >>> >>> Please review these changes to remove the javac lint warnings from >>> the java.lang.ref package: >>> >>> 8021429 Fix lint warnings in java.lang.ref >>> http://cr.openjdk.java.net/~darcy/8021429.0/ >>> >>> Care was taken to not change any signatures of public API elements. >>> After doing a clean build, all the java.lang.ref regression tests >>> pass. Full patch below. >>> >>> Thanks, >>> >>> -Joe >> This looks okay to me, just wondering Reference.next needs to be a >> raw type (you may have tried possible solutions to this already). > > After some amount of examination, I didn't find a way to fix this. The > description of the protocol around that field is > > /* When active: NULL > * pending: this > * Enqueued: next reference in queue (or this if last) > * Inactive: this > */ > > None of > > Reference > Reference > Reference > Reference > > work as the declared type of the field given other uses of the field > in the package. > >> >> Minor comment on Finalizer is that the comment on the class being >> package-private is now misaligned. >> >> > > I'll fix that before I push. > > Thanks all for the quick reviews. > > -Joe > From Alan.Bateman at oracle.com Fri Jul 26 04:54:09 2013 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Thu, 25 Jul 2013 21:54:09 -0700 Subject: RFR [8020669] java.nio.file.Files.readAllBytes() does not read any data when Files.size() is 0 In-Reply-To: <51F1BB22.6040405@oracle.com> References: <51E97416.20506@oracle.com> <51E98043.6030102@oracle.com> <51E9853E.8020409@redhat.com> <51E985AD.60401@redhat.com> <51EB0BFF.3030106@oracle.com> <51ED57D8.90001@oracle.com> <51EE55AC.5000902@oracle.com> <51EE8E9A.6040806@redhat.com> <51EF1B43.9030200@oracle.com> <51F06789.1050403@oracle.com> <51F12B3E.4010603@oracle.com> <51F1BB22.6040405@oracle.com> Message-ID: <51F200F1.8010500@oracle.com> On 25/07/2013 16:56, Ivan Gerasimov wrote: > > Would you please help review an updated webrev? > http://cr.openjdk.java.net/~igerasim/8020669/4/webrev/ Sorry for the late response to your mails on this, I was on vacation. As you have found, in the original implementation we allowed for resizing (truncation or extending) while the file was open but when it was optimized to avoid an unnecessary resize of the array then we lost the ability to deal with extending case (which is the essentially the same as when the size is reported is less than the actual size). Reverting to the original implementation and doing a single read to double check for EOF seems reasonable. My only real comment on the latest webrev (4) is that the computation of the new capacity is not obvious to the reader (and since this is the uncommon case then it doesn't need to be super-optimized). So I think it would be a lot clearer if "newCapacity" were re-introduced and then computed to a value that is a minimum of capacity+2, maximum of capacity+BUFFER_SIZE (with OOME handling when newCapacity is greater than MAX_BUFFER_SIZE). I think that would be clearer than re-using the remaining count (rem). A minor comment is that the input stream is named "fis" but probably should be "in" as it is not a FileInputStream (I see David Llyod suggested using a FileInputStream but the path may be to a file in a custom file system so it can't be a FileInputStream). I see you've changed the javadoc from "Read" to "Reads" on several methods. I don't know if you meant to include this in the webrev but personally prefer "Read". Thanks for moving the test to BytesAndLines as that is the test for these methods. One suggestion is to move the new test for readAllBytes into testReadAndWriteBytes and the new test for readAllLines into testReadLines. It doesn't matter of course, it just keeps them together. -Alan. From jaroslav.bachorik at oracle.com Fri Jul 26 08:37:20 2013 From: jaroslav.bachorik at oracle.com (jaroslav.bachorik at oracle.com) Date: Fri, 26 Jul 2013 08:37:20 +0000 Subject: hg: jdk8/tl/jdk: 8020875: java/lang/management/ThreadMXBean/ResetPeakThreadCount.java fails intermittently Message-ID: <20130726083758.10299483C9@hg.openjdk.java.net> Changeset: 952476b80fa7 Author: jbachorik Date: 2013-07-26 10:12 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/952476b80fa7 8020875: java/lang/management/ThreadMXBean/ResetPeakThreadCount.java fails intermittently Reviewed-by: dfuchs, chegar ! test/java/lang/management/ThreadMXBean/ResetPeakThreadCount.java From yuka.kamiya at oracle.com Fri Jul 26 08:23:33 2013 From: yuka.kamiya at oracle.com (yuka.kamiya at oracle.com) Date: Fri, 26 Jul 2013 08:23:33 +0000 Subject: hg: jdk8/tl/jdk: 8021108: Clean up doclint warnings and errors in java.text package Message-ID: <20130726082414.DB45D483C7@hg.openjdk.java.net> Changeset: 6cc15a808b93 Author: peytoia Date: 2013-07-26 17:22 +0900 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/6cc15a808b93 8021108: Clean up doclint warnings and errors in java.text package Reviewed-by: darcy, okutsu ! src/share/classes/java/text/Annotation.java ! src/share/classes/java/text/AttributedCharacterIterator.java ! src/share/classes/java/text/Bidi.java ! src/share/classes/java/text/BreakIterator.java ! src/share/classes/java/text/ChoiceFormat.java ! src/share/classes/java/text/CollationElementIterator.java ! src/share/classes/java/text/CollationKey.java ! src/share/classes/java/text/DateFormat.java ! src/share/classes/java/text/DateFormatSymbols.java ! src/share/classes/java/text/DecimalFormat.java ! src/share/classes/java/text/DecimalFormatSymbols.java ! src/share/classes/java/text/FieldPosition.java ! src/share/classes/java/text/Format.java ! src/share/classes/java/text/MessageFormat.java ! src/share/classes/java/text/Normalizer.java ! src/share/classes/java/text/NumberFormat.java ! src/share/classes/java/text/ParseException.java ! src/share/classes/java/text/ParsePosition.java ! src/share/classes/java/text/RuleBasedCollator.java ! src/share/classes/java/text/SimpleDateFormat.java ! src/share/classes/java/text/StringCharacterIterator.java From scolebourne at joda.org Fri Jul 26 09:39:04 2013 From: scolebourne at joda.org (Stephen Colebourne) Date: Fri, 26 Jul 2013 10:39:04 +0100 Subject: Invalid "self-closing element not allowed" JavaDoc error In-Reply-To: <51F18E8F.2070001@oracle.com> References: <51F16363.7070405@redhat.com> <51F16AEC.70203@oracle.com> <51F175A3.4010302@oracle.com> <83836065-9553-4D00-B65D-314DAF502391@nicholaswilliams.net> <51F18E8F.2070001@oracle.com> Message-ID: On 25 July 2013 21:46, Jonathan Gibbons wrote: > First, as was pointed out earlier[1] in the original thread, the HTML 4 spec > does not mention the existence of self-closing elements, and in that > message, > David makes a good point that
                                                                    is defined to not have an end tag, > making the
                                                                    syntax doubly questionable. > > So what does "doclint" stand for? Read it as "doc lint" meaning it is to > javadoc comments what -Xlint is to javac and lint is to C code. In other > words, it is intended to be used to point out questionable (or erroneous) > input. The ";" in "for (Item i: list);" is totally legal, the cast in > "String s = > (String) "abc"; are both legal, but we do not think it unreasonable to > highlight them in code, along with all the other -X lint warnings. So > too with -Xdoclint messages regarding javadoc comments. > > Yes, you can say that all the browsers (now) accept this syntax -- but > the design intent of -Xdoclint was to highlight issues that might cause > a validator to give comments. For far too long, the javadoc tool itself > has generated bad code, and so the general goal in the ongoing javadoc > TLC has been that given valid input, javadoc should generate valid output, > where "valid" means "conforms to the published DOCTYPE" and accepted > by a standard recognized validator, such as the one I cited at w3c.org. > > I would /strongly/ prefer that we not revert back to "is the output from > javadoc > accepted by all browsers?". At a high level I've known about this doclint project, and thought it seemed like a good idea, so I didn't investigate it much. Only now as the implications become clearer do I start to care. I'm afraid that it looks like the goal of the project has become to "enforce the perfect" rather than "remove the imperfect". There is a huge difference between the two, It is widely accepted, including by Tim Berners Lee, that XHTML failed: http://dig.csail.mit.edu/breadcrumbs/node/166 http://lemire.me/blog/archives/2006/10/30/reinventing-html-or-yes-we-admit-it-xhtml-failed/ The key point is that humans both hated and were bad at writing/maintaining strict HTML. HTML is all about quick hacks. And the entire HTML world is built on lenient input parsing. Strict input parsing just isn't what HTML is about, hence the failure of XHTML and validation exercises in general. Postels Law applies here. Now, as programmers, we are used to having to get our syntax right so that it passes the compiler. Its easy to make the analogy with HTML and assume a need and desire for the same there. But that misses the HTML culture, which is lenient, not strict. The doclint tool should be focussed on the imperfect. Missing @param/@return/@throws tags, Misues of end of sentence markers. HTML structure that is known to fail on browsers would be fair game. The general well-formedness of HTML is entirely different game - thats the search for perfection. In summary, developers should be able to put HTML in Javadoc that they would use when building a typical HTML website. Its websites and browsers that define what should be accepted as HTML, not standards. Stephen From david.lloyd at redhat.com Fri Jul 26 12:58:34 2013 From: david.lloyd at redhat.com (David M. Lloyd) Date: Fri, 26 Jul 2013 07:58:34 -0500 Subject: Invalid "self-closing element not allowed" JavaDoc error In-Reply-To: References: <51F16363.7070405@redhat.com> <51F16AEC.70203@oracle.com> <51F175A3.4010302@oracle.com> <83836065-9553-4D00-B65D-314DAF502391@nicholaswilliams.net> <51F18E8F.2070001@oracle.com> Message-ID: <51F2727A.2070003@redhat.com> On 07/26/2013 04:39 AM, Stephen Colebourne wrote: > Its websites and > browsers that define what should be accepted as HTML, not standards. This is the craziest thing I've read all week. -- - DML From martinrb at google.com Fri Jul 26 13:10:14 2013 From: martinrb at google.com (Martin Buchholz) Date: Fri, 26 Jul 2013 06:10:14 -0700 Subject: RFR [8020669] java.nio.file.Files.readAllBytes() does not read any data when Files.size() is 0 In-Reply-To: <51F200F1.8010500@oracle.com> References: <51E97416.20506@oracle.com> <51E98043.6030102@oracle.com> <51E9853E.8020409@redhat.com> <51E985AD.60401@redhat.com> <51EB0BFF.3030106@oracle.com> <51ED57D8.90001@oracle.com> <51EE55AC.5000902@oracle.com> <51EE8E9A.6040806@redhat.com> <51EF1B43.9030200@oracle.com> <51F06789.1050403@oracle.com> <51F12B3E.4010603@oracle.com> <51F1BB22.6040405@oracle.com> <51F200F1.8010500@oracle.com> Message-ID: On Thu, Jul 25, 2013 at 9:54 PM, Alan Bateman wrote: > > I see you've changed the javadoc from "Read" to "Reads" on several > methods. I don't know if you meant to include this in the webrev but > personally prefer "Read". > I'm surprised to see you say that, since the "Reads" form has been standard practice for public javadoc for a long time, and private javadoc, while much more informal than public, may as well not be gratuitously different from public. From scolebourne at joda.org Fri Jul 26 13:23:15 2013 From: scolebourne at joda.org (Stephen Colebourne) Date: Fri, 26 Jul 2013 14:23:15 +0100 Subject: Invalid "self-closing element not allowed" JavaDoc error In-Reply-To: <51F2727A.2070003@redhat.com> References: <51F16363.7070405@redhat.com> <51F16AEC.70203@oracle.com> <51F175A3.4010302@oracle.com> <83836065-9553-4D00-B65D-314DAF502391@nicholaswilliams.net> <51F18E8F.2070001@oracle.com> <51F2727A.2070003@redhat.com> Message-ID: On 26 July 2013 13:58, David M. Lloyd wrote: > On 07/26/2013 04:39 AM, Stephen Colebourne wrote: >> >> Its websites and >> browsers that define what should be accepted as HTML, not standards. > > This is the craziest thing I've read all week. What percentage of the worlds websites contain valid HTML/XHTML according to the DOCTYPE/validator? I'd be amazed if its more than 1%. The Oracle home page, java.net, java.com and J2SE download page all fail validation. Yet all are perfactly usable websites. RedHat: http://validator.w3.org/check?uri=http%3A%2F%2Fredhat.com&charset=%28detect+automatically%29&doctype=Inline&group=0&user-agent=W3C_Validator%2F1.3+http%3A%2F%2Fvalidator.w3.org%2Fservices JBoss: http://validator.w3.org/check?uri=https%3A%2F%2Fwww.jboss.org%2Foverview%2F&charset=%28detect+automatically%29&doctype=Inline&group=0&user-agent=W3C_Validator%2F1.3+http%3A%2F%2Fvalidator.w3.org%2Fservices Tim Berners Lee said in the linked article: "Some things are clearer with hindsight of several years. It is necessary to evolve HTML incrementally. The attempt to get the world to switch to XML, including quotes around attribute values and slashes in empty tags and namespaces all at once didn't work". This isn't Java EE. HTML is a space where standards are a *guide*. I absolutely stand by my statement. Stephen From roger.riggs at oracle.com Fri Jul 26 13:44:34 2013 From: roger.riggs at oracle.com (roger riggs) Date: Fri, 26 Jul 2013 09:44:34 -0400 Subject: Invalid "self-closing element not allowed" JavaDoc error In-Reply-To: References: <51F16363.7070405@redhat.com> <51F16AEC.70203@oracle.com> <51F175A3.4010302@oracle.com> <83836065-9553-4D00-B65D-314DAF502391@nicholaswilliams.net> <51F18E8F.2070001@oracle.com> <51F2727A.2070003@redhat.com> Message-ID: <51F27D42.3060003@oracle.com> The html subset that appears in javadoc comments does not exist in isolation or in a full browser context. It is deliberately limited and structured to work within a documentation framework defined by javadoc and supported by the javadoc stylesheet using HTML 4.01. Html provided by the developer conforming to javadoc conventions can be assured of a robust and consistent presentation. Other tools besides browsers consume the generated html and those tools should have a clean definition of the input they rely on. This includes IDEs that provide javadoc, conversions to more structured documentation such as on-line help and localization. $.02, Roger On 7/26/2013 9:23 AM, Stephen Colebourne wrote: > On 26 July 2013 13:58, David M. Lloyd wrote: >> On 07/26/2013 04:39 AM, Stephen Colebourne wrote: >>> Its websites and >>> browsers that define what should be accepted as HTML, not standards. >> This is the craziest thing I've read all week. > What percentage of the worlds websites contain valid HTML/XHTML > according to the DOCTYPE/validator? > > I'd be amazed if its more than 1%. > > The Oracle home page, java.net, java.com and J2SE download page all > fail validation. Yet all are perfactly usable websites. > RedHat: > http://validator.w3.org/check?uri=http%3A%2F%2Fredhat.com&charset=%28detect+automatically%29&doctype=Inline&group=0&user-agent=W3C_Validator%2F1.3+http%3A%2F%2Fvalidator.w3.org%2Fservices > JBoss: > http://validator.w3.org/check?uri=https%3A%2F%2Fwww.jboss.org%2Foverview%2F&charset=%28detect+automatically%29&doctype=Inline&group=0&user-agent=W3C_Validator%2F1.3+http%3A%2F%2Fvalidator.w3.org%2Fservices > > Tim Berners Lee said in the linked article: "Some things are clearer > with hindsight of several years. It is necessary to evolve HTML > incrementally. The attempt to get the world to switch to XML, > including quotes around attribute values and slashes in empty tags and > namespaces all at once didn't work". > > This isn't Java EE. HTML is a space where standards are a *guide*. I > absolutely stand by my statement. > > Stephen From heliofrota at gmail.com Fri Jul 26 13:46:14 2013 From: heliofrota at gmail.com (Helio Frota) Date: Fri, 26 Jul 2013 10:46:14 -0300 Subject: Build error with GCC4.8 on Fedora19 In-Reply-To: References: <20130709045501.4D23E3B6274@msgw008-05.ocn.ad.jp> <51DBA3CD.9020605@oracle.com> <51DBBE7C.6070801@oracle.com> <51DDAF72.4000909@redhat.com> <51F01E07.3070808@oracle.com> <51F030E1.6090407@redhat.com> <51F038A3.1010001@redhat.com> Message-ID: Hi, Just feedback , build was ok with fedora 19. Thanks Omair Majid for the flag tips. $ sudo yum groupinstall "Development Tools" $ sudo yum install gcc-c++ $ sudo yum install libXrender-devel $ sudo yum install freetype-devel $ sudo yum install libXt-devel $ ./configure $ make DEBUG_BINARIES=true SCTP_WERROR="" all Thanks, Helio 2013/7/25 Helio Frota > Hi > > sudo yum install libXt-devel solve the dependency problem. > > but i get other... > > cc1: all warnings being treated as errors > gmake[2]: *** > [/home/hf/adopt_openjdk/openjdk8/build/linux-x86-normal-server-release/jdk/objs/libsctp/SctpChannelImpl.o] > Error 1 > > gmake[2]: *** Waiting for unfinished jobs.... > cc1: all warnings being treated as errors > gmake[2]: *** > [/home/hf/adopt_openjdk/openjdk8/build/linux-x86-normal-server-release/jdk/objs/libsctp/SctpNet.o] > Error 1 > gmake[1]: *** [libs-only] Error 2 > > make: *** [jdk-only] Error 2 > > is right disable warnings treated as errors ? > > Regards, > Helio > > > > > > 2013/7/25 Helio Frota > >> Hi Omair and Alan, >> >> >> I get this error: >> >> In file included from >> /home/hf/adopt_openjdk/openjdk8/build/linux-x86-normal-server-release/jdk/gensrc_x11wrappers/sizer.32.c:11:0: >> /home/hf/adopt_openjdk/openjdk8/jdk/src/solaris/native/sun/awt/awt_p.h:44:27: >> fatal error: X11/Intrinsic.h: No such file or directory >> #include >> ^ >> compilation terminated. >> gmake[2]: *** >> [/home/hf/adopt_openjdk/openjdk8/build/linux-x86-normal-server-release/jdk/gensrc_x11wrappers/sizer.32.exe] >> Error 1 >> gmake[2]: *** Waiting for unfinished jobs.... >> gmake[1]: *** [gensrc-only] Error 2 >> >> make: *** [jdk-only] Error 2 >> >> Omair thanks for the tip "make DEBUG_BINARIES=true all" works. >> >> Regards, >> Helio >> >> >> >> 2013/7/24 Helio Frota >> >>> Hi Omair, >>> >>> >>> The only problem is that modern gcc versions don't produce stabs either. >>> Try: >>> $ make DEBUG_BINARIES=true all >>> >>> Thanks for the tip ! >>> >>> I will try again tomorrow on job (fedora19) machine. >>> >>> Regards, >>> Helio >>> >>> >>> >>> 2013/7/24 Omair Majid >>> >>>> On 07/24/2013 04:11 PM, Helio Frota wrote: >>>> > Hi, >>>> > >>>> > I got the same problem with GCC 4.8.1 and Manjaro distribution ( >>>> distro >>>> > son of archlinux ) >>>> > >>>> > Generating precompiled header precompiled.hpp.gch >>>> > cc1plus: error: the "stabs" debug format cannot be used with >>>> > pre-compiled headers [-Werror=deprecated] >>>> > cc1plus: all warnings being treated as errors >>>> > gmake[6]: *** [precompiled.hpp.gch] Error 1 >>>> > gmake[5]: *** [the_vm] Error 2 >>>> > gmake[4]: *** [product] Error 2 >>>> > gmake[3]: *** [generic_build2] Error 2 >>>> > gmake[2]: *** [product] Error 2 >>>> > gmake[1]: *** >>>> > >>>> [/home/hf/adopt_openjdk/openjdk8/build/linux-x86-normal-server-release/hotspot/_hotspot.timestamp] >>>> > Error 2 >>>> > make: *** [hotspot-only] Error 2 >>>> >>>> from hotspot/make/linux/makefiles/gcc.make: >>>> >>>> # DEBUG_BINARIES uses full -g debug information for all configs >>>> ifeq ($(DEBUG_BINARIES), true) >>>> CFLAGS += -g >>>> else >>>> # Use the stabs format for debugging information (this is the default >>>> # on gcc-2.91). It's good enough, has all the information about line >>>> # numbers and local variables, and libjvm.so is only about 16M. >>>> # Change this back to "-g" if you want the most expressive format. >>>> # (warning: that could easily inflate libjvm.so to 150M!) >>>> >>>> The only problem is that modern gcc versions don't produce stabs either. >>>> >>>> Try: >>>> >>>> $ make DEBUG_BINARIES=true all >>>> >>>> Cheers, >>>> Omair >>>> >>>> -- >>>> PGP Key: 66484681 (http://pgp.mit.edu/) >>>> Fingerprint = F072 555B 0A17 3957 4E95 0056 F286 F14F 6648 4681 >>>> >>> >>> >>> >>> -- >>> Helio Frota >>> JUG Leader - CEJUG >>> http://www.cejug.org/ >>> http://www.linkedin.com/in/heliofrota >>> >>> >>> >> >> >> -- >> Helio Frota >> JUG Leader - CEJUG >> http://www.cejug.org/ >> http://www.linkedin.com/in/heliofrota >> >> >> > > > -- > Helio Frota > JUG Leader - CEJUG > http://www.cejug.org/ > http://www.linkedin.com/in/heliofrota > > > -- Helio Frota JUG Leader - CEJUG http://www.cejug.org/ http://www.linkedin.com/in/heliofrota From david.lloyd at redhat.com Fri Jul 26 13:49:59 2013 From: david.lloyd at redhat.com (David M. Lloyd) Date: Fri, 26 Jul 2013 08:49:59 -0500 Subject: Invalid "self-closing element not allowed" JavaDoc error In-Reply-To: References: <51F16363.7070405@redhat.com> <51F16AEC.70203@oracle.com> <51F175A3.4010302@oracle.com> <83836065-9553-4D00-B65D-314DAF502391@nicholaswilliams.net> <51F18E8F.2070001@oracle.com> <51F2727A.2070003@redhat.com> Message-ID: <51F27E87.2060901@redhat.com> On 07/26/2013 08:23 AM, Stephen Colebourne wrote: > On 26 July 2013 13:58, David M. Lloyd wrote: >> On 07/26/2013 04:39 AM, Stephen Colebourne wrote: >>> >>> Its websites and >>> browsers that define what should be accepted as HTML, not standards. >> >> This is the craziest thing I've read all week. > > What percentage of the worlds websites contain valid HTML/XHTML > according to the DOCTYPE/validator? > > I'd be amazed if its more than 1%. > > The Oracle home page, java.net, java.com and J2SE download page all > fail validation. Yet all are perfactly usable websites. > RedHat: > http://validator.w3.org/check?uri=http%3A%2F%2Fredhat.com&charset=%28detect+automatically%29&doctype=Inline&group=0&user-agent=W3C_Validator%2F1.3+http%3A%2F%2Fvalidator.w3.org%2Fservices > JBoss: > http://validator.w3.org/check?uri=https%3A%2F%2Fwww.jboss.org%2Foverview%2F&charset=%28detect+automatically%29&doctype=Inline&group=0&user-agent=W3C_Validator%2F1.3+http%3A%2F%2Fvalidator.w3.org%2Fservices > > Tim Berners Lee said in the linked article: "Some things are clearer > with hindsight of several years. It is necessary to evolve HTML > incrementally. The attempt to get the world to switch to XML, > including quotes around attribute values and slashes in empty tags and > namespaces all at once didn't work". > > This isn't Java EE. HTML is a space where standards are a *guide*. I > absolutely stand by my statement. You took one step outside of logic, in my opinion. Yes, the spec is a guide, in practice. But to use that to justify not even trying to conform or not encouraging people to conform is crazy. Without the spec, the HTML world would be even more insane than it is now, by orders of magnitude. It is very likely that browsers will accept spec-compliant HTML. It is also very *unlikely* that your average user will be arsed to test their HTML on every browser on the planet before they publish their JavaDoc. It is also unlikely for your average Java developer to know or understand *any* of these issues; you're giving them way too much credit IMO by assuming that they're simply imposing some kind of rational style, rather than simply not knowing how HTML works. In the end I think it does far less harm to bark at people who are not writing spec-compliant HTML than it does to assume they know what they're doing and what the implications are. If doclint doesn't enforce this kind of strictness, then what will? -- - DML From karen.kinnear at oracle.com Fri Jul 26 14:50:56 2013 From: karen.kinnear at oracle.com (Karen Kinnear) Date: Fri, 26 Jul 2013 10:50:56 -0400 Subject: Code Review Request: More tests for 7184826: (reflect) Add support for Project Lambda concepts in core reflection In-Reply-To: References: <519E2C52.20203@oracle.com> <51B91AA5.6090807@oracle.com> <20130710141722.GA23047@jfranck-desktop.jrpg.bea.com> <51ED2FC9.5040200@oracle.com> <0805A1F1-E808-428B-ABFE-EC5764A81044@oracle.com> <51EF2E32.5080301@oracle.com> Message-ID: Vladimir Ivanov has already written tests at the classfile level, which javac doesn't generate. They do not all pass yet, which is why they are not on by default. Let me know if anyone wants to study the details. Note that there is already a bug filed to remove the bridging and covariant return subsets of tests since the vm no longer needs to support that. And we know we still need to visit in detail the expected appropriate exceptions that get thrown. thanks, Karen On Jul 25, 2013, at 10:25 AM, Joel Borggr?n-Franck wrote: > Hi Amy, > > On Jul 24, 2013, at 3:30 AM, Amy Lu wrote: > >> Thank you Dan ! >> >> Please see my comments inline... >> >> On 7/24/13 5:12 AM, Dan Smith wrote: >>> Hi. >>> >>> Per a request from Joel, I've taken a look at DefaultStaticTestData. I don't really have the full context here, but I'm assuming that the annotations get translated into tests that guarantee 1) the result of Class.getMethods is exactly (no more -- excepting Object methods -- and no less) those methods named by MethodDesc annotations; and 2) the result of Class.getDeclaredMethods is exactly (no more, no less) those methods that are marked "declared=YES". >>> >>> The expected results seem accurate. I would personally focus testing more on different inheritance shapes and less on different combinations of (unrelated) method declarations or presence/absence type variables (!?), but it's a valid test in any case. >>> >>> There ought to be some testing for scenarios that javac won't generate, like conflicting default method declarations. >>> >> Testing on "javac" is out of this scope, it's covered by langtools tests, say test/tools/javac/defaultMethods/ > > I sort of agree with Dan here. This wouldn't be testing of javac, rather testing that Core Reflection works for combinations that javac doesn't currently emit. However I think that is an excellent candidate for a follow up test, we can address that after these test are finished. I will file a bug for this. > > cheers > /Joel From scolebourne at joda.org Fri Jul 26 15:27:24 2013 From: scolebourne at joda.org (Stephen Colebourne) Date: Fri, 26 Jul 2013 16:27:24 +0100 Subject: Invalid "self-closing element not allowed" JavaDoc error In-Reply-To: <51F27E87.2060901@redhat.com> References: <51F16363.7070405@redhat.com> <51F16AEC.70203@oracle.com> <51F175A3.4010302@oracle.com> <83836065-9553-4D00-B65D-314DAF502391@nicholaswilliams.net> <51F18E8F.2070001@oracle.com> <51F2727A.2070003@redhat.com> <51F27E87.2060901@redhat.com> Message-ID: On 26 July 2013 14:49, David M. Lloyd wrote: > You took one step outside of logic, in my opinion. Yes, the spec is a > guide, in practice. But to use that to justify not even trying to conform > or not encouraging people to conform is crazy. Without the spec, the HTML > world would be even more insane than it is now, by orders of magnitude. > > It is very likely that browsers will accept spec-compliant HTML. It is also > very *unlikely* that your average user will be arsed to test their HTML on > every browser on the planet before they publish their JavaDoc. It is also > unlikely for your average Java developer to know or understand *any* of > these issues; you're giving them way too much credit IMO by assuming that > they're simply imposing some kind of rational style, rather than simply not > knowing how HTML works. > > In the end I think it does far less harm to bark at people who are not > writing spec-compliant HTML than it does to assume they know what they're > doing and what the implications are. If doclint doesn't enforce this kind > of strictness, then what will? Frankly, getting developers to write any Javadoc is a huge problem. Getting them to correctly use the basic tags is another huge step (generally enforced today via checkstyle). Asking them to write well-formed HTML seems unrealistic and likely to have the negative effect of causing less documentation, not more. In addition, Javadoc is frequently read as source code in IDEs (F3 through to the class and read the source code Javadoc, not the HTML Javadoc). In fact, I read source code Javadoc at least ten times more often than HTML Javadoc. Given that strict HTML tends to simply get in the way visually of reading the source code Javadoc, it becomes yet another negative of strictness. The original issue in the thread is whether
                                                                    should be valid. I think it should because its hugely widely used and accepted by browsers, and forcing developers to change to
                                                                    is net negative. Note that if doclint was off by default in the Javadoc tool, I probably wouldn't care. Stephen From paul.sandoz at oracle.com Fri Jul 26 15:33:00 2013 From: paul.sandoz at oracle.com (Paul Sandoz) Date: Fri, 26 Jul 2013 16:33:00 +0100 Subject: RFR 8020156/8020009 TreeMap.values should report ORDERED/TreeMap.entrySet comparator should not be null In-Reply-To: References: Message-ID: <6162981E-8DCF-4D11-AC71-83D837EC6BD6@oracle.com> On Jul 25, 2013, at 8:41 PM, Mike Duigou wrote: > The changes look OK to me. I do prefer the later form but will accept either. > Thanks, i think i will go with the latter. Paul. From alexey.utkin at oracle.com Fri Jul 26 15:33:35 2013 From: alexey.utkin at oracle.com (Alexey Utkin) Date: Fri, 26 Jul 2013 19:33:35 +0400 Subject: Review request: JDK-8021245 (process) file leak in jdk/src/windows/native/java/lang/ProcessImpl_md.c Message-ID: <51F296CF.2050902@oracle.com> Bug description: https://jbs.oracle.com/bugs/browse/JDK-8021245 http://bugs.sun.com/view_bug.do?bug_id=8021245 Here is the suggested fix: http://cr.openjdk.java.net/~uta/openjdk-webrevs/JDK-8021245/webrev.00/ Summary: In accordance with MS spec [-1] is THE ONLY error signal from the [_open] function call. http://msdn.microsoft.com/en-us/library/z0kc8e3z.aspx Any negative, except [-1], and zero are the valid handles that need to be closed. The fix was tested in the debugger my manual switching to Win9x/WinMe brunch of execution. Regards, -uta From scolebourne at joda.org Fri Jul 26 15:44:06 2013 From: scolebourne at joda.org (Stephen Colebourne) Date: Fri, 26 Jul 2013 16:44:06 +0100 Subject: Invalid "self-closing element not allowed" JavaDoc error In-Reply-To: <51F27D42.3060003@oracle.com> References: <51F16363.7070405@redhat.com> <51F16AEC.70203@oracle.com> <51F175A3.4010302@oracle.com> <83836065-9553-4D00-B65D-314DAF502391@nicholaswilliams.net> <51F18E8F.2070001@oracle.com> <51F2727A.2070003@redhat.com> <51F27D42.3060003@oracle.com> Message-ID: On 26 July 2013 14:44, roger riggs wrote: > The html subset that appears in javadoc comments does not exist in isolation > or in a full browser context. > It is deliberately limited and structured to work within a documentation > framework > defined by javadoc and supported by the javadoc stylesheet using HTML 4.01. The Javadoc page doesn't seem to describe an HTML subset: http://www.oracle.com/technetwork/java/javase/documentation/index-137868.html Nor the FAQ: http://www.oracle.com/technetwork/java/javase/documentation/index-137483.html Ah, here we go: "Comments are written in HTML - The text must be written in HTML, in that they should use HTML entities and can use HTML tags. You can use whichever version of HTML your browser supports; we have written the standard doclet to generate HTML 3.2-compliant code elsewhere (outside of the documentation comments) with the inclusion of cascading style sheets and frames. (We preface each generated file with "HTML 4.0" because of the frame sets.) " "Use header tags carefully - When writing documentation comments for members, it's best not to use HTML heading tags such as

                                                                    and

                                                                    , because the Javadoc tool creates an entire structured document and these structural tags might interfere with the formatting of the generated document. However, it is fine to use these headings in class and package comments to provide your own structure. " http://docs.oracle.com/javase/1.5.0/docs/tooldocs/windows/javadoc.html (the latest version linked from the JavaSE page) So, it would seem that doclint is enforcing something that this spec does not require - "You can use whichever version of HTML your browser supports" - and no more than a weak warning against h1 and h2. This now looks like doclint is enforcing somthing that doesn't exist, close to being backwards incompatible. This looks more and more wrong to me. Stephen From nicholas+openjdk at nicholaswilliams.net Fri Jul 26 15:46:41 2013 From: nicholas+openjdk at nicholaswilliams.net (Nick Williams) Date: Fri, 26 Jul 2013 10:46:41 -0500 Subject: Invalid "self-closing element not allowed" JavaDoc error In-Reply-To: References: <51F16363.7070405@redhat.com> <51F16AEC.70203@oracle.com> <51F175A3.4010302@oracle.com> <83836065-9553-4D00-B65D-314DAF502391@nicholaswilliams.net> <51F18E8F.2070001@oracle.com> <51F2727A.2070003@redhat.com> <51F27E87.2060901@redhat.com> Message-ID: On Jul 26, 2013, at 10:27 AM, Stephen Colebourne wrote: > On 26 July 2013 14:49, David M. Lloyd wrote: >> You took one step outside of logic, in my opinion. Yes, the spec is a >> guide, in practice. But to use that to justify not even trying to conform >> or not encouraging people to conform is crazy. Without the spec, the HTML >> world would be even more insane than it is now, by orders of magnitude. >> >> It is very likely that browsers will accept spec-compliant HTML. It is also >> very *unlikely* that your average user will be arsed to test their HTML on >> every browser on the planet before they publish their JavaDoc. It is also >> unlikely for your average Java developer to know or understand *any* of >> these issues; you're giving them way too much credit IMO by assuming that >> they're simply imposing some kind of rational style, rather than simply not >> knowing how HTML works. >> >> In the end I think it does far less harm to bark at people who are not >> writing spec-compliant HTML than it does to assume they know what they're >> doing and what the implications are. If doclint doesn't enforce this kind >> of strictness, then what will? > > Frankly, getting developers to write any Javadoc is a huge problem. > Getting them to correctly use the basic tags is another huge step > (generally enforced today via checkstyle). Asking them to write > well-formed HTML seems unrealistic and likely to have the negative > effect of causing less documentation, not more. > > In addition, Javadoc is frequently read as source code in IDEs (F3 > through to the class and read the source code Javadoc, not the HTML > Javadoc). In fact, I read source code Javadoc at least ten times more > often than HTML Javadoc. Given that strict HTML tends to simply get in > the way visually of reading the source code Javadoc, it becomes yet > another negative of strictness. > > The original issue in the thread is whether
                                                                    should be valid. I > think it should because its hugely widely used and accepted by > browsers, and forcing developers to change to
                                                                    is net negative. > > Note that if doclint was off by default in the Javadoc tool, I > probably wouldn't care. I would even say note that if
                                                                    wasn't a process-stopping ERROR I probably wouldn't care. That's the biggest pain in the @$$ to me. That having
                                                                    in a JavaDoc makes in impossible for me to generate JavaDoc. Sure, I can disable doclint, but THEN I miss out on all the other useful messages it provides. Just make
                                                                    a warning (or all self-closing void tags in general) and I'm satisfied. From zhong.j.yu at gmail.com Fri Jul 26 16:50:46 2013 From: zhong.j.yu at gmail.com (Zhong Yu) Date: Fri, 26 Jul 2013 11:50:46 -0500 Subject: Invalid "self-closing element not allowed" JavaDoc error In-Reply-To: References: <51F16363.7070405@redhat.com> <51F16AEC.70203@oracle.com> <51F175A3.4010302@oracle.com> <83836065-9553-4D00-B65D-314DAF502391@nicholaswilliams.net> <51F18E8F.2070001@oracle.com> <51F2727A.2070003@redhat.com> <51F27E87.2060901@redhat.com> Message-ID: Most elements MUST NOT be self closed; it'll screw up document tree. Try this piece of html in your browser
                                                                    text outside div However
                                                                    etc seems to be fine; they are elements with EMPTY content model, or "VOID element" in html 5 jargon. There are exactly 10 such elements in html 4 area base br col hr img input link meta param I agree with Nick that a mere warning is appropriate for these elements. Zhong Yu On Fri, Jul 26, 2013 at 10:46 AM, Nick Williams wrote: > > On Jul 26, 2013, at 10:27 AM, Stephen Colebourne wrote: > >> On 26 July 2013 14:49, David M. Lloyd wrote: >>> You took one step outside of logic, in my opinion. Yes, the spec is a >>> guide, in practice. But to use that to justify not even trying to conform >>> or not encouraging people to conform is crazy. Without the spec, the HTML >>> world would be even more insane than it is now, by orders of magnitude. >>> >>> It is very likely that browsers will accept spec-compliant HTML. It is also >>> very *unlikely* that your average user will be arsed to test their HTML on >>> every browser on the planet before they publish their JavaDoc. It is also >>> unlikely for your average Java developer to know or understand *any* of >>> these issues; you're giving them way too much credit IMO by assuming that >>> they're simply imposing some kind of rational style, rather than simply not >>> knowing how HTML works. >>> >>> In the end I think it does far less harm to bark at people who are not >>> writing spec-compliant HTML than it does to assume they know what they're >>> doing and what the implications are. If doclint doesn't enforce this kind >>> of strictness, then what will? >> >> Frankly, getting developers to write any Javadoc is a huge problem. >> Getting them to correctly use the basic tags is another huge step >> (generally enforced today via checkstyle). Asking them to write >> well-formed HTML seems unrealistic and likely to have the negative >> effect of causing less documentation, not more. >> >> In addition, Javadoc is frequently read as source code in IDEs (F3 >> through to the class and read the source code Javadoc, not the HTML >> Javadoc). In fact, I read source code Javadoc at least ten times more >> often than HTML Javadoc. Given that strict HTML tends to simply get in >> the way visually of reading the source code Javadoc, it becomes yet >> another negative of strictness. >> >> The original issue in the thread is whether
                                                                    should be valid. I >> think it should because its hugely widely used and accepted by >> browsers, and forcing developers to change to
                                                                    is net negative. >> >> Note that if doclint was off by default in the Javadoc tool, I >> probably wouldn't care. > > I would even say note that if
                                                                    wasn't a process-stopping ERROR I probably wouldn't care. That's the biggest pain in the @$$ to me. That having
                                                                    in a JavaDoc makes in impossible for me to generate JavaDoc. Sure, I can disable doclint, but THEN I miss out on all the other useful messages it provides. Just make
                                                                    a warning (or all self-closing void tags in general) and I'm satisfied. From brent.christian at oracle.com Fri Jul 26 17:53:05 2013 From: brent.christian at oracle.com (Brent Christian) Date: Fri, 26 Jul 2013 10:53:05 -0700 Subject: Java 8 RFR 8011194: Apps launched via double-clicked .jars have file.encoding value of US-ASCII on Mac OS X Message-ID: <51F2B781.1050104@oracle.com> Please review my fix for 8011194 : "Apps launched via double-clicked .jars have file.encoding value of US-ASCII on Mac OS X" http://bugs.sun.com/view_bug.do?bug_id=8011194 In most cases of launching a Java app on Mac (from the cmdline, or from a native .app bundle), reading and displaying UTF-8 characters beyond the standard ASCII range works fine. A notable exception is the launching of an app by double-clicking a .jar file. In this case, file.encoding defaults to US-ASCII, and characters outside of the ASCII range show up as garbage. (FWIW, this is not recommended by Apple as a method for deploying Java apps [1], though OS X does have a Jar Launcher.app to make it work.) It's worth mentioning that this is not something that has ever worked on MacOS X. (Apple's JRE defaulted to "MacRoman" for English and AFAIK most European locales. I believe this is a holdover from the pre-OS X days). Even so, the situation can be improved. When launching, if the standard encoding comes up as US-ASCII, but there are no hints from the environment (e.g. LANG/etc environment variables), it would be sane to instead use UTF-8 as the default encoding on MacOS X. An explicit file.encoding setting by the user is still honored (and can even be set back to US-ASCII). I believe this also fixes the related issue with webstart [2]. Webrev is here: http://cr.openjdk.java.net/~bchristi/8011194/webrev.00/ Thanks, -Brent [1] http://developer.apple.com/library/mac/#documentation/Java/Conceptual/Java14Development/03-JavaDeployment/JavaDeployment.html [2] http://bugs.sun.com/view_bug.do?bug_id=8011195 From david.dehaven at oracle.com Fri Jul 26 21:34:11 2013 From: david.dehaven at oracle.com (David DeHaven) Date: Fri, 26 Jul 2013 14:34:11 -0700 Subject: Java 8 RFR 8011194: Apps launched via double-clicked .jars have file.encoding value of US-ASCII on Mac OS X In-Reply-To: <51F2B781.1050104@oracle.com> References: <51F2B781.1050104@oracle.com> Message-ID: <23074B3D-B75B-4568-B32C-15481332FBB3@oracle.com> > Please review my fix for 8011194 : "Apps launched via double-clicked .jars have file.encoding value of US-ASCII on Mac OS X" > > http://bugs.sun.com/view_bug.do?bug_id=8011194 > > In most cases of launching a Java app on Mac (from the cmdline, or from a native .app bundle), reading and displaying UTF-8 characters beyond the standard ASCII range works fine. > > A notable exception is the launching of an app by double-clicking a .jar file. In this case, file.encoding defaults to US-ASCII, and characters outside of the ASCII range show up as garbage. > > (FWIW, this is not recommended by Apple as a method for deploying Java apps [1], though OS X does have a Jar Launcher.app to make it work.) > > It's worth mentioning that this is not something that has ever worked on MacOS X. (Apple's JRE defaulted to "MacRoman" for English and AFAIK most European locales. I believe this is a holdover from the pre-OS X days). > > Even so, the situation can be improved. When launching, if the standard encoding comes up as US-ASCII, but there are no hints from the environment (e.g. LANG/etc environment variables), it would be sane to instead use UTF-8 as the default encoding on MacOS X. An explicit file.encoding setting by the user is still honored (and can even be set back to US-ASCII). > > I believe this also fixes the related issue with webstart [2]. That'd be wonderful! :) I'm not a "Reviewer" but it looks fine to me. -DrD- From jason.uh at oracle.com Fri Jul 26 21:17:52 2013 From: jason.uh at oracle.com (jason.uh at oracle.com) Date: Fri, 26 Jul 2013 21:17:52 +0000 Subject: hg: jdk8/tl/jdk: 8019544: Need to run ProviderTest.java in othervm mode. Message-ID: <20130726211833.668D6483EC@hg.openjdk.java.net> Changeset: 7ae061cfd4be Author: juh Date: 2013-07-26 14:16 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/7ae061cfd4be 8019544: Need to run ProviderTest.java in othervm mode. Reviewed-by: wetmore, xuelei, vinnie Contributed-by: rajan.halade at oracle.com ! test/sun/security/ssl/com/sun/net/ssl/SSLSecurity/ProviderTest.java From martinrb at google.com Fri Jul 26 21:54:56 2013 From: martinrb at google.com (Martin Buchholz) Date: Fri, 26 Jul 2013 14:54:56 -0700 Subject: Still need a review for Java 8 RFR 8014319: Faster division of large integers In-Reply-To: <481BC79A-5015-456B-BC9B-FAFBBC9ED3A4@oracle.com> References: <481BC79A-5015-456B-BC9B-FAFBBC9ED3A4@oracle.com> Message-ID: Reluctant math reviewer here. Looks good, except for apparently overzealous s/size/SIZE/g, as in - * a lot of numbers that will find failure points, such as max sized + * a lot of numbers that will find failure points, such as max SIZEd On Thu, Jul 25, 2013 at 11:55 AM, Brian Burkhalter < brian.burkhalter at oracle.com> wrote: > JDK 8 Reviewers: > > This patch is still pending approval by: > > http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-July/018922.html > > Thanks, > > Brian > From lana.steuck at oracle.com Fri Jul 26 22:18:33 2013 From: lana.steuck at oracle.com (lana.steuck at oracle.com) Date: Fri, 26 Jul 2013 22:18:33 +0000 Subject: hg: jdk8/tl/hotspot: 15 new changesets Message-ID: <20130726221912.4DA9A483F6@hg.openjdk.java.net> Changeset: dc8afa03e5c9 Author: katleman Date: 2013-07-11 14:07 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/dc8afa03e5c9 8020414: JDK8 b98 source with GPL header errors Reviewed-by: darcy, lancea, iris ! test/runtime/8001071/Test8001071.sh Changeset: 1c474723a324 Author: katleman Date: 2013-07-11 14:33 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/1c474723a324 Merge Changeset: 81b6cb70717c Author: katleman Date: 2013-07-16 15:15 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/81b6cb70717c Merge Changeset: bb416ee2a79b Author: cl Date: 2013-07-18 03:38 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/bb416ee2a79b Added tag jdk8-b99 for changeset 81b6cb70717c ! .hgtags Changeset: bd1dc81da579 Author: amurillo Date: 2013-07-12 17:08 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/bd1dc81da579 8020382: new hotspot build - hs25-b42 Reviewed-by: jcoomes ! make/hotspot_version Changeset: f4311079200c Author: brutisso Date: 2013-07-11 11:33 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/f4311079200c 8020155: PSR:PERF G1 not collecting old regions when humongous allocations interfer Summary: Take _last_young_gc into account when deciding on starting a concurrent mark. Also reviewed-by: per.liden at oracle.com. Reviewed-by: tschatzl, johnc ! src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp Changeset: e7a47f226600 Author: tamao Date: 2013-07-15 15:14 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/e7a47f226600 Merge - src/share/vm/runtime/aprofiler.cpp - src/share/vm/runtime/aprofiler.hpp Changeset: 980532a806a5 Author: goetz Date: 2013-06-20 15:02 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/980532a806a5 8016697: Use stubs to implement safefetch Summary: Implement Safefetch as stub routines. This reduces compiler and os dependencies. Reviewed-by: twisti, kvn ! src/cpu/sparc/vm/stubGenerator_sparc.cpp ! src/cpu/x86/vm/stubGenerator_x86_32.cpp ! src/cpu/x86/vm/stubGenerator_x86_64.cpp ! src/os/windows/vm/os_windows.cpp ! src/os_cpu/bsd_x86/vm/bsd_x86_32.s ! src/os_cpu/bsd_x86/vm/bsd_x86_64.s ! src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp ! src/os_cpu/linux_sparc/vm/linux_sparc.s ! src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp ! src/os_cpu/linux_x86/vm/linux_x86_32.s ! src/os_cpu/linux_x86/vm/linux_x86_64.s ! src/os_cpu/linux_x86/vm/os_linux_x86.cpp ! src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp ! src/os_cpu/solaris_sparc/vm/solaris_sparc.s ! src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp ! src/os_cpu/solaris_x86/vm/solaris_x86_32.s ! src/os_cpu/solaris_x86/vm/solaris_x86_64.s ! src/os_cpu/windows_x86/vm/os_windows_x86.cpp ! src/share/vm/runtime/os.hpp ! src/share/vm/runtime/stubRoutines.cpp ! src/share/vm/runtime/stubRoutines.hpp Changeset: a74ec8831c7b Author: clucasius Date: 2013-07-15 12:24 -0400 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/a74ec8831c7b Merge ! src/os/windows/vm/os_windows.cpp ! src/share/vm/runtime/os.hpp Changeset: 16b10327b00d Author: jprovino Date: 2013-07-16 10:55 -0400 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/16b10327b00d 8011569: ARM -- avoid native stack walking Summary: ARM compilers do not emit FramePointer on each native frame by default Reviewed-by: dholmes, zgu ! make/linux/makefiles/vm.make ! src/share/vm/services/memTracker.cpp ! src/share/vm/utilities/globalDefinitions.hpp Changeset: 90d6c221d4e5 Author: jprovino Date: 2013-07-16 12:20 -0400 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/90d6c221d4e5 Merge ! make/linux/makefiles/vm.make - src/os_cpu/linux_sparc/vm/assembler_linux_sparc.cpp - src/os_cpu/solaris_sparc/vm/assembler_solaris_sparc.cpp - src/share/vm/runtime/aprofiler.cpp - src/share/vm/runtime/aprofiler.hpp ! src/share/vm/services/memTracker.cpp - src/share/vm/trace/traceEventTypes.hpp ! src/share/vm/utilities/globalDefinitions.hpp Changeset: 9d18d92e54b5 Author: clucasius Date: 2013-07-18 00:52 -0400 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/9d18d92e54b5 Merge Changeset: 9f71e36a471a Author: amurillo Date: 2013-07-18 09:25 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/9f71e36a471a Merge Changeset: 5787fac72e76 Author: amurillo Date: 2013-07-18 09:25 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/5787fac72e76 Added tag hs25-b42 for changeset 9f71e36a471a ! .hgtags Changeset: 9d7b55c8a0c4 Author: cl Date: 2013-07-25 03:18 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/9d7b55c8a0c4 Added tag jdk8-b100 for changeset 5787fac72e76 ! .hgtags From lana.steuck at oracle.com Fri Jul 26 22:18:15 2013 From: lana.steuck at oracle.com (lana.steuck at oracle.com) Date: Fri, 26 Jul 2013 22:18:15 +0000 Subject: hg: jdk8/tl/langtools: 5 new changesets Message-ID: <20130726221844.A957B483F5@hg.openjdk.java.net> Changeset: 6d85acab769e Author: mcimadamore Date: 2013-07-17 19:28 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/6d85acab769e 8013638: Few policy tests are failing in Lambda nightly Summary: BridgeHarness test is leaving files open Reviewed-by: ksrini ! test/tools/javac/generics/bridges/BridgeHarness.java Changeset: e73f00139fb5 Author: cl Date: 2013-07-18 03:39 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/e73f00139fb5 Added tag jdk8-b99 for changeset 6d85acab769e ! .hgtags Changeset: 82f68da70e47 Author: lana Date: 2013-07-22 17:39 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/82f68da70e47 Merge - test/tools/javac/generics/6723444/T6723444.out - test/tools/javac/generics/7015430/T7015430.out Changeset: 0324dbf07b0f Author: cl Date: 2013-07-25 03:19 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/0324dbf07b0f Added tag jdk8-b100 for changeset 82f68da70e47 ! .hgtags Changeset: 37048aa3ac19 Author: lana Date: 2013-07-26 14:08 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/37048aa3ac19 Merge From lana.steuck at oracle.com Fri Jul 26 22:18:14 2013 From: lana.steuck at oracle.com (lana.steuck at oracle.com) Date: Fri, 26 Jul 2013 22:18:14 +0000 Subject: hg: jdk8/tl/nashorn: 4 new changesets Message-ID: <20130726221822.F3C45483F3@hg.openjdk.java.net> Changeset: 10503ced6cc2 Author: cl Date: 2013-07-18 03:39 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/10503ced6cc2 Added tag jdk8-b99 for changeset 10a1ab9e20a4 ! .hgtags Changeset: 598321c438b5 Author: lana Date: 2013-07-22 17:40 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/598321c438b5 Merge - src/jdk/nashorn/internal/ir/ExecuteNode.java - test/script/currently-failing/JDK-8006529.js Changeset: a302b05d0ee4 Author: cl Date: 2013-07-25 03:19 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/a302b05d0ee4 Added tag jdk8-b100 for changeset 598321c438b5 ! .hgtags Changeset: d55856f82352 Author: lana Date: 2013-07-26 14:08 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/d55856f82352 Merge From lana.steuck at oracle.com Fri Jul 26 22:18:01 2013 From: lana.steuck at oracle.com (lana.steuck at oracle.com) Date: Fri, 26 Jul 2013 22:18:01 +0000 Subject: hg: jdk8/tl/jaxws: 2 new changesets Message-ID: <20130726221818.6CB78483F2@hg.openjdk.java.net> Changeset: 4fd722afae5c Author: cl Date: 2013-07-18 03:38 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jaxws/rev/4fd722afae5c Added tag jdk8-b99 for changeset 8ef83d4b23c9 ! .hgtags Changeset: 60b623a36164 Author: cl Date: 2013-07-25 03:19 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jaxws/rev/60b623a36164 Added tag jdk8-b100 for changeset 4fd722afae5c ! .hgtags From lana.steuck at oracle.com Fri Jul 26 22:18:01 2013 From: lana.steuck at oracle.com (lana.steuck at oracle.com) Date: Fri, 26 Jul 2013 22:18:01 +0000 Subject: hg: jdk8/tl: 2 new changesets Message-ID: <20130726221803.289C8483F0@hg.openjdk.java.net> Changeset: d2dcb110e9db Author: cl Date: 2013-07-18 03:37 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/rev/d2dcb110e9db Added tag jdk8-b99 for changeset 59dc9da81379 ! .hgtags Changeset: 9f74a220677d Author: cl Date: 2013-07-25 03:18 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/rev/9f74a220677d Added tag jdk8-b100 for changeset d2dcb110e9db ! .hgtags From lana.steuck at oracle.com Fri Jul 26 22:18:02 2013 From: lana.steuck at oracle.com (lana.steuck at oracle.com) Date: Fri, 26 Jul 2013 22:18:02 +0000 Subject: hg: jdk8/tl/corba: 2 new changesets Message-ID: <20130726221808.52A5D483F1@hg.openjdk.java.net> Changeset: 8d492f1dfd1b Author: cl Date: 2013-07-18 03:37 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/corba/rev/8d492f1dfd1b Added tag jdk8-b99 for changeset 3f67804ab613 ! .hgtags Changeset: a013024b0747 Author: cl Date: 2013-07-25 03:18 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/corba/rev/a013024b0747 Added tag jdk8-b100 for changeset 8d492f1dfd1b ! .hgtags From lana.steuck at oracle.com Fri Jul 26 22:18:06 2013 From: lana.steuck at oracle.com (lana.steuck at oracle.com) Date: Fri, 26 Jul 2013 22:18:06 +0000 Subject: hg: jdk8/tl/jaxp: 4 new changesets Message-ID: <20130726221828.4E289483F4@hg.openjdk.java.net> Changeset: 043da456d316 Author: cl Date: 2013-07-18 03:38 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jaxp/rev/043da456d316 Added tag jdk8-b99 for changeset adf49c3ef83c ! .hgtags Changeset: 5d1974c1d7b9 Author: lana Date: 2013-07-22 17:29 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jaxp/rev/5d1974c1d7b9 Merge Changeset: 0a7432f898e5 Author: cl Date: 2013-07-25 03:18 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jaxp/rev/0a7432f898e5 Added tag jdk8-b100 for changeset 5d1974c1d7b9 ! .hgtags Changeset: 467e1948612d Author: lana Date: 2013-07-26 14:01 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jaxp/rev/467e1948612d Merge From lana.steuck at oracle.com Fri Jul 26 22:21:35 2013 From: lana.steuck at oracle.com (lana.steuck at oracle.com) Date: Fri, 26 Jul 2013 22:21:35 +0000 Subject: hg: jdk8/tl/jdk: 26 new changesets Message-ID: <20130726223123.DF0AD483F8@hg.openjdk.java.net> Changeset: 56bc019a0525 Author: katleman Date: 2013-07-11 14:03 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/56bc019a0525 8020414: JDK8 b98 source with GPL header errors Reviewed-by: darcy, lancea, iris ! test/sun/security/krb5/auto/NoneReplayCacheTest.java Changeset: 030d1ca7432f Author: katleman Date: 2013-07-11 14:34 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/030d1ca7432f Merge Changeset: 6a099a36589b Author: katleman Date: 2013-07-16 15:16 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/6a099a36589b Merge Changeset: 9b6070690e50 Author: cl Date: 2013-07-18 03:38 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/9b6070690e50 Added tag jdk8-b99 for changeset 6a099a36589b ! .hgtags Changeset: cacfc77655c8 Author: serb Date: 2013-07-03 19:00 +0400 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/cacfc77655c8 8004859: Graphics.getClipBounds/getClip return difference nonequivalent bounds, depending from transform Reviewed-by: prr, flar ! src/share/classes/sun/java2d/SunGraphics2D.java + test/java/awt/Graphics2D/Test8004859/Test8004859.java Changeset: 75844b444879 Author: jchen Date: 2013-07-03 10:22 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/75844b444879 8014497: [parfait] Potential null pointer dereference in jdk/src/share/native/sun/java2d/cmm/lcms/cmsgamma.c Reviewed-by: bae, prr ! src/share/native/sun/java2d/cmm/lcms/cmsopt.c Changeset: d32757b7060c Author: lana Date: 2013-07-05 12:26 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/d32757b7060c Merge - src/share/classes/java/security/acl/package.html - src/share/classes/java/security/cert/package.html - src/share/classes/java/security/interfaces/package.html - src/share/classes/java/security/package.html - src/share/classes/java/security/spec/package.html - src/share/classes/sun/security/krb5/internal/rcache/CacheTable.java - src/share/classes/sun/security/krb5/internal/rcache/ReplayCache.java - test/java/util/Comparators/BasicTest.java - test/sun/security/krb5/auto/ReplayCache.java Changeset: dead66347eca Author: jgodinez Date: 2013-07-10 11:49 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/dead66347eca 8016737: After clicking on "Print UNCOLLATED" button, the print out come in order 'Page 1', 'Page 2', 'Page 1' Reviewed-by: jchen, prr ! src/solaris/classes/sun/print/IPPPrintService.java ! src/solaris/classes/sun/print/UnixPrintServiceLookup.java Changeset: fabcccc003d2 Author: lana Date: 2013-07-17 12:53 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/fabcccc003d2 Merge Changeset: f41758d12409 Author: alitvinov Date: 2013-07-04 16:06 +0400 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/f41758d12409 8015730: PIT: On Linux, OGL=true and fbobject=false leads to deadlock or infinite loop Reviewed-by: art, anthony ! src/solaris/classes/sun/awt/X11/XErrorHandlerUtil.java ! src/solaris/native/sun/awt/awt_util.h ! src/solaris/native/sun/java2d/opengl/GLXSurfaceData.c Changeset: 523815540788 Author: lana Date: 2013-07-05 11:57 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/523815540788 Merge - src/share/classes/java/security/acl/package.html - src/share/classes/java/security/cert/package.html - src/share/classes/java/security/interfaces/package.html - src/share/classes/java/security/package.html - src/share/classes/java/security/spec/package.html - src/share/classes/sun/security/krb5/internal/rcache/CacheTable.java - src/share/classes/sun/security/krb5/internal/rcache/ReplayCache.java - test/java/util/Comparators/BasicTest.java - test/sun/security/krb5/auto/ReplayCache.java Changeset: b7cbad879d63 Author: leonidr Date: 2013-07-08 19:47 +0400 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/b7cbad879d63 8019265: [macosx] apple.laf.useScreenMenuBar regression comparing with jdk6 Reviewed-by: anthony ! src/macosx/native/sun/awt/CMenuItem.m ! test/javax/swing/JMenuItem/ActionListenerCalledTwice/ActionListenerCalledTwiceTest.java Changeset: 7e291fc61cad Author: malenkov Date: 2013-07-09 18:01 +0400 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/7e291fc61cad 6707231: Wrong read Method returned for boolen properties Reviewed-by: alexsch ! src/share/classes/java/beans/Introspector.java + test/java/beans/Introspector/Test6707231.java Changeset: e7ca6e259dc2 Author: serb Date: 2013-07-09 21:21 +0400 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/e7ca6e259dc2 8019587: [macosx] Possibility to set the same frame for the different screens Reviewed-by: art, anthony ! src/share/classes/java/awt/GraphicsDevice.java + test/java/awt/GraphicsDevice/IncorrectDisplayModeExitFullscreen.java Changeset: 46826d248616 Author: pchelko Date: 2013-07-11 16:42 +0400 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/46826d248616 8020210: [macosx] JVM crashes in CWrapper$NSWindow.screen(long) Reviewed-by: anthony, art ! src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java ! src/macosx/classes/sun/lwawt/macosx/CWrapper.java ! src/macosx/native/sun/awt/CWrapper.m + test/java/awt/Window/MaximizeOffscreen/MaximizeOffscreenTest.java Changeset: c566daef4877 Author: leonidr Date: 2013-07-11 18:23 +0400 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/c566daef4877 8020038: [macosx] Incorrect usage of invokeLater() and likes in callbacks called via JNI from AppKit thread Reviewed-by: art, anthony ! src/macosx/classes/com/apple/eawt/FullScreenHandler.java ! src/macosx/classes/com/apple/eawt/_AppEventHandler.java ! src/macosx/classes/com/apple/eawt/event/GestureHandler.java ! src/macosx/classes/com/apple/laf/ScreenMenu.java ! src/macosx/classes/sun/lwawt/macosx/CCheckboxMenuItem.java ! src/macosx/classes/sun/lwawt/macosx/CViewEmbeddedFrame.java Changeset: c3268a602a50 Author: raginip Date: 2013-07-12 14:46 +0400 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/c3268a602a50 8009168: accessibility.properties syntax issue Reviewed-by: ptbrunet, mfang, alexsch ! src/share/classes/com/sun/accessibility/internal/resources/accessibility.properties ! src/share/classes/com/sun/accessibility/internal/resources/accessibility_de.properties ! src/share/classes/com/sun/accessibility/internal/resources/accessibility_es.properties ! src/share/classes/com/sun/accessibility/internal/resources/accessibility_fr.properties ! src/share/classes/com/sun/accessibility/internal/resources/accessibility_it.properties ! src/share/classes/com/sun/accessibility/internal/resources/accessibility_ja.properties ! src/share/classes/com/sun/accessibility/internal/resources/accessibility_ko.properties ! src/share/classes/com/sun/accessibility/internal/resources/accessibility_pt_BR.properties ! src/share/classes/com/sun/accessibility/internal/resources/accessibility_sv.properties ! src/share/classes/com/sun/accessibility/internal/resources/accessibility_zh_CN.properties ! src/share/classes/com/sun/accessibility/internal/resources/accessibility_zh_TW.properties ! src/share/classes/javax/accessibility/AccessibleAction.java Changeset: f7ea38893138 Author: serb Date: 2013-07-12 21:33 +0400 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/f7ea38893138 8020298: [macosx] Incorrect merge in the lwawt code Reviewed-by: art, anthony ! src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java Changeset: d52fc9384765 Author: pchelko Date: 2013-07-15 12:06 +0400 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/d52fc9384765 8020371: [macosx] applets with Drag and Drop fail with IllegalArgumentException Reviewed-by: anthony, art ! src/macosx/classes/sun/lwawt/macosx/CDragSourceContextPeer.java ! src/macosx/classes/sun/lwawt/macosx/CDropTarget.java ! src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java Changeset: 0967103c1b65 Author: malenkov Date: 2013-07-15 17:33 +0400 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/0967103c1b65 8017492: Static field in HTML parser affects all applications Reviewed-by: art ! src/share/classes/javax/swing/text/html/parser/ContentModel.java ! src/share/classes/javax/swing/text/html/parser/Element.java + test/javax/swing/text/html/parser/Test8017492.java Changeset: 15ea601e707a Author: lana Date: 2013-07-17 12:56 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/15ea601e707a Merge Changeset: f2558ef87d5a Author: lana Date: 2013-07-17 13:00 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/f2558ef87d5a Merge - src/share/classes/com/sun/org/apache/xml/internal/security/resource/log4j.properties - src/share/classes/com/sun/org/apache/xml/internal/security/transforms/implementations/FuncHereContext.java - src/share/classes/com/sun/org/apache/xml/internal/security/utils/CachedXPathAPIHolder.java - src/share/classes/com/sun/org/apache/xml/internal/security/utils/CachedXPathFuncHereAPI.java - src/share/classes/com/sun/org/apache/xml/internal/security/utils/XPathFuncHereAPI.java - src/share/classes/java/util/stream/StreamBuilder.java - src/share/classes/javax/security/auth/callback/package.html - src/share/classes/javax/security/auth/kerberos/package.html - src/share/classes/javax/security/auth/login/package.html - src/share/classes/javax/security/auth/package.html - src/share/classes/javax/security/auth/spi/package.html - src/share/classes/javax/security/auth/x500/package.html - src/share/classes/javax/security/cert/package.html - src/share/classes/javax/security/sasl/package.html - test/java/util/Collections/EmptySortedSet.java Changeset: 5be9c5bfcfe9 Author: lana Date: 2013-07-22 17:37 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/5be9c5bfcfe9 Merge - src/share/classes/com/sun/org/apache/xml/internal/security/resource/log4j.properties - src/share/classes/com/sun/org/apache/xml/internal/security/transforms/implementations/FuncHereContext.java - src/share/classes/com/sun/org/apache/xml/internal/security/utils/CachedXPathAPIHolder.java - src/share/classes/com/sun/org/apache/xml/internal/security/utils/CachedXPathFuncHereAPI.java - src/share/classes/com/sun/org/apache/xml/internal/security/utils/XPathFuncHereAPI.java - src/share/classes/java/util/stream/StreamBuilder.java - src/share/classes/javax/security/auth/callback/package.html - src/share/classes/javax/security/auth/kerberos/package.html - src/share/classes/javax/security/auth/login/package.html - src/share/classes/javax/security/auth/package.html - src/share/classes/javax/security/auth/spi/package.html - src/share/classes/javax/security/auth/x500/package.html - src/share/classes/javax/security/cert/package.html - src/share/classes/javax/security/sasl/package.html - test/java/util/Collections/EmptySortedSet.java Changeset: 690161232823 Author: cl Date: 2013-07-25 03:19 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/690161232823 Added tag jdk8-b100 for changeset 5be9c5bfcfe9 ! .hgtags Changeset: 25575c3c209d Author: lana Date: 2013-07-26 14:07 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/25575c3c209d Merge Changeset: 9f9ffe6be557 Author: lana Date: 2013-07-26 15:16 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/9f9ffe6be557 Merge From mike.duigou at oracle.com Fri Jul 26 23:09:48 2013 From: mike.duigou at oracle.com (Mike Duigou) Date: Fri, 26 Jul 2013 16:09:48 -0700 Subject: RFR: 8021588 : (s) Remove explicit othervm execution from jdk/test/Makefile Message-ID: Hello all; I heard word from Alan Bateman that the jdk/test/TEST.ROOT includes accurate specification of which tests cannot be run by JTReg in agentvm mode. ie. they require othervm mode. I tested out removing the duplicate othervm specification from the jdk/test/Makefile and everything still seems to run. http://cr.openjdk.java.net/~mduigou/JDK-8021588/0/webrev/ Removes othervm specifications from the test/Makefile and other resulting simplifications. This lets us further simplify the jdk/test/Makefile and removes needless duplication. Great! I've been playing with another change inspired by work done by Tim Bell. When running tests concurrently it helps to specify -XX+UseSerialGC to avoid over creation of GC threads for what are mostly short lived tests. Testing jdk_utils on my 24 core / 32GB dev box using serial GC provides about 5%-10% speedup and appears to reduce memory usage by 20% or more. Unfortunately there are a few tests in java.lang.manangement which explicitly request incompatible GC options. I haven't figured out yet how to allow these tests to override the -XX+UseSerialGC vmoption in a sane way. (I can think of several rude ways to do it). So for now, this change is commented out. Mike From brian.burkhalter at oracle.com Fri Jul 26 23:21:19 2013 From: brian.burkhalter at oracle.com (Brian Burkhalter) Date: Fri, 26 Jul 2013 16:21:19 -0700 Subject: Still need a review for Java 8 RFR 8014319: Faster division of large integers In-Reply-To: References: <481BC79A-5015-456B-BC9B-FAFBBC9ED3A4@oracle.com> Message-ID: <3D730007-2CB8-458D-8AE6-E794F2282411@oracle.com> On Jul 26, 2013, at 2:54 PM, Martin Buchholz wrote: > Reluctant math reviewer here. > > Looks good, Thanks! > except for apparently overzealous s/size/SIZE/g, as in > > - * a lot of numbers that will find failure points, such as max sized > + * a lot of numbers that will find failure points, such as max SIZEd Similar verbiage to my own: http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-July/019035.html It will be fixed in the 8020641 patch as noted. Brian > On Thu, Jul 25, 2013 at 11:55 AM, Brian Burkhalter wrote: > JDK 8 Reviewers: > > This patch is still pending approval by: > > http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-July/018922.html > > Thanks, > > Brian > From mike.duigou at oracle.com Fri Jul 26 23:31:17 2013 From: mike.duigou at oracle.com (Mike Duigou) Date: Fri, 26 Jul 2013 16:31:17 -0700 Subject: RFR: 8021591 : (s) Additional explicit null checks Message-ID: <17DBA593-2AD1-4E42-8DD1-790511B63B3F@oracle.com> Hello all; This patch adds some missing checks for null that, according to interface contract, should be throwing NPE. It also improves the existing tests to check for these cases. http://cr.openjdk.java.net/~mduigou/JDK-8021591/0/webrev/ The changes to src/share/classes/java/util/concurrent/ConcurrentHashMap.java will be synchronized separately with the jsr166 workspace. They are part of this review to avoid test failures. Mike From mike.duigou at oracle.com Sat Jul 27 00:06:54 2013 From: mike.duigou at oracle.com (Mike Duigou) Date: Fri, 26 Jul 2013 17:06:54 -0700 Subject: RFR: 8021601 : (xxs) Add unit test for PriorityQueue(Comparator) constructor Message-ID: <3DE346AE-1D1A-48C0-BA7A-4425ACDB947B@oracle.com> Hello all; JDK-6799426 (http://hg.openjdk.java.net/jdk8/tl/jdk/rev/a6cbb9808e4b) was pushed without a unit test. (Always recheck for unit tests when breathing life back into a stale old patch). A unit test is needed. This change adds an additional case to an existing test to exercise the new constructor. http://cr.openjdk.java.net/~mduigou/JDK-8021601/0/webrev/ I have also tweaked the constructor documentation per Paul Benedict's suggestion. Thanks, Mike From joe.darcy at oracle.com Sat Jul 27 00:15:49 2013 From: joe.darcy at oracle.com (Joseph Darcy) Date: Fri, 26 Jul 2013 17:15:49 -0700 Subject: RFR: 8021601 : (xxs) Add unit test for PriorityQueue(Comparator) constructor In-Reply-To: <3DE346AE-1D1A-48C0-BA7A-4425ACDB947B@oracle.com> References: <3DE346AE-1D1A-48C0-BA7A-4425ACDB947B@oracle.com> Message-ID: <51F31135.2030704@oracle.com> Looks good Mike; cheers, -Joe On 7/26/2013 5:06 PM, Mike Duigou wrote: > Hello all; > > JDK-6799426 (http://hg.openjdk.java.net/jdk8/tl/jdk/rev/a6cbb9808e4b) was pushed without a unit test. (Always recheck for unit tests when breathing life back into a stale old patch). A unit test is needed. This change adds an additional case to an existing test to exercise the new constructor. > > http://cr.openjdk.java.net/~mduigou/JDK-8021601/0/webrev/ > > I have also tweaked the constructor documentation per Paul Benedict's suggestion. > > Thanks, > > Mike From Alan.Bateman at oracle.com Sat Jul 27 00:21:09 2013 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Fri, 26 Jul 2013 17:21:09 -0700 Subject: RFR: 8021601 : (xxs) Add unit test for PriorityQueue(Comparator) constructor In-Reply-To: <3DE346AE-1D1A-48C0-BA7A-4425ACDB947B@oracle.com> References: <3DE346AE-1D1A-48C0-BA7A-4425ACDB947B@oracle.com> Message-ID: <51F31275.8000605@oracle.com> On 26/07/2013 17:06, Mike Duigou wrote: > Hello all; > > JDK-6799426 (http://hg.openjdk.java.net/jdk8/tl/jdk/rev/a6cbb9808e4b) was pushed without a unit test. (Always recheck for unit tests when breathing life back into a stale old patch). A unit test is needed. This change adds an additional case to an existing test to exercise the new constructor. > > http://cr.openjdk.java.net/~mduigou/JDK-8021601/0/webrev/ > > I have also tweaked the constructor documentation per Paul Benedict's suggestion. > Thanks for expanding the test, it looks good to me too. -Alan From mike.duigou at oracle.com Sat Jul 27 03:36:58 2013 From: mike.duigou at oracle.com (mike.duigou at oracle.com) Date: Sat, 27 Jul 2013 03:36:58 +0000 Subject: hg: jdk8/tl/jdk: 8021601: Add unit test for PriorityQueue(Comparator) constructor Message-ID: <20130727033742.27D2948411@hg.openjdk.java.net> Changeset: f056728871f8 Author: mduigou Date: 2013-07-26 17:23 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/f056728871f8 8021601: Add unit test for PriorityQueue(Comparator) constructor Reviewed-by: darcy, alanb ! src/share/classes/java/util/PriorityQueue.java ! test/java/util/PriorityQueue/RemoveContains.java From joe.darcy at oracle.com Sat Jul 27 04:26:02 2013 From: joe.darcy at oracle.com (Joe Darcy) Date: Fri, 26 Jul 2013 21:26:02 -0700 Subject: RFR JDK 8 : fix doclint warnings in generated nio code Message-ID: <51F34BDA.9070803@oracle.com> Hello, The generated nio code has some doclint issues; the patch below fixes them. The majority of the changes are replacing {@link #Foo plain old foo} with {@linkplain #Foo foo} Thanks, -Joe --- a/src/share/classes/java/nio/charset/Charset-X-Coder.java.template Thu Jul 25 20:03:20 2013 -0700 +++ b/src/share/classes/java/nio/charset/Charset-X-Coder.java.template Fri Jul 26 20:06:36 2013 -0700 @@ -41,7 +41,7 @@ * An engine that can transform a sequence of $itypesPhrase$ into a sequence of * $otypesPhrase$. * - * + * * *

                                                                    The input $itype$ sequence is provided in a $itype$ buffer or a series * of such buffers. The output $otype$ sequence is written to a $otype$ buffer @@ -76,22 +76,22 @@ * examine this object and fill the input buffer, flush the output buffer, or * attempt to recover from $a$ $coding$ error, as appropriate, and try again. * - * + * * *

                                                                    There are two general types of $coding$ errors. If the input $itype$ * sequence is $notLegal$ then the input is considered malformed. If * the input $itype$ sequence is legal but cannot be mapped to a valid * $outSequence$ then an unmappable character has been encountered. * - * + * * *

                                                                    How $a$ $coding$ error is handled depends upon the action requested for * that type of error, which is described by an instance of the {@link - * CodingErrorAction} class. The possible error actions are to {@link - * CodingErrorAction#IGNORE ignore} the erroneous input, {@link - * CodingErrorAction#REPORT report} the error to the invoker via - * the returned {@link CoderResult} object, or {@link CodingErrorAction#REPLACE - * replace} the erroneous input with the current value of the + * CodingErrorAction} class. The possible error actions are to {@linkplain + * CodingErrorAction#IGNORE ignore} the erroneous input, {@linkplain + * CodingErrorAction#REPORT report} the error to the invoker via + * the returned {@link CoderResult} object, or {@linkplain CodingErrorAction#REPLACE + * replace} the erroneous input with the current value of the * replacement $replTypeName$. The replacement * #if[encoder] @@ -106,7 +106,7 @@ * replaceWith} method. * *

                                                                    The default action for malformed-input and unmappable-character errors - * is to {@link CodingErrorAction#REPORT report} them. The + * is to {@linkplain CodingErrorAction#REPORT report} them. The * malformed-input error action may be changed via the {@link * #onMalformedInput(CodingErrorAction) onMalformedInput} method; the * unmappable-character action may be changed via the {@link @@ -177,7 +177,7 @@ * @param replacement * The initial replacement; must not be null, must have * non-zero length, must not be longer than max$ItypesPerOtype$, - * and must be {@link #isLegalReplacement legal} + * and must be {@linkplain #isLegalReplacement legal} * * @throws IllegalArgumentException * If the preconditions on the parameters do not hold @@ -276,7 +276,7 @@ * The new replacement; must not be null, must have * non-zero length, must not be longer than the value returned by * the {@link #max$ItypesPerOtype$() max$ItypesPerOtype$} method, and - * must be {@link #isLegalReplacement legal} + * must be {@link #isLegalReplacement legal} #end[encoder] * * @return This $coder$ @@ -495,24 +495,24 @@ * typically done by draining any $code$d $otype$s from the output * buffer.

                                                                    * - *
                                                                  • A {@link CoderResult#malformedForLength - * malformed-input} result indicates that a malformed-input + *

                                                                  • A {@linkplain CoderResult#malformedForLength + * malformed-input} result indicates that a malformed-input * error has been detected. The malformed $itype$s begin at the input * buffer's (possibly incremented) position; the number of malformed * $itype$s may be determined by invoking the result object's {@link * CoderResult#length() length} method. This case applies only if the - * {@link #onMalformedInput malformed action} of this $coder$ + * {@linkplain #onMalformedInput malformed action} of this $coder$ * is {@link CodingErrorAction#REPORT}; otherwise the malformed input * will be ignored or replaced, as requested.

                                                                  • * - *
                                                                  • An {@link CoderResult#unmappableForLength - * unmappable-character} result indicates that an + *

                                                                  • An {@linkplain CoderResult#unmappableForLength + * unmappable-character} result indicates that an * unmappable-character error has been detected. The $itype$s that * $code$ the unmappable character begin at the input buffer's (possibly * incremented) position; the number of such $itype$s may be determined * by invoking the result object's {@link CoderResult#length() length} - * method. This case applies only if the {@link #onUnmappableCharacter - * unmappable action} of this $coder$ is {@link + * method. This case applies only if the {@linkplain #onUnmappableCharacter + * unmappable action} of this $coder$ is {@link * CodingErrorAction#REPORT}; otherwise the unmappable character will be * ignored or replaced, as requested.

                                                                  • * From Alan.Bateman at oracle.com Sat Jul 27 05:46:27 2013 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Fri, 26 Jul 2013 22:46:27 -0700 Subject: RFR JDK 8 : fix doclint warnings in generated nio code In-Reply-To: <51F34BDA.9070803@oracle.com> References: <51F34BDA.9070803@oracle.com> Message-ID: <51F35EB3.7080908@oracle.com> On 26/07/2013 21:26, Joe Darcy wrote: > Hello, > > The generated nio code has some doclint issues; the patch below fixes > them. > > The majority of the changes are replacing > > {@link #Foo plain old foo} > > with > > {@linkplain #Foo foo} > > Thanks, > > -Joe Looks fine to me. -Alan From alan.bateman at oracle.com Sat Jul 27 15:45:00 2013 From: alan.bateman at oracle.com (alan.bateman at oracle.com) Date: Sat, 27 Jul 2013 15:45:00 +0000 Subject: hg: jdk8/tl/jdk: 8014319: Faster division of large integers Message-ID: <20130727154550.747C748417@hg.openjdk.java.net> Changeset: d4b2436892c8 Author: bpb Date: 2013-07-26 17:03 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/d4b2436892c8 8014319: Faster division of large integers Summary: Implement Burnickel-Ziegler division algorithm in BigInteger Reviewed-by: bpb, martin Contributed-by: Tim Buktu ! src/share/classes/java/math/BigInteger.java ! src/share/classes/java/math/MutableBigInteger.java ! test/java/math/BigInteger/BigIntegerTest.java From alan.bateman at oracle.com Sat Jul 27 15:47:44 2013 From: alan.bateman at oracle.com (alan.bateman at oracle.com) Date: Sat, 27 Jul 2013 15:47:44 +0000 Subject: hg: jdk8/tl/jdk: 8020641: Clean up some code style in recent BigInteger contributions Message-ID: <20130727154756.2893548418@hg.openjdk.java.net> Changeset: a1c01457cf6c Author: bpb Date: 2013-07-26 17:09 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/a1c01457cf6c 8020641: Clean up some code style in recent BigInteger contributions Summary: Some minor cleanup to adhere better to Java coding conventions. Reviewed-by: darcy Contributed-by: Brian Burkhalter ! src/share/classes/java/math/BigInteger.java ! src/share/classes/java/math/MutableBigInteger.java ! test/java/math/BigInteger/BigIntegerTest.java From joe.darcy at oracle.com Sat Jul 27 17:27:22 2013 From: joe.darcy at oracle.com (joe.darcy at oracle.com) Date: Sat, 27 Jul 2013 17:27:22 +0000 Subject: hg: jdk8/tl/jdk: 8021609: Fix doclint issues in java.nio.charset Message-ID: <20130727172747.319F64841B@hg.openjdk.java.net> Changeset: eb1dc65162e8 Author: darcy Date: 2013-07-27 10:27 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/eb1dc65162e8 8021609: Fix doclint issues in java.nio.charset Reviewed-by: alanb ! src/share/classes/java/nio/charset/Charset-X-Coder.java.template From Alan.Bateman at oracle.com Sat Jul 27 17:41:34 2013 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Sat, 27 Jul 2013 10:41:34 -0700 Subject: RFR: 8021588 : (s) Remove explicit othervm execution from jdk/test/Makefile In-Reply-To: References: Message-ID: <51F4064E.6080201@oracle.com> On 26/07/2013 16:09, Mike Duigou wrote: > Hello all; > > I heard word from Alan Bateman that the jdk/test/TEST.ROOT includes accurate specification of which tests cannot be run by JTReg in agentvm mode. ie. they require othervm mode. Yes although it's actually somewhat distributed because it can be overridden by specific tests (in the @run tag) and we also have a few TEST.properties in the tree that override it too. The main thing is that it's in the test suite so anyone can run jtreg -agentvm and the tests will run in right mode. > I tested out removing the duplicate othervm specification from the jdk/test/Makefile and everything still seems to run. > > http://cr.openjdk.java.net/~mduigou/JDK-8021588/0/webrev/ > > Removes othervm specifications from the test/Makefile and other resulting simplifications. > > This lets us further simplify the jdk/test/Makefile and removes needless duplication. Great! > > I've been playing with another change inspired by work done by Tim Bell. When running tests concurrently it helps to specify -XX+UseSerialGC to avoid over creation of GC threads for what are mostly short lived tests. Testing jdk_utils on my 24 core / 32GB dev box using serial GC provides about 5%-10% speedup and appears to reduce memory usage by 20% or more. Unfortunately there are a few tests in java.lang.manangement which explicitly request incompatible GC options. I haven't figured out yet how to allow these tests to override the -XX+UseSerialGC vmoption in a sane way. (I can think of several rude ways to do it). So for now, this change is commented out. > The changes in the webrev look good to me. It's good to finally remove some of the logic and I think a lot more can be removed over time too (in particularly the mapping of test targets to directories which really needs to be checked into the test suite as group definitions) and the exclude list handling as the ProblemList should be specified to jtreg via -exclude without any processing in the make file. I think the issue of conflicting GC options has come up on the hotspot list a few times too. This may be a case where there needs to be a way to run a test in othervm mode in a way that doesn't pick up the vmoptions. -Alan From nicholas+openjdk at nicholaswilliams.net Sat Jul 27 19:01:30 2013 From: nicholas+openjdk at nicholaswilliams.net (Nick Williams) Date: Sat, 27 Jul 2013 14:01:30 -0500 Subject: Classes on the stack trace (was: getElementClass/StackTraceElement, was: @CallerSensitive public API, was: sun.reflect.Reflection.getCallerClass) Message-ID: All, In the last two months, there have been a number of discussions surrounding stack traces, Classes on the stack trace, and caller classes [1], [2], [3]. These are all related discussions and the solution to them is equally related, so I wanted to consolidate it all into this one discussion where I hope we can finalize on a solution and get it implemented for Java 8. In a nut shell, here are the underlying needs that I have seen expressed through many, many messages: - Some code needs to get the Class of the caller of the current method, skipping any reflection methods. - Some code needs to get the Class of the caller /n/ stack frames before the current method, skipping any reflection methods. - Some code needs to get the current stack trace, populated with Classes, Executables, file names, line numbers, and native flags instead of the String class names and String method names in StackTraceElement. This /should/ include any reflection methods, just like StackTraceElement[]s. - Some code needs to get the stack trace from when a Throwable was created, populated with Classes, Executables, file names, line numbers, and native flags instead of the String class names and String method names in StackTraceElement. This /should/ include any reflection methods, just like StackTraceElement[]s. - There needs to be a reflection way to achieve all of this since some libraries (e.g., Log4j) need to be compiled against Java 6 but run on 7 and 8 (and thus can't use @CallerSensitive). I believe the solutions to these needs are all related. Importantly, I think it is very important that action be taken in Java 8 due to the changes made to sun.reflect.Reflection#getCallerClass(...). While we all understand that relying on private sun.* APIs is not safe, the fact is that many people have relied on sun.reflect.Reflection#getCallerClass(...) due to the fact that there is simply no other way to do this in the standard API. This includes Log4j 2, Logback, SLF4j, and Groovy, some features of which will stop working correctly in Java 7 >= u25. I would point out that this could all easily be solved simply by adding a getElementClass() method to StackTraceElement, but there was strong opposition to this, largely due to serialization issues. Since that is apparently not an option, I propose the following API, based on the various discussions in the last two months, StackTraceElement, and the API that .NET provides to achieve the same needs as listed above: CallerSensitive.java: package java.lang; /** Previously private API, now public */ public @interface CallerSensitive { ... } StackTraceFrame.java: package java.lang; import java.util.Objects. public final class StackTraceFrame { private final Class declaringClass; private final Executable executable; private final String fileName; private final int lineNumber; public StackTraceFrame(Class declaringClass, Executable executable, String fileName, int lineNumber) { this.declaringClass = Objects.requireNonNull(declaringClass, "Declaring class is null"); this.executable = Objects.requireNonNull(executable, "Executable is null"); this.fileName = fileName; this.lineNumber = lineNumber; } public Class getDeclaringClass() { return this.declaringClass; } public Executable getExecutable() { return this.executable; } public String getFileName() { return this.fileName; } public int getLineNumber() { return this.lineNumber; } public boolean isNative() { return this.lineNumber == -2; } public String toString() { /* Same as StackTraceElement */ } public boolean equals() { /* Ditto */ } public int hashCode() { /* Ditto */ } /** Uses @CallerSensitive */ public static native StackTraceFrame getCallerFrame(); /** Works like Java < 7u25 sun.reflect.Reflection#getCallerClass() */ public static native StackTraceFrame getCallerFrame(int skipFrames); public static native StackTraceFrame[] getCurrentStackTrace(); } Throwable.java: package java.lang; ... public class Throwable { ... public synchronized Throwable fillInStackTraceFrames() { ... } private native Throwable fillInStackTraceFrames(int dummy); public StackTraceFrame[] getStackTraceFrames() { return this.getOurStackTraceFrames().clone(); } private synchronized StackTraceFrame[] getOurStackTraceFrames() { ... } ... } Furthermore, I propose that we restore the behavior of sun.reflect.Reflection#getCallerClass(int) /just for Java 7/ since the proposed above solution cannot be added to Java 7. I would love if we could quickly coalesce around this solution or a derivative thereof so that it can be implemented before Feature Complete. The absence of any replacement or alternative for sun.reflect.Reflection#getCallerClass(int) will be a serious issue in Java 8 that will cause hardships for many projects. [1] http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-June/018049.html [2] http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-June/018349.html, http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-July/019098.html [3] http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-July/018855.html From Alan.Bateman at oracle.com Sat Jul 27 19:24:15 2013 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Sat, 27 Jul 2013 12:24:15 -0700 Subject: 8016036: RMI specification needs to be updated to allow Activation on remote hosts In-Reply-To: <51DE3146.2000908@oracle.com> References: <51DE3146.2000908@oracle.com> Message-ID: <51F41E5F.6030407@oracle.com> On 10/07/2013 21:15, Stephen Flores wrote: > Bob, Sean, > > Please review this webrev > > http://cr.openjdk.java.net/~sflores/8016036/webrev.00/ > > for RFE/CCC: 8016036 RMI specification needs to be updated to allow > Activation on remote hosts I didn't see any replies to this but I chatted briefly with Stuart Marks about this a few days ago as it's not clear (to me anyway) that this is the right thing to do. In particular it would be good to understand why the specification can't be changed to allow for environments that doesn't support multiple VM instances or where it's not possible to launch a new VM. This would amount to not supporting activation in such environments. Has this approach been explored? It could of course require being creative in the specifications but there are other examples of this type of thing. -Alan From mike.duigou at oracle.com Sat Jul 27 21:24:24 2013 From: mike.duigou at oracle.com (mike.duigou at oracle.com) Date: Sat, 27 Jul 2013 21:24:24 +0000 Subject: hg: jdk8/tl/jdk: 8021588: Remove explicit othervm execution from jdk/test/Makefile Message-ID: <20130727212448.DF2464841E@hg.openjdk.java.net> Changeset: 5d4a35823071 Author: mduigou Date: 2013-07-27 12:26 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/5d4a35823071 8021588: Remove explicit othervm execution from jdk/test/Makefile Reviewed-by: alanb ! test/Makefile From Alan.Bateman at oracle.com Sun Jul 28 17:40:07 2013 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Sun, 28 Jul 2013 10:40:07 -0700 Subject: Review request: JDK-8021245 (process) file leak in jdk/src/windows/native/java/lang/ProcessImpl_md.c In-Reply-To: <51F296CF.2050902@oracle.com> References: <51F296CF.2050902@oracle.com> Message-ID: <51F55777.5050404@oracle.com> On 26/07/2013 08:33, Alexey Utkin wrote: > Bug description: > https://jbs.oracle.com/bugs/browse/JDK-8021245 > http://bugs.sun.com/view_bug.do?bug_id=8021245 > > Here is the suggested fix: > http://cr.openjdk.java.net/~uta/openjdk-webrevs/JDK-8021245/webrev.00/ > > Summary: > In accordance with MS spec [-1] is THE ONLY error signal from the > [_open] function call. > http://msdn.microsoft.com/en-us/library/z0kc8e3z.aspx > Any negative, except [-1], and zero are the valid handles that need to > be closed. > > The fix was tested in the debugger my manual switching to Win9x/WinMe > brunch of execution. Checking if _open returns -1 and checking the return from _read and _lseek/_read looks okay to me. My only comment is that the "if (" on its own looks a bit odd, I just I would at least hoist the first part of the expression onto the same line. -Alan. From Alan.Bateman at oracle.com Sun Jul 28 21:18:17 2013 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Sun, 28 Jul 2013 14:18:17 -0700 Subject: Request for Review: 5049299: (process) Use posix_spawn, not fork, on S10 to avoid swap exhaustion In-Reply-To: <51F14F85.1010601@oracle.com> References: <50AE98B1.2040200@oracle.com> <50B81A8D.2040403@oracle.com> <50B82C94.90109@oracle.com> <50D277BE.8060705@oracle.com> <50D65C3F.2040004@oracle.com> <51D2F496.6050400@oracle.com> <51D57B88.3050707@oracle.com> <51D674B5.7020100@oracle.com> <51F14F85.1010601@oracle.com> Message-ID: <51F58A99.8050402@oracle.com> On 25/07/2013 09:17, Rob McKenna wrote: > Thanks a lot Erik, > > I've added the dependency to the makefile here: > > http://cr.openjdk.java.net/~robm/5049299/webrev.05/ > > > Is it ok between the ifeq block? > > Alan, > > I've altered the launchMechanism code to use valueOf (and lower case > names) - much cleaner, thanks for that. I've also limited each > platform to supported mechanisms only. With the new layout I don't > believe a separate test is needed here. (the default is now > posix_spawn/vfork and Basic.java has been altered to run with fork too) > > -Rob Thanks Rob, I've taken another pass over the latest webrev and I think the finish line is close. The launchMechanism determination is much cleaner now (thanks). For consistency the enum values should probably be in uppercase and so this means you'll need to uppercase the property value to use valueOf. It would be nice if launchMechanism were final too (which you do by having the privileged action be of type LaunchMechanism rather than Void). The comment in UNIXProcess.java.bsd references vfork/exec which I assume is copied from the Linux version and should be removed. Did you consider having forkAndExec take the helper as a parameter? Just wonder if this would be cleaner than having to use JNI to grab the field value. It's usually best to use sprintnf rather than sprintf (in spawnChild) to avoid any concerns (or static analysis tools) that wonder about buffer overflow. Style nit in the C code is that many places have spurious space between the function name and the parentheses. A pre-existing bug (only noticed because it has moved from UNIXProcess_md.c to childproc.c) is that close is not restartable. The comment in in makefiles/CompileLauncher.gmk references the old build, is that needed? So overall I don't see any issues, it would be really good to stress this to make sure that we aren't leaking file descriptors. I don't know if we have an existing test that would help with that. One final comment is that the new files seems to have the pure GPL comment, I assume you will add the GPL+ Classpath Exception comment before you push this. -Alan. From ivan.gerasimov at oracle.com Sun Jul 28 22:08:58 2013 From: ivan.gerasimov at oracle.com (Ivan Gerasimov) Date: Mon, 29 Jul 2013 02:08:58 +0400 Subject: RFR [8020669] java.nio.file.Files.readAllBytes() does not read any data when Files.size() is 0 In-Reply-To: <51F200F1.8010500@oracle.com> References: <51E97416.20506@oracle.com> <51E98043.6030102@oracle.com> <51E9853E.8020409@redhat.com> <51E985AD.60401@redhat.com> <51EB0BFF.3030106@oracle.com> <51ED57D8.90001@oracle.com> <51EE55AC.5000902@oracle.com> <51EE8E9A.6040806@redhat.com> <51EF1B43.9030200@oracle.com> <51F06789.1050403@oracle.com> <51F12B3E.4010603@oracle.com> <51F1BB22.6040405@oracle.com> <51F200F1.8010500@oracle.com> Message-ID: <51F5967A.6060705@oracle.com> Hello Alan and everyone else Thank you for review! Here's another version of webrev: http://cr.openjdk.java.net/~igerasim/8020669/5/webrev/ The comments are inline. On 26.07.2013 8:54, Alan Bateman wrote: > On 25/07/2013 16:56, Ivan Gerasimov wrote: >> >> Would you please help review an updated webrev? >> http://cr.openjdk.java.net/~igerasim/8020669/4/webrev/ > Sorry for the late response to your mails on this, I was on vacation. > > As you have found, in the original implementation we allowed for > resizing (truncation or extending) while the file was open but when it > was optimized to avoid an unnecessary resize of the array then we lost > the ability to deal with extending case (which is the essentially the > same as when the size is reported is less than the actual size). > > Reverting to the original implementation and doing a single read to > double check for EOF seems reasonable. > > My only real comment on the latest webrev (4) is that the computation > of the new capacity is not obvious to the reader (and since this is > the uncommon case then it doesn't need to be super-optimized). So I > think it would be a lot clearer if "newCapacity" were re-introduced > and then computed to a value that is a minimum of capacity+2, maximum > of capacity+BUFFER_SIZE (with OOME handling when newCapacity is > greater than MAX_BUFFER_SIZE). I think that would be clearer than > re-using the remaining count (rem). OK. I simplified it once again. Now the new capacity is set to one of {BUFFER_SIZE, 2 * old capacity, MAX_BUFFER_SIZE}, whatever is appropriate. I think that doubling the capacity is better than increasing it by BUFFER_SIZE, since this will allow to allocate needed buffer in less number of iterations. > > A minor comment is that the input stream is named "fis" but probably > should be "in" as it is not a FileInputStream (I see David Llyod > suggested using a FileInputStream but the path may be to a file in a > custom file system so it can't be a FileInputStream). > Renamed. > I see you've changed the javadoc from "Read" to "Reads" on several > methods. I don't know if you meant to include this in the webrev but > personally prefer "Read". > Files.java has mixed style. Most methods are documented with "Does" form, but some have "Do". I left "Reads" on the methods I modify for consistency, but reverted changes from other places as I'm not going to change all the occurrences in this webrev. > Thanks for moving the test to BytesAndLines as that is the test for > these methods. One suggestion is to move the new test for readAllBytes > into testReadAndWriteBytes and the new test for readAllLines into > testReadLines. It doesn't matter of course, it just keeps them together. > Sure, done. Sincerely yours, Ivan > -Alan. From Alan.Bateman at oracle.com Sun Jul 28 22:32:58 2013 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Sun, 28 Jul 2013 15:32:58 -0700 Subject: Review request: JDK-7147084 (process) appA hangs when read output stream of appB which starts appC that runs forever (v.1) In-Reply-To: <51DE74D1.70607@oracle.com> References: <518A88B1.3060105@oracle.com> <5190FC54.8050808@oracle.com> <5194B0D8.2040607@oracle.com> <51D685E1.1080606@oracle.com> <51D6D139.40508@oracle.com> <51DE74D1.70607@oracle.com> Message-ID: <51F59C1A.4070602@oracle.com> On 11/07/2013 02:03, Alexey Utkin wrote: > : > > Bug description: > https://jbs.oracle.com/bugs/browse/JDK-7147084 > http://bugs.sun.com/view_bug.do?bug_id=7147084 > > Here is the suggested fix: > http://cr.openjdk.java.net/~uta/openjdk-webrevs/JDK-7147084/webrev.01/ > > Summary for v1 changes: > > -- The set of handles that need to restore the inherit flag was extended > by child process IOE handles. That was done to avoid "greedy sibling" > problem for the file handles. The file handles are closed outside the > synchronized block. > -- "Greedy sibling" problem is covered by the > [test/java/lang/ProcessBuilder/SiblingIOEHandle.java] test. > -- The fact that the set of current process standard IOE handles and the > set of child process IOE handles can intersect was taken into account. > -- The [test/java/lang/ProcessBuilder/InheritIOEHandle.java] was changed > in accordance with Martin's concern. > I've done a first pass over this. This is a long standing issue so a big thank you for taking this on. It's unfortunate that this requires serializing the exec but based on the various Microsoft articles that you cited when researching this one then it seems that this is what we have to do. Overall I don't see any issues. It's nice to have the create function broken up into smaller functions. I do think the new code needs several comments, particularly initHolder and the constants. One concern with the tests is that 10 seconds might not be sufficient on a slow/busy machine or a Windows machine that is being choked by AV software. Could this be changed so that it just getting timed by the test harness if the child does not terminate? I'm also wondering about waitAbit and whether this is useful. -Alan. From Alan.Bateman at oracle.com Sun Jul 28 23:43:26 2013 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Sun, 28 Jul 2013 16:43:26 -0700 Subject: RFR [8020669] java.nio.file.Files.readAllBytes() does not read any data when Files.size() is 0 In-Reply-To: <51F5967A.6060705@oracle.com> References: <51E97416.20506@oracle.com> <51E98043.6030102@oracle.com> <51E9853E.8020409@redhat.com> <51E985AD.60401@redhat.com> <51EB0BFF.3030106@oracle.com> <51ED57D8.90001@oracle.com> <51EE55AC.5000902@oracle.com> <51EE8E9A.6040806@redhat.com> <51EF1B43.9030200@oracle.com> <51F06789.1050403@oracle.com> <51F12B3E.4010603@oracle.com> <51F1BB22.6040405@oracle.com> <51F200F1.8010500@oracle.com> <51F5967A.6060705@oracle.com> Message-ID: <51F5AC9E.1010505@oracle.com> On 28/07/2013 15:08, Ivan Gerasimov wrote: > Hello Alan and everyone else > > Thank you for review! > > Here's another version of webrev: > http://cr.openjdk.java.net/~igerasim/8020669/5/webrev/ > Thanks for the updated the webrev, the expansion of the capacity is much nicer now. As regards whether to double or increase by BUFFER_SIZE then it's probably a coin toss. One could come up with cases where someone is using this method on a file that is extended by another entity. It would depend on the extend rate as to which approach would be more efficient (clearly such cases are going to be problematic as file locking should be used to coordinate the access). As regards the comment on "Reads" vs "Read", that was more just I've wasn't sure if you had intended to include this or not. So I'm happy to sponsor this for you (assuming we are done). -Alan. From david.holmes at oracle.com Mon Jul 29 02:18:06 2013 From: david.holmes at oracle.com (David Holmes) Date: Mon, 29 Jul 2013 12:18:06 +1000 Subject: RFR: 8021588 : (s) Remove explicit othervm execution from jdk/test/Makefile In-Reply-To: References: Message-ID: <51F5D0DE.9040503@oracle.com> On 27/07/2013 9:09 AM, Mike Duigou wrote: > Hello all; > > I heard word from Alan Bateman that the jdk/test/TEST.ROOT includes accurate specification of which tests cannot be run by JTReg in agentvm mode. ie. they require othervm mode. I tested out removing the duplicate othervm specification from the jdk/test/Makefile and everything still seems to run. > > http://cr.openjdk.java.net/~mduigou/JDK-8021588/0/webrev/ > > Removes othervm specifications from the test/Makefile and other resulting simplifications. > > This lets us further simplify the jdk/test/Makefile and removes needless duplication. Great! > > I've been playing with another change inspired by work done by Tim Bell. When running tests concurrently it helps to specify -XX+UseSerialGC to avoid over creation of GC threads for what are mostly short lived tests. Testing jdk_utils on my 24 core / 32GB dev box using serial GC provides about 5%-10% speedup and appears to reduce memory usage by 20% or more. Unfortunately there are a few tests in java.lang.manangement which explicitly request incompatible GC options. I haven't figured out yet how to allow these tests to override the -XX+UseSerialGC vmoption in a sane way. (I can think of several rude ways to do it). So for now, this change is commented out. Not sure that forcing use of SerialGC is good for general testing/test-coverage. The conflicting gc options is a known but as yet unresolved issue. David > Mike > From david.holmes at oracle.com Mon Jul 29 05:13:38 2013 From: david.holmes at oracle.com (David Holmes) Date: Mon, 29 Jul 2013 15:13:38 +1000 Subject: Java 8 RFR 8011194: Apps launched via double-clicked .jars have file.encoding value of US-ASCII on Mac OS X In-Reply-To: <51F2B781.1050104@oracle.com> References: <51F2B781.1050104@oracle.com> Message-ID: <51F5FA02.9020909@oracle.com> On 27/07/2013 3:53 AM, Brent Christian wrote: > Please review my fix for 8011194 : "Apps launched via double-clicked > .jars have file.encoding value of US-ASCII on Mac OS X" > > http://bugs.sun.com/view_bug.do?bug_id=8011194 > > In most cases of launching a Java app on Mac (from the cmdline, or from > a native .app bundle), reading and displaying UTF-8 characters beyond > the standard ASCII range works fine. > > A notable exception is the launching of an app by double-clicking a .jar > file. In this case, file.encoding defaults to US-ASCII, and characters > outside of the ASCII range show up as garbage. Why does this occur? What sets the encoding to US-ASCII? David ----- > (FWIW, this is not recommended by Apple as a method for deploying Java > apps [1], though OS X does have a Jar Launcher.app to make it work.) > > It's worth mentioning that this is not something that has ever worked on > MacOS X. (Apple's JRE defaulted to "MacRoman" for English and AFAIK most > European locales. I believe this is a holdover from the pre-OS X days). > > Even so, the situation can be improved. When launching, if the standard > encoding comes up as US-ASCII, but there are no hints from the > environment (e.g. LANG/etc environment variables), it would be sane to > instead use UTF-8 as the default encoding on MacOS X. An explicit > file.encoding setting by the user is still honored (and can even be set > back to US-ASCII). > > I believe this also fixes the related issue with webstart [2]. > > Webrev is here: > http://cr.openjdk.java.net/~bchristi/8011194/webrev.00/ > > Thanks, > -Brent > > [1] > http://developer.apple.com/library/mac/#documentation/Java/Conceptual/Java14Development/03-JavaDeployment/JavaDeployment.html > > [2] http://bugs.sun.com/view_bug.do?bug_id=8011195 > From sundararajan.athijegannathan at oracle.com Mon Jul 29 06:30:34 2013 From: sundararajan.athijegannathan at oracle.com (sundararajan.athijegannathan at oracle.com) Date: Mon, 29 Jul 2013 06:30:34 +0000 Subject: hg: jdk8/tl/nashorn: 4 new changesets Message-ID: <20130729063038.3ACD648438@hg.openjdk.java.net> Changeset: f6588f168d79 Author: hannesw Date: 2013-07-26 13:50 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/f6588f168d79 8020719: Run tests with reduced splitter threshold Reviewed-by: lagergren, sundar, jlaskey ! make/build.xml ! make/project.properties + test/script/basic/NASHORN-592-dual.js + test/script/basic/NASHORN-592-dual.js.EXPECTED + test/script/basic/compile-octane-splitter.js + test/script/basic/compile-octane-splitter.js.EXPECTED + test/script/basic/splitter.js + test/script/basic/splitter.js.EXPECTED - test/script/representations/NASHORN-592a.js ! test/src/jdk/nashorn/internal/test/framework/AbstractScriptRunnable.java ! test/src/jdk/nashorn/internal/test/framework/ScriptRunnable.java ! test/src/jdk/nashorn/internal/test/framework/TestConfig.java ! test/src/jdk/nashorn/internal/test/framework/TestFinder.java Changeset: 17a947418e65 Author: jlaskey Date: 2013-07-26 09:17 -0300 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/17a947418e65 8021321: Two runsunspider tests fail after updating sunspider to 1.0 Reviewed-by: jlaskey, sundar Contributed-by: michael.horowitz at oracle.com ! test/script/basic/runsunspider.js Changeset: fbd21b00197b Author: sundar Date: 2013-07-26 20:10 +0530 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/fbd21b00197b 8021571: @fork tests should use VM options passed from project.properties Reviewed-by: lagergren, hannesw, jlaskey ! buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ClassGenerator.java ! buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ConstructorGenerator.java ! buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/PrototypeGenerator.java ! make/project.properties ! src/jdk/nashorn/internal/objects/BoundScriptFunctionImpl.java ! src/jdk/nashorn/internal/objects/PrototypeObject.java ! src/jdk/nashorn/internal/runtime/AccessorProperty.java ! src/jdk/nashorn/internal/runtime/FinalScriptFunctionData.java ! src/jdk/nashorn/internal/runtime/ListAdapter.java ! src/jdk/nashorn/internal/runtime/Property.java ! src/jdk/nashorn/internal/runtime/PropertyListenerManager.java ! src/jdk/nashorn/internal/runtime/ScriptFunctionData.java ! src/jdk/nashorn/internal/runtime/UserAccessorProperty.java ! src/jdk/nashorn/internal/runtime/WithObject.java ! src/jdk/nashorn/internal/runtime/linker/AdaptationException.java ! src/jdk/nashorn/internal/runtime/linker/AdaptationResult.java ! src/jdk/nashorn/internal/runtime/linker/InvokeByName.java ! src/jdk/nashorn/internal/runtime/linker/JavaAdapterBytecodeGenerator.java ! src/jdk/nashorn/internal/runtime/linker/JavaAdapterServices.java ! src/jdk/nashorn/internal/runtime/linker/JavaArgumentConverters.java ! src/jdk/nashorn/internal/runtime/linker/NashornCallSiteDescriptor.java ! src/jdk/nashorn/internal/runtime/linker/NashornLinker.java ! src/jdk/nashorn/internal/runtime/linker/PrimitiveLookup.java ! src/jdk/nashorn/internal/runtime/options/KeyValueOption.java ! src/jdk/nashorn/internal/runtime/options/OptionTemplate.java ! test/src/jdk/nashorn/internal/test/framework/AbstractScriptRunnable.java ! test/src/jdk/nashorn/internal/test/framework/ScriptRunnable.java ! test/src/jdk/nashorn/internal/test/framework/TestConfig.java Changeset: 5fc6b7f11289 Author: sundar Date: 2013-07-29 10:28 +0530 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/5fc6b7f11289 Merge - test/script/representations/NASHORN-592a.js From joe.darcy at oracle.com Mon Jul 29 07:05:14 2013 From: joe.darcy at oracle.com (Joe Darcy) Date: Mon, 29 Jul 2013 00:05:14 -0700 Subject: Java 8 RFR 8020539: Clean up doclint problems in java.util package, part 2 In-Reply-To: <67232DB5-4077-4A4D-9729-B06C7FD911BF@oracle.com> References: <50FE640E-DC42-47F2-9FAD-8472A013EB9B@oracle.com> <51E77802.8070001@oracle.com> <67232DB5-4077-4A4D-9729-B06C7FD911BF@oracle.com> Message-ID: <51F6142A.2080201@oracle.com> On 07/18/2013 02:19 PM, Brian Burkhalter wrote: > On Jul 17, 2013, at 10:07 PM, Joe Darcy wrote: > >> In Random.java, I would prefer if the size manipulation of the exponent was removed instead of >> >> 373 * All 224 possible {@code float} values >> >> just >> >> 373 * All 224 possible {@code float} values. > Done. > >> Also, I think the changes in Scanner would be better of the JLS-style grammar syntax was used, which is what is done in places like java.lang.*. From memory, >> >> NonTerminal: >> First Option of the production >> Second Options of the production > Changes made but I'm not sure that they are exactly as expected: > > http://cr.openjdk.java.net/~bpb/Scanner.html I recommend a few changes here: * For readability, rename "NonASCIIDigit" as "NonAsciiDigit" * Since Scanner is in the regex package, it may be more appropriate to stick more of a regex notation than an ebnf notation, but keeping the definition list structure tags. > >> Offhand, I wasn't aware Dequeue and Queue were maintained in Doug's CVS, but I agree changes to those files should flow through there first. > Deque and Queue removed from the webrev: > > http://cr.openjdk.java.net/~bpb/8020539/ > Otherwise, the changes look fine. If you like, the non-Scanner changes can be split out and pushed first. Thanks, -Joe From sundararajan.athijegannathan at oracle.com Mon Jul 29 08:03:55 2013 From: sundararajan.athijegannathan at oracle.com (A. Sundararajan) Date: Mon, 29 Jul 2013 13:33:55 +0530 Subject: Review request for 8021773: print function as defined by jrunscript's init.js script is incompatible with nashorn's definition Message-ID: <51F621EB.1070401@oracle.com> Bug: 8021773: print function as defined by jrunscript's init.js script is incompatible with nashorn's definition Please review http://cr.openjdk.java.net/~sundar/8021773/ Thanks -Sundar From ivan.gerasimov at oracle.com Mon Jul 29 08:48:54 2013 From: ivan.gerasimov at oracle.com (Ivan Gerasimov) Date: Mon, 29 Jul 2013 12:48:54 +0400 Subject: RFR [8020669] java.nio.file.Files.readAllBytes() does not read any data when Files.size() is 0 In-Reply-To: <51F5AC9E.1010505@oracle.com> References: <51E97416.20506@oracle.com> <51E98043.6030102@oracle.com> <51E9853E.8020409@redhat.com> <51E985AD.60401@redhat.com> <51EB0BFF.3030106@oracle.com> <51ED57D8.90001@oracle.com> <51EE55AC.5000902@oracle.com> <51EE8E9A.6040806@redhat.com> <51EF1B43.9030200@oracle.com> <51F06789.1050403@oracle.com> <51F12B3E.4010603@oracle.com> <51F1BB22.6040405@oracle.com> <51F200F1.8010500@oracle.com> <51F5967A.6060705@oracle.com> <51F5AC9E.1010505@oracle.com> Message-ID: <51F62C76.7030401@oracle.com> Thank you, Alan. I really appreciate it. Here's the mercurial export: http://cr.openjdk.java.net/~igerasim/2commit/8020669-jdk8-readAllBytes.patch Sincerely yours, Ivan On 29.07.2013 3:43, Alan Bateman wrote: > On 28/07/2013 15:08, Ivan Gerasimov wrote: >> Hello Alan and everyone else >> >> Thank you for review! >> >> Here's another version of webrev: >> http://cr.openjdk.java.net/~igerasim/8020669/5/webrev/ >> > Thanks for the updated the webrev, the expansion of the capacity is > much nicer now. As regards whether to double or increase by > BUFFER_SIZE then it's probably a coin toss. One could come up with > cases where someone is using this method on a file that is extended by > another entity. It would depend on the extend rate as to which > approach would be more efficient (clearly such cases are going to be > problematic as file locking should be used to coordinate the access). > > As regards the comment on "Reads" vs "Read", that was more just I've > wasn't sure if you had intended to include this or not. > > So I'm happy to sponsor this for you (assuming we are done). > > -Alan. From chris.hegarty at oracle.com Mon Jul 29 09:43:35 2013 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Mon, 29 Jul 2013 10:43:35 +0100 Subject: Java 8 RFR 8020539: Clean up doclint problems in java.util package, part 2 In-Reply-To: <51F6142A.2080201@oracle.com> References: <50FE640E-DC42-47F2-9FAD-8472A013EB9B@oracle.com> <51E77802.8070001@oracle.com> <67232DB5-4077-4A4D-9729-B06C7FD911BF@oracle.com> <51F6142A.2080201@oracle.com> Message-ID: <51F63947.9010908@oracle.com> > ..... >> http://cr.openjdk.java.net/~bpb/8020539/ Brian, Looks fine ( I did not go through the Scanner changes ). Some minor comments: 1) List Trivially I wonder why you decided to go with '< '>', rather than
                                                                    {@code ... }
                                                                    , which I think is more readable. 2) Map Trivially, I would keep the @param's order the same as the actual method parameters order. 3) Optional Strangely, there doesn't appear to be a '@param' for the class level type T. doclint is not warning about this either. -Chris. From chris.hegarty at oracle.com Mon Jul 29 10:27:45 2013 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Mon, 29 Jul 2013 11:27:45 +0100 Subject: RFR [8020669] java.nio.file.Files.readAllBytes() does not read any data when Files.size() is 0 In-Reply-To: <51F5AC9E.1010505@oracle.com> References: <51E97416.20506@oracle.com> <51E98043.6030102@oracle.com> <51E9853E.8020409@redhat.com> <51E985AD.60401@redhat.com> <51EB0BFF.3030106@oracle.com> <51ED57D8.90001@oracle.com> <51EE55AC.5000902@oracle.com> <51EE8E9A.6040806@redhat.com> <51EF1B43.9030200@oracle.com> <51F06789.1050403@oracle.com> <51F12B3E.4010603@oracle.com> <51F1BB22.6040405@oracle.com> <51F200F1.8010500@oracle.com> <51F5967A.6060705@oracle.com> <51F5AC9E.1010505@oracle.com> Message-ID: <51F643A1.30404@oracle.com> On 29/07/2013 00:43, Alan Bateman wrote: > On 28/07/2013 15:08, Ivan Gerasimov wrote: >> Hello Alan and everyone else >> >> Thank you for review! >> >> Here's another version of webrev: >> http://cr.openjdk.java.net/~igerasim/8020669/5/webrev/ >> The change looks fine to me, but then again I was happy with previous version too ;-) -Chris. > Thanks for the updated the webrev, the expansion of the capacity is much > nicer now. As regards whether to double or increase by BUFFER_SIZE then > it's probably a coin toss. One could come up with cases where someone is > using this method on a file that is extended by another entity. It would > depend on the extend rate as to which approach would be more efficient > (clearly such cases are going to be problematic as file locking should > be used to coordinate the access). > > As regards the comment on "Reads" vs "Read", that was more just I've > wasn't sure if you had intended to include this or not. > > So I'm happy to sponsor this for you (assuming we are done). > > -Alan. From paul.sandoz at oracle.com Mon Jul 29 11:20:03 2013 From: paul.sandoz at oracle.com (Paul Sandoz) Date: Mon, 29 Jul 2013 12:20:03 +0100 Subject: RFR: 8021591 : (s) Additional explicit null checks In-Reply-To: <17DBA593-2AD1-4E42-8DD1-790511B63B3F@oracle.com> References: <17DBA593-2AD1-4E42-8DD1-790511B63B3F@oracle.com> Message-ID: <97903415-01F4-4FE2-B5F8-AFBF54217D32@oracle.com> Hi Mike, V. quick review below. On Jul 27, 2013, at 12:31 AM, Mike Duigou wrote: > Hello all; > > This patch adds some missing checks for null that, according to interface contract, should be throwing NPE. It also improves the existing tests to check for these cases. > > http://cr.openjdk.java.net/~mduigou/JDK-8021591/0/webrev/ > > The changes to src/share/classes/java/util/concurrent/ConcurrentHashMap.java will be synchronized separately with the jsr166 workspace. They are part of this review to avoid test failures. > diff --git a/src/share/classes/java/util/Map.java b/src/share/classes/java/util/Map.java --- a/src/share/classes/java/util/Map.java +++ b/src/share/classes/java/util/Map.java @@ -804,6 +804,10 @@ * return false; * } * + * @implNote The default implementation does not throw NullPointerException + * for maps that do not support null values if oldValue is null unless + * newValue is also null. Is that really more a clarification of the default impl specification? - * @throws NullPointerException if a specified key or value is null, + * @throws NullPointerException if a specified key or newValue is null, * and this map does not permit null keys or values + * @throws NullPointerException if oldValue is null and this map does not + * permit null values + * (optional) More curious than anything else, is it fine to have two declarations of NPE here? +++ b/src/share/classes/java/util/TreeMap.java @@ -948,6 +948,27 @@ } @Override + public synchronized boolean replace(K key, V oldValue, V newValue) { + Entry p = getEntry(key); + if (p!=null && Objects.equals(oldValue, p.value)) { + p.value = newValue; + return true; + } + return false; + } + + @Override + public synchronized V replace(K key, V value) { Remove the synchronized? I might be missing something but i cannot see where ExtendsAbstractCollection is used. Paul. > Mike From nicholas+openjdk at nicholaswilliams.net Mon Jul 29 12:53:54 2013 From: nicholas+openjdk at nicholaswilliams.net (Nick Williams) Date: Mon, 29 Jul 2013 07:53:54 -0500 Subject: Classes on the stack trace (was: getElementClass/StackTraceElement, was: @CallerSensitive public API, was: sun.reflect.Reflection.getCallerClass) In-Reply-To: References: Message-ID: <00313922-A81A-49DE-9B4B-D56BC8A6D4BC@nicholaswilliams.net> Just so that everyone understands how important this subject is, this change to getCallerClass(...) is being labeled a "disaster" for logging frameworks everywhere. Here's a benchmark for getting Classes from the following methods: > 1,000,000 calls of all alternatives were measured as follows : > Reflection: 10.195 ms. > Current Thread StackTrace: 5886.964 ms. > Throwable StackTrace: 4700.073 ms. > SecurityManager: 1046.804 ms. My goal here is to get the entire list engaged in coming up with the right solution. We (the community) can't afford for Java 8 not to have an equivalent replacement for getCallerClass(). Nick On Jul 27, 2013, at 2:01 PM, Nick Williams wrote: > All, > > In the last two months, there have been a number of discussions surrounding stack traces, Classes on the stack trace, and caller classes [1], [2], [3]. These are all related discussions and the solution to them is equally related, so I wanted to consolidate it all into this one discussion where I hope we can finalize on a solution and get it implemented for Java 8. > > In a nut shell, here are the underlying needs that I have seen expressed through many, many messages: > > - Some code needs to get the Class of the caller of the current method, skipping any reflection methods. > - Some code needs to get the Class of the caller /n/ stack frames before the current method, skipping any reflection methods. > - Some code needs to get the current stack trace, populated with Classes, Executables, file names, line numbers, and native flags instead of the String class names and String method names in StackTraceElement. This /should/ include any reflection methods, just like StackTraceElement[]s. > - Some code needs to get the stack trace from when a Throwable was created, populated with Classes, Executables, file names, line numbers, and native flags instead of the String class names and String method names in StackTraceElement. This /should/ include any reflection methods, just like StackTraceElement[]s. > - There needs to be a reflection way to achieve all of this since some libraries (e.g., Log4j) need to be compiled against Java 6 but run on 7 and 8 (and thus can't use @CallerSensitive). > > I believe the solutions to these needs are all related. Importantly, I think it is very important that action be taken in Java 8 due to the changes made to sun.reflect.Reflection#getCallerClass(...). While we all understand that relying on private sun.* APIs is not safe, the fact is that many people have relied on sun.reflect.Reflection#getCallerClass(...) due to the fact that there is simply no other way to do this in the standard API. This includes Log4j 2, Logback, SLF4j, and Groovy, some features of which will stop working correctly in Java 7 >= u25. > > I would point out that this could all easily be solved simply by adding a getElementClass() method to StackTraceElement, but there was strong opposition to this, largely due to serialization issues. Since that is apparently not an option, I propose the following API, based on the various discussions in the last two months, StackTraceElement, and the API that .NET provides to achieve the same needs as listed above: > > CallerSensitive.java: > package java.lang; > > /** Previously private API, now public */ > public @interface CallerSensitive { > ... > } > > StackTraceFrame.java: > package java.lang; > > import java.util.Objects. > > public final class StackTraceFrame { > private final Class declaringClass; > private final Executable executable; > private final String fileName; > private final int lineNumber; > > public StackTraceFrame(Class declaringClass, Executable executable, String fileName, int lineNumber) { > this.declaringClass = Objects.requireNonNull(declaringClass, "Declaring class is null"); > this.executable = Objects.requireNonNull(executable, "Executable is null"); > this.fileName = fileName; > this.lineNumber = lineNumber; > } > > public Class getDeclaringClass() { > return this.declaringClass; > } > > public Executable getExecutable() { > return this.executable; > } > > public String getFileName() { > return this.fileName; > } > > public int getLineNumber() { > return this.lineNumber; > } > > public boolean isNative() { > return this.lineNumber == -2; > } > > public String toString() { /* Same as StackTraceElement */ } > public boolean equals() { /* Ditto */ } > public int hashCode() { /* Ditto */ } > > /** Uses @CallerSensitive */ > public static native StackTraceFrame getCallerFrame(); > > /** Works like Java < 7u25 sun.reflect.Reflection#getCallerClass() */ > public static native StackTraceFrame getCallerFrame(int skipFrames); > > public static native StackTraceFrame[] getCurrentStackTrace(); > } > > Throwable.java: > package java.lang; > > ... > > public class Throwable { > ... > public synchronized Throwable fillInStackTraceFrames() { ... } > > private native Throwable fillInStackTraceFrames(int dummy); > > public StackTraceFrame[] getStackTraceFrames() { > return this.getOurStackTraceFrames().clone(); > } > > private synchronized StackTraceFrame[] getOurStackTraceFrames() { ... } > ... > } > > Furthermore, I propose that we restore the behavior of sun.reflect.Reflection#getCallerClass(int) /just for Java 7/ since the proposed above solution cannot be added to Java 7. > > I would love if we could quickly coalesce around this solution or a derivative thereof so that it can be implemented before Feature Complete. The absence of any replacement or alternative for sun.reflect.Reflection#getCallerClass(int) will be a serious issue in Java 8 that will cause hardships for many projects. > > [1] http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-June/018049.html > [2] http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-June/018349.html, http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-July/019098.html > [3] http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-July/018855.html From david.lloyd at redhat.com Mon Jul 29 13:21:58 2013 From: david.lloyd at redhat.com (David M. Lloyd) Date: Mon, 29 Jul 2013 08:21:58 -0500 Subject: Classes on the stack trace (was: getElementClass/StackTraceElement, was: @CallerSensitive public API, was: sun.reflect.Reflection.getCallerClass) In-Reply-To: <00313922-A81A-49DE-9B4B-D56BC8A6D4BC@nicholaswilliams.net> References: <00313922-A81A-49DE-9B4B-D56BC8A6D4BC@nicholaswilliams.net> Message-ID: <51F66C76.10209@redhat.com> I find it very interesting that reflection is no less than two orders of magnitude faster than the security manager solution. How big was the stack in these tests? It makes me wonder if maybe the implementation of the security manager's getContext() method should be reevaluated a bit. On 07/29/2013 07:53 AM, Nick Williams wrote: > Just so that everyone understands how important this subject is, this change to getCallerClass(...) is being labeled a "disaster" for logging frameworks everywhere. Here's a benchmark for getting Classes from the following methods: > >> 1,000,000 calls of all alternatives were measured as follows : >> Reflection: 10.195 ms. >> Current Thread StackTrace: 5886.964 ms. >> Throwable StackTrace: 4700.073 ms. >> SecurityManager: 1046.804 ms. > > My goal here is to get the entire list engaged in coming up with the right solution. We (the community) can't afford for Java 8 not to have an equivalent replacement for getCallerClass(). > > Nick > > On Jul 27, 2013, at 2:01 PM, Nick Williams wrote: > >> All, >> >> In the last two months, there have been a number of discussions surrounding stack traces, Classes on the stack trace, and caller classes [1], [2], [3]. These are all related discussions and the solution to them is equally related, so I wanted to consolidate it all into this one discussion where I hope we can finalize on a solution and get it implemented for Java 8. >> >> In a nut shell, here are the underlying needs that I have seen expressed through many, many messages: >> >> - Some code needs to get the Class of the caller of the current method, skipping any reflection methods. >> - Some code needs to get the Class of the caller /n/ stack frames before the current method, skipping any reflection methods. >> - Some code needs to get the current stack trace, populated with Classes, Executables, file names, line numbers, and native flags instead of the String class names and String method names in StackTraceElement. This /should/ include any reflection methods, just like StackTraceElement[]s. >> - Some code needs to get the stack trace from when a Throwable was created, populated with Classes, Executables, file names, line numbers, and native flags instead of the String class names and String method names in StackTraceElement. This /should/ include any reflection methods, just like StackTraceElement[]s. >> - There needs to be a reflection way to achieve all of this since some libraries (e.g., Log4j) need to be compiled against Java 6 but run on 7 and 8 (and thus can't use @CallerSensitive). >> >> I believe the solutions to these needs are all related. Importantly, I think it is very important that action be taken in Java 8 due to the changes made to sun.reflect.Reflection#getCallerClass(...). While we all understand that relying on private sun.* APIs is not safe, the fact is that many people have relied on sun.reflect.Reflection#getCallerClass(...) due to the fact that there is simply no other way to do this in the standard API. This includes Log4j 2, Logback, SLF4j, and Groovy, some features of which will stop working correctly in Java 7 >= u25. >> >> I would point out that this could all easily be solved simply by adding a getElementClass() method to StackTraceElement, but there was strong opposition to this, largely due to serialization issues. Since that is apparently not an option, I propose the following API, based on the various discussions in the last two months, StackTraceElement, and the API that .NET provides to achieve the same needs as listed above: >> >> CallerSensitive.java: >> package java.lang; >> >> /** Previously private API, now public */ >> public @interface CallerSensitive { >> ... >> } >> >> StackTraceFrame.java: >> package java.lang; >> >> import java.util.Objects. >> >> public final class StackTraceFrame { >> private final Class declaringClass; >> private final Executable executable; >> private final String fileName; >> private final int lineNumber; >> >> public StackTraceFrame(Class declaringClass, Executable executable, String fileName, int lineNumber) { >> this.declaringClass = Objects.requireNonNull(declaringClass, "Declaring class is null"); >> this.executable = Objects.requireNonNull(executable, "Executable is null"); >> this.fileName = fileName; >> this.lineNumber = lineNumber; >> } >> >> public Class getDeclaringClass() { >> return this.declaringClass; >> } >> >> public Executable getExecutable() { >> return this.executable; >> } >> >> public String getFileName() { >> return this.fileName; >> } >> >> public int getLineNumber() { >> return this.lineNumber; >> } >> >> public boolean isNative() { >> return this.lineNumber == -2; >> } >> >> public String toString() { /* Same as StackTraceElement */ } >> public boolean equals() { /* Ditto */ } >> public int hashCode() { /* Ditto */ } >> >> /** Uses @CallerSensitive */ >> public static native StackTraceFrame getCallerFrame(); >> >> /** Works like Java < 7u25 sun.reflect.Reflection#getCallerClass() */ >> public static native StackTraceFrame getCallerFrame(int skipFrames); >> >> public static native StackTraceFrame[] getCurrentStackTrace(); >> } >> >> Throwable.java: >> package java.lang; >> >> ... >> >> public class Throwable { >> ... >> public synchronized Throwable fillInStackTraceFrames() { ... } >> >> private native Throwable fillInStackTraceFrames(int dummy); >> >> public StackTraceFrame[] getStackTraceFrames() { >> return this.getOurStackTraceFrames().clone(); >> } >> >> private synchronized StackTraceFrame[] getOurStackTraceFrames() { ... } >> ... >> } >> >> Furthermore, I propose that we restore the behavior of sun.reflect.Reflection#getCallerClass(int) /just for Java 7/ since the proposed above solution cannot be added to Java 7. >> >> I would love if we could quickly coalesce around this solution or a derivative thereof so that it can be implemented before Feature Complete. The absence of any replacement or alternative for sun.reflect.Reflection#getCallerClass(int) will be a serious issue in Java 8 that will cause hardships for many projects. >> >> [1] http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-June/018049.html >> [2] http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-June/018349.html, http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-July/019098.html >> [3] http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-July/018855.html > -- - DML From chris.hegarty at oracle.com Mon Jul 29 13:46:48 2013 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Mon, 29 Jul 2013 14:46:48 +0100 Subject: RFR: 8021591 : (s) Additional explicit null checks In-Reply-To: <97903415-01F4-4FE2-B5F8-AFBF54217D32@oracle.com> References: <17DBA593-2AD1-4E42-8DD1-790511B63B3F@oracle.com> <97903415-01F4-4FE2-B5F8-AFBF54217D32@oracle.com> Message-ID: <51F67248.60308@oracle.com> On 29/07/2013 12:20, Paul Sandoz wrote: > Hi Mike, > > V. quick review below. The changes look ok to me. Some small comments below. > On Jul 27, 2013, at 12:31 AM, Mike Duigou wrote: > >> Hello all; >> >> This patch adds some missing checks for null that, according to interface contract, should be throwing NPE. It also improves the existing tests to check for these cases. >> >> http://cr.openjdk.java.net/~mduigou/JDK-8021591/0/webrev/ >> >> The changes to src/share/classes/java/util/concurrent/ConcurrentHashMap.java will be synchronized separately with the jsr166 workspace. They are part of this review to avoid test failures. >> > > diff --git a/src/share/classes/java/util/Map.java b/src/share/classes/java/util/Map.java > --- a/src/share/classes/java/util/Map.java > +++ b/src/share/classes/java/util/Map.java > @@ -804,6 +804,10 @@ > * return false; > * } > * > + * @implNote The default implementation does not throw NullPointerException > + * for maps that do not support null values if oldValue is null unless > + * newValue is also null. > > > Is that really more a clarification of the default impl specification? I thought implNote was to be used for default implementations, but it appears that it is implSpec? > > > - * @throws NullPointerException if a specified key or value is null, > + * @throws NullPointerException if a specified key or newValue is null, > * and this map does not permit null keys or values > + * @throws NullPointerException if oldValue is null and this map does not > + * permit null values > + * (optional) > > > More curious than anything else, is it fine to have two declarations of NPE here? Having two @throws looks a little strange to me. Putting it together??? * @throws NullPointerException if a specified key or newValue is null, * and this map does not permit null keys or values. If * oldValue is null and this map does not permit null values * (optional). Is this even right? Should the implNote not be part of the NPE throws? Do you want replace to be used to put an initial value ( where previously unset (null) )? -Chris. > > > +++ b/src/share/classes/java/util/TreeMap.java > @@ -948,6 +948,27 @@ > } > > @Override > + public synchronized boolean replace(K key, V oldValue, V newValue) { > + Entry p = getEntry(key); > + if (p!=null&& Objects.equals(oldValue, p.value)) { > + p.value = newValue; > + return true; > + } > + return false; > + } > + > + @Override > + public synchronized V replace(K key, V value) { > > Remove the synchronized? > > > I might be missing something but i cannot see where ExtendsAbstractCollection is used. > > Paul. > >> Mike > From pbenedict at apache.org Mon Jul 29 13:50:07 2013 From: pbenedict at apache.org (Paul Benedict) Date: Mon, 29 Jul 2013 08:50:07 -0500 Subject: Classes on the stack trace (was: getElementClass/StackTraceElement, was: @CallerSensitive public API, was: sun.reflect.Reflection.getCallerClass) Message-ID: If it is not possible in the remaining dev time for JDK8 to expose Reflection.getCallerClass() functionality through some public API, why must -Djdk.reflect.allowGetCallerClass be discontinued so soon? Why the hot potato? I don't see how impacting the many (most? or all?) open source logging libraries is a good idea. With the argument of "you shouldn't be using private sun.* classes" aside, it seriously needs to be evaulted rather causing such commotion is worthwhile. I would like Oracle to reconsider dropping the System property workaround until an API can be put in place. -- Cheers, Paul From Bob.Vandette at oracle.com Mon Jul 29 14:12:07 2013 From: Bob.Vandette at oracle.com (Bob Vandette) Date: Mon, 29 Jul 2013 10:12:07 -0400 Subject: 8016036: RMI specification needs to be updated to allow Activation on remote hosts In-Reply-To: <51F41E5F.6030407@oracle.com> References: <51DE3146.2000908@oracle.com> <51F41E5F.6030407@oracle.com> Message-ID: Alan, Excuse me if I'm a bit frustrated by this issue ... We keep going around and around on this issue. We had a discussion with Stuart and the JCK team and Stuart didn't want to change the specification. Has he now changed his mind? Security and configuration issues aside, I don't understand why it doesn't make sense to remote activate an Object in an API that is supposed implement "Remote Method Invocation" support. The fact that it only supports activation on a local host seems to be a bug to me. Bob. On Jul 27, 2013, at 3:24 PM, Alan Bateman wrote: > On 10/07/2013 21:15, Stephen Flores wrote: >> Bob, Sean, >> >> Please review this webrev >> >> http://cr.openjdk.java.net/~sflores/8016036/webrev.00/ >> >> for RFE/CCC: 8016036 RMI specification needs to be updated to allow Activation on remote hosts > I didn't see any replies to this but I chatted briefly with Stuart Marks about this a few days ago as it's not clear (to me anyway) that this is the right thing to do. In particular it would be good to understand why the specification can't be changed to allow for environments that doesn't support multiple VM instances or where it's not possible to launch a new VM. This would amount to not supporting activation in such environments. Has this approach been explored? It could of course require being creative in the specifications but there are other examples of this type of thing. > > -Alan From chris.hegarty at oracle.com Mon Jul 29 14:28:36 2013 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Mon, 29 Jul 2013 15:28:36 +0100 Subject: Remaining doclint issues in java.net Message-ID: <51F67C14.5040804@oracle.com> There are two remaining doclint warnings in the java.net package. >:javac -Xdoclint:all/protected src/share/classes/java/net/DatagramPacket.java src/share/classes/java/net/DatagramPacket.java:142: warning: no @throws for java.net.SocketException public DatagramPacket(byte buf[], int offset, int length, ^ src/share/classes/java/net/DatagramPacket.java:178: warning: no @throws for java.net.SocketException public DatagramPacket(byte buf[], int length, ^ These are caused by no @throws SE declaration on the constructors. As it happens 'throws SE' was incorrectly added to these constructors when introduced in 1.4. The original API specified that SE was thrown when the given SocketAddress was not supported. That was later changed to throw IAE, in 1.4.2. These constructor now can never throw SE. Removing 'throws SE' from the method declaration is a binary compatible change, but not source compatible ( XXX is never thrown in body of corresponding try statement ). I don't think breaking source compatibility for this kind of change is justified. If it is, then the solution is to simply remove 'throws SE'. Back in the real world, I guess we need to come up with some wording for the '@throws SE' declaration. Something vague like "If an I/O Exception occurs", or can we put something stronger like "will never be thrown" ?? Thanks, -Chris. From ivan.gerasimov at oracle.com Mon Jul 29 14:26:17 2013 From: ivan.gerasimov at oracle.com (Ivan Gerasimov) Date: Mon, 29 Jul 2013 18:26:17 +0400 Subject: RFR [8020669] java.nio.file.Files.readAllBytes() does not read any data when Files.size() is 0 In-Reply-To: <51F643A1.30404@oracle.com> References: <51E97416.20506@oracle.com> <51E98043.6030102@oracle.com> <51E9853E.8020409@redhat.com> <51E985AD.60401@redhat.com> <51EB0BFF.3030106@oracle.com> <51ED57D8.90001@oracle.com> <51EE55AC.5000902@oracle.com> <51EE8E9A.6040806@redhat.com> <51EF1B43.9030200@oracle.com> <51F06789.1050403@oracle.com> <51F12B3E.4010603@oracle.com> <51F1BB22.6040405@oracle.com> <51F200F1.8010500@oracle.com> <51F5967A.6060705@oracle.com> <51F5AC9E.1010505@oracle.com> <51F643A1.30404@oracle.com> Message-ID: <51F67B89.807@oracle.com> On 29.07.2013 14:27, Chris Hegarty wrote: > On 29/07/2013 00:43, Alan Bateman wrote: >> On 28/07/2013 15:08, Ivan Gerasimov wrote: >>> Hello Alan and everyone else >>> >>> Thank you for review! >>> >>> Here's another version of webrev: >>> http://cr.openjdk.java.net/~igerasim/8020669/5/webrev/ >>> > > The change looks fine to me, but then again I was happy with previous > version too ;-) > Thank you, Chris! Ivan > -Chris. > > >> Thanks for the updated the webrev, the expansion of the capacity is much >> nicer now. As regards whether to double or increase by BUFFER_SIZE then >> it's probably a coin toss. One could come up with cases where someone is >> using this method on a file that is extended by another entity. It would >> depend on the extend rate as to which approach would be more efficient >> (clearly such cases are going to be problematic as file locking should >> be used to coordinate the access). >> >> As regards the comment on "Reads" vs "Read", that was more just I've >> wasn't sure if you had intended to include this or not. >> >> So I'm happy to sponsor this for you (assuming we are done). >> >> -Alan. > > From nicholas+openjdk at nicholaswilliams.net Mon Jul 29 14:48:08 2013 From: nicholas+openjdk at nicholaswilliams.net (Nicholas Williams) Date: Mon, 29 Jul 2013 09:48:08 -0500 Subject: Classes on the stack trace (was: getElementClass/StackTraceElement, was: @CallerSensitive public API, was: sun.reflect.Reflection.getCallerClass) In-Reply-To: <51F66C76.10209@redhat.com> References: <00313922-A81A-49DE-9B4B-D56BC8A6D4BC@nicholaswilliams.net> <51F66C76.10209@redhat.com> Message-ID: I wasn't the one who ran the test, so I don't know for sure. My theory was that getCallerClass() returns a single frame, but the SecurityManager must allocate an array of appropriate size (which involves some overhead) and then return all of the frames. I chalked the difference up to that. My conclusion from the data was: If you need a whole stack, SecurityManager is clearly the best option. If you need a single frame, getCallerClass() is the only option that makes any sense. On Mon, Jul 29, 2013 at 8:21 AM, David M. Lloyd wrote: > I find it very interesting that reflection is no less than two orders of > magnitude faster than the security manager solution. How big was the stack > in these tests? It makes me wonder if maybe the implementation of the > security manager's getContext() method should be reevaluated a bit. > > > On 07/29/2013 07:53 AM, Nick Williams wrote: >> >> Just so that everyone understands how important this subject is, this >> change to getCallerClass(...) is being labeled a "disaster" for logging >> frameworks everywhere. Here's a benchmark for getting Classes from the >> following methods: >> >>> 1,000,000 calls of all alternatives were measured as follows : >>> Reflection: 10.195 ms. >>> Current Thread StackTrace: 5886.964 ms. >>> Throwable StackTrace: 4700.073 ms. >>> SecurityManager: 1046.804 ms. >> >> >> My goal here is to get the entire list engaged in coming up with the right >> solution. We (the community) can't afford for Java 8 not to have an >> equivalent replacement for getCallerClass(). >> >> Nick >> >> On Jul 27, 2013, at 2:01 PM, Nick Williams wrote: >> >>> All, >>> >>> In the last two months, there have been a number of discussions >>> surrounding stack traces, Classes on the stack trace, and caller classes >>> [1], [2], [3]. These are all related discussions and the solution to them is >>> equally related, so I wanted to consolidate it all into this one discussion >>> where I hope we can finalize on a solution and get it implemented for Java >>> 8. >>> >>> In a nut shell, here are the underlying needs that I have seen expressed >>> through many, many messages: >>> >>> - Some code needs to get the Class of the caller of the current method, >>> skipping any reflection methods. >>> - Some code needs to get the Class of the caller /n/ stack frames before >>> the current method, skipping any reflection methods. >>> - Some code needs to get the current stack trace, populated with Classes, >>> Executables, file names, line numbers, and native flags instead of the >>> String class names and String method names in StackTraceElement. This >>> /should/ include any reflection methods, just like StackTraceElement[]s. >>> - Some code needs to get the stack trace from when a Throwable was >>> created, populated with Classes, Executables, file names, line numbers, and >>> native flags instead of the String class names and String method names in >>> StackTraceElement. This /should/ include any reflection methods, just like >>> StackTraceElement[]s. >>> - There needs to be a reflection way to achieve all of this since some >>> libraries (e.g., Log4j) need to be compiled against Java 6 but run on 7 and >>> 8 (and thus can't use @CallerSensitive). >>> >>> I believe the solutions to these needs are all related. Importantly, I >>> think it is very important that action be taken in Java 8 due to the changes >>> made to sun.reflect.Reflection#getCallerClass(...). While we all understand >>> that relying on private sun.* APIs is not safe, the fact is that many people >>> have relied on sun.reflect.Reflection#getCallerClass(...) due to the fact >>> that there is simply no other way to do this in the standard API. This >>> includes Log4j 2, Logback, SLF4j, and Groovy, some features of which will >>> stop working correctly in Java 7 >= u25. >>> >>> I would point out that this could all easily be solved simply by adding a >>> getElementClass() method to StackTraceElement, but there was strong >>> opposition to this, largely due to serialization issues. Since that is >>> apparently not an option, I propose the following API, based on the various >>> discussions in the last two months, StackTraceElement, and the API that .NET >>> provides to achieve the same needs as listed above: >>> >>> CallerSensitive.java: >>> package java.lang; >>> >>> /** Previously private API, now public */ >>> public @interface CallerSensitive { >>> ... >>> } >>> >>> StackTraceFrame.java: >>> package java.lang; >>> >>> import java.util.Objects. >>> >>> public final class StackTraceFrame { >>> private final Class declaringClass; >>> private final Executable executable; >>> private final String fileName; >>> private final int lineNumber; >>> >>> public StackTraceFrame(Class declaringClass, Executable >>> executable, String fileName, int lineNumber) { >>> this.declaringClass = Objects.requireNonNull(declaringClass, >>> "Declaring class is null"); >>> this.executable = Objects.requireNonNull(executable, "Executable >>> is null"); >>> this.fileName = fileName; >>> this.lineNumber = lineNumber; >>> } >>> >>> public Class getDeclaringClass() { >>> return this.declaringClass; >>> } >>> >>> public Executable getExecutable() { >>> return this.executable; >>> } >>> >>> public String getFileName() { >>> return this.fileName; >>> } >>> >>> public int getLineNumber() { >>> return this.lineNumber; >>> } >>> >>> public boolean isNative() { >>> return this.lineNumber == -2; >>> } >>> >>> public String toString() { /* Same as StackTraceElement */ } >>> public boolean equals() { /* Ditto */ } >>> public int hashCode() { /* Ditto */ } >>> >>> /** Uses @CallerSensitive */ >>> public static native StackTraceFrame getCallerFrame(); >>> >>> /** Works like Java < 7u25 sun.reflect.Reflection#getCallerClass() >>> */ >>> public static native StackTraceFrame getCallerFrame(int skipFrames); >>> >>> public static native StackTraceFrame[] getCurrentStackTrace(); >>> } >>> >>> Throwable.java: >>> package java.lang; >>> >>> ... >>> >>> public class Throwable { >>> ... >>> public synchronized Throwable fillInStackTraceFrames() { ... } >>> >>> private native Throwable fillInStackTraceFrames(int dummy); >>> >>> public StackTraceFrame[] getStackTraceFrames() { >>> return this.getOurStackTraceFrames().clone(); >>> } >>> >>> private synchronized StackTraceFrame[] getOurStackTraceFrames() { >>> ... } >>> ... >>> } >>> >>> Furthermore, I propose that we restore the behavior of >>> sun.reflect.Reflection#getCallerClass(int) /just for Java 7/ since the >>> proposed above solution cannot be added to Java 7. >>> >>> I would love if we could quickly coalesce around this solution or a >>> derivative thereof so that it can be implemented before Feature Complete. >>> The absence of any replacement or alternative for >>> sun.reflect.Reflection#getCallerClass(int) will be a serious issue in Java 8 >>> that will cause hardships for many projects. >>> >>> [1] >>> http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-June/018049.html >>> [2] >>> http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-June/018349.html, >>> http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-July/019098.html >>> [3] >>> http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-July/018855.html >> >> > > > -- > - DML From Alan.Bateman at oracle.com Mon Jul 29 14:48:31 2013 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Mon, 29 Jul 2013 07:48:31 -0700 Subject: 8016036: RMI specification needs to be updated to allow Activation on remote hosts In-Reply-To: References: <51DE3146.2000908@oracle.com> <51F41E5F.6030407@oracle.com> Message-ID: <51F680BF.5060804@oracle.com> On 29/07/2013 07:12, Bob Vandette wrote: > Alan, > > Excuse me if I'm a bit frustrated by this issue ... > > We keep going around and around on this issue. We had a discussion with Stuart and the JCK > team and Stuart didn't want to change the specification. Has he now changed his mind? > > Security and configuration issues aside, I don't understand why it doesn't make sense to remote > activate an Object in an API that is supposed implement "Remote Method Invocation" support. > The fact that it only supports activation on a local host seems to be a bug to me. > > > Bob. I understand that this is a bit frustrating but I think we should at least explore relaxing the specification (if it hasn't been explored already). I'm not an export on RMI but I'm just concerned that the currently "agreed" solution to do the activation on another system feels more like a solution to get tests to pass. Stuart told me that he would look into it and see if relaxing the specification is feasible or not. Stuart - do you have anything to add? -Alan. From jhuxhorn at googlemail.com Mon Jul 29 15:47:18 2013 From: jhuxhorn at googlemail.com (=?UTF-8?Q?J=C3=B6rn_Huxhorn?=) Date: Mon, 29 Jul 2013 17:47:18 +0200 Subject: =?UTF-8?Q?Re=3A_Classes_on_the_stack_trace_(was=3A_getElementClass/StackTraceElement=2C_was=3A_=40CallerSensitive_public_API=2C_was=3A_sun.reflect.Reflection.getCallerClass)?= In-Reply-To: References: <00313922-A81A-49DE-9B4B-D56BC8A6D4BC@nicholaswilliams.net> <51F66C76.10209@redhat.com> Message-ID: The numbers are from this link:?http://stackoverflow.com/questions/421280/in-java-how-do-i-find-the-caller-of-a-method-using-stacktrace-or-reflection Even if this benchmark suffers from micro-benchmark issues: a slow-down of 10x would be bad, a slow-down of 100x would be a catastrophe. I'd suggest to at least postpone the UnsupportedOperationException change until we find a suitable replacement. This change will also break existing Groovy scripts. See?http://jira.codehaus.org/browse/GROOVY-6279?- but there are other issues as well. Cheers, J?rn. On 29. Juli 2013 at 16:49:02, Nicholas Williams (nicholas+openjdk at nicholaswilliams.net) wrote: I wasn't the one who ran the test, so I don't know for sure. My theory was that getCallerClass() returns a single frame, but the SecurityManager must allocate an array of appropriate size (which involves some overhead) and then return all of the frames. I chalked the difference up to that. My conclusion from the data was: If you need a whole stack, SecurityManager is clearly the best option. If you need a single frame, getCallerClass() is the only option that makes any sense. On Mon, Jul 29, 2013 at 8:21 AM, David M. Lloyd wrote: > I find it very interesting that reflection is no less than two orders of > magnitude faster than the security manager solution. How big was the stack > in these tests? It makes me wonder if maybe the implementation of the > security manager's getContext() method should be reevaluated a bit. > > > On 07/29/2013 07:53 AM, Nick Williams wrote: >> >> Just so that everyone understands how important this subject is, this >> change to getCallerClass(...) is being labeled a "disaster" for logging >> frameworks everywhere. Here's a benchmark for getting Classes from the >> following methods: >> >>> 1,000,000 calls of all alternatives were measured as follows : >>> Reflection: 10.195 ms. >>> Current Thread StackTrace: 5886.964 ms. >>> Throwable StackTrace: 4700.073 ms. >>> SecurityManager: 1046.804 ms. >> >> >> My goal here is to get the entire list engaged in coming up with the right >> solution. We (the community) can't afford for Java 8 not to have an >> equivalent replacement for getCallerClass(). >> >> Nick >> >> On Jul 27, 2013, at 2:01 PM, Nick Williams wrote: >> >>> All, >>> >>> In the last two months, there have been a number of discussions >>> surrounding stack traces, Classes on the stack trace, and caller classes >>> [1], [2], [3]. These are all related discussions and the solution to them is >>> equally related, so I wanted to consolidate it all into this one discussion >>> where I hope we can finalize on a solution and get it implemented for Java >>> 8. >>> >>> In a nut shell, here are the underlying needs that I have seen expressed >>> through many, many messages: >>> >>> - Some code needs to get the Class of the caller of the current method, >>> skipping any reflection methods. >>> - Some code needs to get the Class of the caller /n/ stack frames before >>> the current method, skipping any reflection methods. >>> - Some code needs to get the current stack trace, populated with Classes, >>> Executables, file names, line numbers, and native flags instead of the >>> String class names and String method names in StackTraceElement. This >>> /should/ include any reflection methods, just like StackTraceElement[]s. >>> - Some code needs to get the stack trace from when a Throwable was >>> created, populated with Classes, Executables, file names, line numbers, and >>> native flags instead of the String class names and String method names in >>> StackTraceElement. This /should/ include any reflection methods, just like >>> StackTraceElement[]s. >>> - There needs to be a reflection way to achieve all of this since some >>> libraries (e.g., Log4j) need to be compiled against Java 6 but run on 7 and >>> 8 (and thus can't use @CallerSensitive). >>> >>> I believe the solutions to these needs are all related. Importantly, I >>> think it is very important that action be taken in Java 8 due to the changes >>> made to sun.reflect.Reflection#getCallerClass(...). While we all understand >>> that relying on private sun.* APIs is not safe, the fact is that many people >>> have relied on sun.reflect.Reflection#getCallerClass(...) due to the fact >>> that there is simply no other way to do this in the standard API. This >>> includes Log4j 2, Logback, SLF4j, and Groovy, some features of which will >>> stop working correctly in Java 7 >= u25. >>> >>> I would point out that this could all easily be solved simply by adding a >>> getElementClass() method to StackTraceElement, but there was strong >>> opposition to this, largely due to serialization issues. Since that is >>> apparently not an option, I propose the following API, based on the various >>> discussions in the last two months, StackTraceElement, and the API that .NET >>> provides to achieve the same needs as listed above: >>> >>> CallerSensitive.java: >>> package java.lang; >>> >>> /** Previously private API, now public */ >>> public @interface CallerSensitive { >>> ... >>> } >>> >>> StackTraceFrame.java: >>> package java.lang; >>> >>> import java.util.Objects. >>> >>> public final class StackTraceFrame { >>> private final Class declaringClass; >>> private final Executable executable; >>> private final String fileName; >>> private final int lineNumber; >>> >>> public StackTraceFrame(Class declaringClass, Executable >>> executable, String fileName, int lineNumber) { >>> this.declaringClass = Objects.requireNonNull(declaringClass, >>> "Declaring class is null"); >>> this.executable = Objects.requireNonNull(executable, "Executable >>> is null"); >>> this.fileName = fileName; >>> this.lineNumber = lineNumber; >>> } >>> >>> public Class getDeclaringClass() { >>> return this.declaringClass; >>> } >>> >>> public Executable getExecutable() { >>> return this.executable; >>> } >>> >>> public String getFileName() { >>> return this.fileName; >>> } >>> >>> public int getLineNumber() { >>> return this.lineNumber; >>> } >>> >>> public boolean isNative() { >>> return this.lineNumber == -2; >>> } >>> >>> public String toString() { /* Same as StackTraceElement */ } >>> public boolean equals() { /* Ditto */ } >>> public int hashCode() { /* Ditto */ } >>> >>> /** Uses @CallerSensitive */ >>> public static native StackTraceFrame getCallerFrame(); >>> >>> /** Works like Java < 7u25 sun.reflect.Reflection#getCallerClass() >>> */ >>> public static native StackTraceFrame getCallerFrame(int skipFrames); >>> >>> public static native StackTraceFrame[] getCurrentStackTrace(); >>> } >>> >>> Throwable.java: >>> package java.lang; >>> >>> ... >>> >>> public class Throwable { >>> ... >>> public synchronized Throwable fillInStackTraceFrames() { ... } >>> >>> private native Throwable fillInStackTraceFrames(int dummy); >>> >>> public StackTraceFrame[] getStackTraceFrames() { >>> return this.getOurStackTraceFrames().clone(); >>> } >>> >>> private synchronized StackTraceFrame[] getOurStackTraceFrames() { >>> ... } >>> ... >>> } >>> >>> Furthermore, I propose that we restore the behavior of >>> sun.reflect.Reflection#getCallerClass(int) /just for Java 7/ since the >>> proposed above solution cannot be added to Java 7. >>> >>> I would love if we could quickly coalesce around this solution or a >>> derivative thereof so that it can be implemented before Feature Complete. >>> The absence of any replacement or alternative for >>> sun.reflect.Reflection#getCallerClass(int) will be a serious issue in Java 8 >>> that will cause hardships for many projects. >>> >>> [1] >>> http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-June/018049.html >>> [2] >>> http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-June/018349.html, >>> http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-July/019098.html >>> [3] >>> http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-July/018855.html >> >> > > > -- > - DML From jhuxhorn at googlemail.com Mon Jul 29 15:53:48 2013 From: jhuxhorn at googlemail.com (=?UTF-8?Q?J=C3=B6rn_Huxhorn?=) Date: Mon, 29 Jul 2013 17:53:48 +0200 Subject: =?UTF-8?Q?Re=3A_Classes_on_the_stack_trace_(was=3A_getElementClass/StackTraceElement=2C_was=3A_=40CallerSensitive_public_API=2C_was=3A_sun.reflect.Reflection.getCallerClass)?= In-Reply-To: References: Message-ID: +1 On 29. Juli 2013 at 15:50:36, Paul Benedict (pbenedict at apache.org) wrote: If it is not possible in the remaining dev time for JDK8 to expose Reflection.getCallerClass() functionality through some public API, why must -Djdk.reflect.allowGetCallerClass be discontinued so soon? Why the hot potato? I don't see how impacting the many (most? or all?) open source logging libraries is a good idea. With the argument of "you shouldn't be using private sun.* classes" aside, it seriously needs to be evaulted rather causing such commotion is worthwhile. I would like Oracle to reconsider dropping the System property workaround until an API can be put in place. -- Cheers, Paul From sundararajan.athijegannathan at oracle.com Mon Jul 29 16:10:35 2013 From: sundararajan.athijegannathan at oracle.com (sundararajan.athijegannathan at oracle.com) Date: Mon, 29 Jul 2013 16:10:35 +0000 Subject: hg: jdk8/tl/jdk: 8021773: print function as defined by jrunscript's init.js script is incompatible with nashorn's definition Message-ID: <20130729161123.A3A2548445@hg.openjdk.java.net> Changeset: 24bda55fca48 Author: sundar Date: 2013-07-29 21:39 +0530 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/24bda55fca48 8021773: print function as defined by jrunscript's init.js script is incompatible with nashorn's definition Reviewed-by: hannesw, lagergren ! src/share/classes/com/sun/tools/script/shell/init.js From maurizio.cimadamore at oracle.com Mon Jul 29 16:21:18 2013 From: maurizio.cimadamore at oracle.com (maurizio.cimadamore at oracle.com) Date: Mon, 29 Jul 2013 16:21:18 +0000 Subject: hg: jdk8/tl/langtools: 8021338: Diamond finder may mark a required type argument as unnecessary Message-ID: <20130729162121.693DA48448@hg.openjdk.java.net> Changeset: cd9e8cea1b3c Author: jlahoda Date: 2013-07-28 10:17 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/cd9e8cea1b3c 8021338: Diamond finder may mark a required type argument as unnecessary Reviewed-by: mcimadamore ! src/share/classes/com/sun/tools/javac/comp/Attr.java ! test/tools/javac/generics/diamond/6939780/T6939780.java From maurizio.cimadamore at oracle.com Mon Jul 29 16:17:43 2013 From: maurizio.cimadamore at oracle.com (maurizio.cimadamore at oracle.com) Date: Mon, 29 Jul 2013 16:17:43 +0000 Subject: hg: jdk8/tl/langtools: 8020689: Missing LineNumberTable entries in compiled class files Message-ID: <20130729161746.5CB0548446@hg.openjdk.java.net> Changeset: 8c4b2987edac Author: jlahoda Date: 2013-07-28 10:17 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/8c4b2987edac 8020689: Missing LineNumberTable entries in compiled class files Reviewed-by: ksrini, mcimadamore ! src/share/classes/com/sun/tools/javac/jvm/Gen.java + test/tools/javac/jvm/T8020689.java From alexey.utkin at oracle.com Mon Jul 29 17:06:27 2013 From: alexey.utkin at oracle.com (Alexey Utkin) Date: Mon, 29 Jul 2013 21:06:27 +0400 Subject: Review request: JDK-8021245 (process) file leak in jdk/src/windows/native/java/lang/ProcessImpl_md.c In-Reply-To: <51F55777.5050404@oracle.com> References: <51F296CF.2050902@oracle.com> <51F55777.5050404@oracle.com> Message-ID: <51F6A113.3090700@oracle.com> Thanks, Alan I did "if" reformatting and small refactoring for the code in function in accordance with https://jbs.oracle.com/bugs/browse/JDK-5008166 recommendations. I am sure that the presence of path separator has no dependence from search direction. Here is the webrev: http://cr.openjdk.java.net/~uta/openjdk-webrevs/JDK-8021245/webrev.01/ The fix was tested in the debugger. Regards, -uta On 7/28/2013 9:40 PM, Alan Bateman wrote: > On 26/07/2013 08:33, Alexey Utkin wrote: >> Bug description: >> https://jbs.oracle.com/bugs/browse/JDK-8021245 >> http://bugs.sun.com/view_bug.do?bug_id=8021245 >> >> Here is the suggested fix: >> http://cr.openjdk.java.net/~uta/openjdk-webrevs/JDK-8021245/webrev.00/ >> >> Summary: >> In accordance with MS spec [-1] is THE ONLY error signal from the >> [_open] function call. >> http://msdn.microsoft.com/en-us/library/z0kc8e3z.aspx >> Any negative, except [-1], and zero are the valid handles that need >> to be closed. >> >> The fix was tested in the debugger my manual switching to Win9x/WinMe >> brunch of execution. > Checking if _open returns -1 and checking the return from _read and > _lseek/_read looks okay to me. My only comment is that the "if (" on > its own looks a bit odd, I just I would at least hoist the first part > of the expression onto the same line. > > -Alan. > From sundararajan.athijegannathan at oracle.com Mon Jul 29 17:55:23 2013 From: sundararajan.athijegannathan at oracle.com (sundararajan.athijegannathan at oracle.com) Date: Mon, 29 Jul 2013 17:55:23 +0000 Subject: hg: jdk8/tl/nashorn: 2 new changesets Message-ID: <20130729175526.51ED448454@hg.openjdk.java.net> Changeset: 0532397d0732 Author: sundar Date: 2013-07-29 18:07 +0530 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/0532397d0732 8012792: print function defined in engine.js does not handle multiple arguments Reviewed-by: hannesw ! src/jdk/nashorn/api/scripting/resources/engine.js ! test/src/jdk/nashorn/api/scripting/ScriptEngineTest.java Changeset: 7d5d24bdb671 Author: sundar Date: 2013-07-29 21:56 +0530 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/7d5d24bdb671 Merge From paul.sandoz at oracle.com Mon Jul 29 18:12:59 2013 From: paul.sandoz at oracle.com (Paul Sandoz) Date: Mon, 29 Jul 2013 19:12:59 +0100 Subject: RFR: 8021591 : (s) Additional explicit null checks In-Reply-To: <51F67248.60308@oracle.com> References: <17DBA593-2AD1-4E42-8DD1-790511B63B3F@oracle.com> <97903415-01F4-4FE2-B5F8-AFBF54217D32@oracle.com> <51F67248.60308@oracle.com> Message-ID: <269E2F2E-82A6-4B20-A0ED-A605708A8FF5@oracle.com> On Jul 29, 2013, at 2:46 PM, Chris Hegarty wrote: >> diff --git a/src/share/classes/java/util/Map.java b/src/share/classes/java/util/Map.java >> --- a/src/share/classes/java/util/Map.java >> +++ b/src/share/classes/java/util/Map.java >> @@ -804,6 +804,10 @@ >> * return false; >> * } >> * >> + * @implNote The default implementation does not throw NullPointerException >> + * for maps that do not support null values if oldValue is null unless >> + * newValue is also null. >> >> >> Is that really more a clarification of the default impl specification? > > I thought implNote was to be used for default implementations, but it appears that it is implSpec? > Correct, @implNote can be used for an implementation of anything not just a default implementation; it signals some non-normative stuff. Whereas @implSpec defines the behaviour for a particular implementation whose actual code could be implemented differently by another JDK implementation, it could equally apply to methods on classes too e.g. those abstract collection classes >> >> >> - * @throws NullPointerException if a specified key or value is null, >> + * @throws NullPointerException if a specified key or newValue is null, >> * and this map does not permit null keys or values >> + * @throws NullPointerException if oldValue is null and this map does not >> + * permit null values >> + * (optional) >> >> >> More curious than anything else, is it fine to have two declarations of NPE here? > > Having two @throws looks a little strange to me. Putting it together??? > > * @throws NullPointerException if a specified key or newValue is null, > * and this map does not permit null keys or values. If > * oldValue is null and this map does not permit null values > * (optional). > > Is this even right? Should the implNote not be part of the NPE throws? It seems fine to state: * @throws NullPointerException if the specified key, newValue or oldValue is null, * and this map does not permit null values (...) And let the @implSpec refine things for the default implementation. > Do you want replace to be used to put an initial value ( where previously unset (null) )? > Not according to what is currently defined: * Replaces the entry for the specified key only if currently * mapped to the specified value. Paul. From peter.levart at gmail.com Mon Jul 29 18:29:18 2013 From: peter.levart at gmail.com (Peter Levart) Date: Mon, 29 Jul 2013 20:29:18 +0200 Subject: class SplittableRandom In-Reply-To: <480BCC80-2A9C-4321-B81B-47487E90C0D7@oracle.com> References: <51DDB26D.8050506@cs.oswego.edu> <51DE6069.2060308@gmail.com> <51DEA230.2060504@cs.oswego.edu> <51DEA3D5.5000509@oracle.com> <51E1549D.4060403@cs.oswego.edu> <51E414C6.9070400@cs.oswego.edu> <6099D28A-0B95-42A4-A59B-5E1C465EDCA9@oracle.com> <480BCC80-2A9C-4321-B81B-47487E90C0D7@oracle.com> Message-ID: <51F6B47E.1040102@gmail.com> On 07/16/2013 06:01 PM, Guy Steele wrote: > On Jul 16, 2013, at 3:07 AM, Martin Buchholz wrote: >> Read Appleby and Stafford ... >> >> Hmmm.... mix32 has almost the same job as mix64 - have all the bits in the seed affect all the bits in the output, so the obvious implementation is >> >> mix32() { return (int) mix64(); } >> or more conservatively >> mix32() { m = mix64(); return (int)m ^ (int)(m >>> 32); } >> although it would be slightly distressing to have nextInt be more expensive than nextLong. > Yes---at first I used exactly > mix32() { return (int) mix64(); } > but was worried about the time it took, which is why I searched for a cheaper mixing function. > >> There might be some clever way of doing murmurhash-style mixing when the input is 64-bit and the output is 32-bit that can do better, but I don't think the current mix32 is it. > Again, I was astonished that so simply a mixing function seemed to do the job as far as Dieharder is concerned. I agree that it does appear to perform poorly for sparse gamma values. So now the question is: do such sparse gamma values arise in practice? > > As Doug has pointed out, we carefully made the two-argument constructor private so that the user cannot specify gamma values. The gamma values are derived only from the gamma-seed 0, using the gamma value GAMMA_GAMMA, and always running the seed through mix64. > > I wrote a little test (code and output below) to generate the first 16 billion (well, 2^34+1) gamma values actually generated and gather certain statistics: > (1) the number of 1-bits in the gamma value (output of Long.bitCount) > (2) the "width" of the gamma value (64 - Long.numberOfLeadingBits(gamma) - Long.numberOfTrailingBits(gamma)) > Then it histograms the bit counts, and for each possible bit count tracks the minimum width for gammas having that same bit count. > Whenever the number of of gammas examined is one more than a power of 2, it prints a report consisting of those two tables and the min over the minwidth table. > > Here's a brief summary: > > For the first 65 gamma values, no gamma value has fewer than 21 1-bits or more than 41 1-bits. The minimum width is 57. So I predict there will be no weird mixing problems at all when using SplittableRandom to do a balanced split of a stream of generated randoms. > > For the first 2^16+1 = 65537 gamma values, the minimum bit count is 15, the maximum bit count is 50 and the minimum width is 45. > > For the first 2^24+1 gamma values, the minimum bit count is 12, the maximum bit count is 52 and the minimum width is 35. > > For the first 2^32+1 gamma values, the minimum bit count is 9, the maximum bit count is 55 and the minimum width is 28. > > For the first 2^34+1 gamma values, the minimum bit count is 8, the maximum bit count is 56 and the minimum width is 28. > > So I think we will not hit any really bad gamma values in practice. > > --Guy > Hi, Would it be possible to skip gammas with less than 12 or more than 52 bits? I did some playing with dieharder a week ago, testing SR.nextInt() (mix32) and indeed for sparse gamma values, all dieharder tests show failure. In particular test id=1 (diehard_operm5) is the least forgiving, requiring minimum gamma bit count being about 11 and maximum about 54 in order for such "random" gamma to produce nextInt() bit streams that pass the diehard_operm5 test. Here's a sample of the first 3 dieharder tests (0,1 and 2) for differently sparsed "random" gammas: https://raw.github.com/plevart/lambda-hacks/SplittableRandom/SplittableRandom/nextInt_results_0to2.txt The alternative: public int nextIntAlt1() { return (int) mix64(nextSeed()); } ... does not exhibit this weakness. It seems to be satisfied with gammas having as few as 1 or as many as 63 bits set to pass dieharder tests: https://raw.github.com/plevart/lambda-hacks/SplittableRandom/SplittableRandom/nextIntAlt1_results_0to2.txt But such nextInt is slower, approximately as fast as ThreadLocalRandom.nextInt() by my measurements. Random streams created by SplittableRandom.nextLong() (mix64) also don't exhibit weaknesses with sparse gammas, so I thought why not using mix64() to produce 64 bits of randomness that is then returned by two consecutive calls to nextInt, like that: private int nextInt; private boolean nextIntZero; public int nextIntAlt2() { if (nextInt != 0) { int result = nextInt; nextInt = 0; return result; } else if (nextIntZero) { nextIntZero = false; return 0; } else { long nextLong = mix64(nextSeed()); nextInt = (int)(nextLong >>> 32); if (nextInt == 0) nextIntZero = true; return (int)(nextLong & 0xFFFFFFFFL); } } The (little-Indian) bitstream produced by nextIntAlt2() is exactly the same as that produced by nextLong() and 1st 3 dieharder tests pass with sparse gammas too: https://raw.github.com/plevart/lambda-hacks/SplittableRandom/SplittableRandom/nextIntAlt2_results_0to2.txt the measurements produced by micro benchmark show performance somewhere between nextInt() and nextIntAlt1(): Benchmark Thr Cnt Sec Mean Mean error Var Units s.g.t.JmhTest.SR_nextInt 1 8 5 477779.670 1151.048 865504.410 ops/msec s.g.t.JmhTest.SR_nextIntAlt1 1 8 5 385630.764 513.779 172439.034 ops/msec s.g.t.JmhTest.SR_nextIntAlt2 1 8 5 432071.940 572.221 213899.640 ops/msec s.g.t.JmhTest.TLR_nextInt 1 8 5 382334.416 28.907 545.871 ops/msec Here's the JMH micro benchmark I used: https://github.com/plevart/lambda-hacks/blob/SplittableRandom/SplittableRandom/src/sr/JmhTest.java Here's the code I used to produce dieharder reports: https://github.com/plevart/lambda-hacks/blob/SplittableRandom/SplittableRandom/src/sr/Test.java which uses the following utility class to interface dieharder tool: https://github.com/plevart/lambda-hacks/blob/SplittableRandom/SplittableRandom/src/si/pele/dieharder/DieharderTest.java Regards, Peter From paul.sandoz at oracle.com Mon Jul 29 18:52:40 2013 From: paul.sandoz at oracle.com (paul.sandoz at oracle.com) Date: Mon, 29 Jul 2013 18:52:40 +0000 Subject: hg: jdk8/tl/jdk: 8020156: TreeMap.values().spliterator() does not report ORDERED; ... Message-ID: <20130729185304.6C75748456@hg.openjdk.java.net> Changeset: e83fc6d9cf03 Author: psandoz Date: 2013-07-29 19:41 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/e83fc6d9cf03 8020156: TreeMap.values().spliterator() does not report ORDERED 8020009: TreeMap.entrySet().spliterator() reports SORTED + null comparator but the elements are not Comparable Reviewed-by: mduigou ! src/share/classes/java/util/TreeMap.java + test/java/util/Spliterator/SpliteratorCharacteristics.java From nicholas+openjdk at nicholaswilliams.net Mon Jul 29 19:03:08 2013 From: nicholas+openjdk at nicholaswilliams.net (Nick Williams) Date: Mon, 29 Jul 2013 14:03:08 -0500 Subject: Classes on the stack trace (was: getElementClass/StackTraceElement, was: @CallerSensitive public API, was: sun.reflect.Reflection.getCallerClass) In-Reply-To: References: <00313922-A81A-49DE-9B4B-D56BC8A6D4BC@nicholaswilliams.net> <51F66C76.10209@redhat.com> Message-ID: <4E98395F-FCBA-43CC-A479-90603FA3BBB0@nicholaswilliams.net> Some interesting things to note: 1) Someone has been asking for a public API replacement for getCallerClass() since Java 4 (http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4851444). I /would/ have been asking for this for that long, except I haven't needed it until recently and assumed it already existed. .NET has had an API similar to what I proposed below since .NET 1.1. 2) http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8014925 discusses the change to getCallerClass(int) and says it will be completely removed (with no system property to re-enable) as early as 7u55. The bug then talks about how feedback needs to be solicited on how the community is using it so that a public API, if needed, can be created. This is that feedback, and the answer appears to be a resounding YES, a public API needs to replace it because this change is disastrous for many projects. As Paul says, at the very least getCallerClass(int) should keep working like it does in <7u25 (with or without a system property) through the rest of Java 7 and Java 8 if a replacement public API is not adopted. 3) The performance test numbers below don't reflect the fact that some use cases (like Log4j) have to use Thread/Throwable#getStackTrace() AND Reflection/SecurityManager. These use cases need the method name/line number AND the Class instance. If Reflection#getCallerClass() is taken away from us and SecurityManager#getClassContext() is unavailable (possible if an existing SecurityManager prohibits instantiating the SecurityManager class), these use cases have to call getStackTrace() and THEN Class#forName() for each StackTraceElement. I'm sure you can see where performance becomes a serious issue at that point. The proposed API below was designed to solve all of the uses cases that have been discussed in a well-performing way. Nick On Jul 29, 2013, at 10:47 AM, J?rn Huxhorn wrote: > The numbers are from this link: http://stackoverflow.com/questions/421280/in-java-how-do-i-find-the-caller-of-a-method-using-stacktrace-or-reflection > > Even if this benchmark suffers from micro-benchmark issues: > a slow-down of 10x would be bad, a slow-down of 100x would be a catastrophe. > > I'd suggest to at least postpone the UnsupportedOperationException change until we find a suitable replacement. This change will also break existing Groovy scripts. See http://jira.codehaus.org/browse/GROOVY-6279 - but there are other issues as well. > > Cheers, > J?rn. > > On 29. Juli 2013 at 16:49:02, Nicholas Williams (nicholas+openjdk at nicholaswilliams.net) wrote: > > I wasn't the one who ran the test, so I don't know for sure. My theory > was that getCallerClass() returns a single frame, but the > SecurityManager must allocate an array of appropriate size (which > involves some overhead) and then return all of the frames. I chalked > the difference up to that. My conclusion from the data was: If you > need a whole stack, SecurityManager is clearly the best option. If you > need a single frame, getCallerClass() is the only option that makes > any sense. > > On Mon, Jul 29, 2013 at 8:21 AM, David M. Lloyd wrote: >> I find it very interesting that reflection is no less than two orders of >> magnitude faster than the security manager solution. How big was the stack >> in these tests? It makes me wonder if maybe the implementation of the >> security manager's getContext() method should be reevaluated a bit. >> >> >> On 07/29/2013 07:53 AM, Nick Williams wrote: >>> >>> Just so that everyone understands how important this subject is, this >>> change to getCallerClass(...) is being labeled a "disaster" for logging >>> frameworks everywhere. Here's a benchmark for getting Classes from the >>> following methods: >>> >>>> 1,000,000 calls of all alternatives were measured as follows : >>>> Reflection: 10.195 ms. >>>> Current Thread StackTrace: 5886.964 ms. >>>> Throwable StackTrace: 4700.073 ms. >>>> SecurityManager: 1046.804 ms. >>> >>> >>> My goal here is to get the entire list engaged in coming up with the right >>> solution. We (the community) can't afford for Java 8 not to have an >>> equivalent replacement for getCallerClass(). >>> >>> Nick >>> >>> On Jul 27, 2013, at 2:01 PM, Nick Williams wrote: >>> >>>> All, >>>> >>>> In the last two months, there have been a number of discussions >>>> surrounding stack traces, Classes on the stack trace, and caller classes >>>> [1], [2], [3]. These are all related discussions and the solution to them is >>>> equally related, so I wanted to consolidate it all into this one discussion >>>> where I hope we can finalize on a solution and get it implemented for Java >>>> 8. >>>> >>>> In a nut shell, here are the underlying needs that I have seen expressed >>>> through many, many messages: >>>> >>>> - Some code needs to get the Class of the caller of the current method, >>>> skipping any reflection methods. >>>> - Some code needs to get the Class of the caller /n/ stack frames before >>>> the current method, skipping any reflection methods. >>>> - Some code needs to get the current stack trace, populated with Classes, >>>> Executables, file names, line numbers, and native flags instead of the >>>> String class names and String method names in StackTraceElement. This >>>> /should/ include any reflection methods, just like StackTraceElement[]s. >>>> - Some code needs to get the stack trace from when a Throwable was >>>> created, populated with Classes, Executables, file names, line numbers, and >>>> native flags instead of the String class names and String method names in >>>> StackTraceElement. This /should/ include any reflection methods, just like >>>> StackTraceElement[]s. >>>> - There needs to be a reflection way to achieve all of this since some >>>> libraries (e.g., Log4j) need to be compiled against Java 6 but run on 7 and >>>> 8 (and thus can't use @CallerSensitive). >>>> >>>> I believe the solutions to these needs are all related. Importantly, I >>>> think it is very important that action be taken in Java 8 due to the changes >>>> made to sun.reflect.Reflection#getCallerClass(...). While we all understand >>>> that relying on private sun.* APIs is not safe, the fact is that many people >>>> have relied on sun.reflect.Reflection#getCallerClass(...) due to the fact >>>> that there is simply no other way to do this in the standard API. This >>>> includes Log4j 2, Logback, SLF4j, and Groovy, some features of which will >>>> stop working correctly in Java 7 >= u25. >>>> >>>> I would point out that this could all easily be solved simply by adding a >>>> getElementClass() method to StackTraceElement, but there was strong >>>> opposition to this, largely due to serialization issues. Since that is >>>> apparently not an option, I propose the following API, based on the various >>>> discussions in the last two months, StackTraceElement, and the API that .NET >>>> provides to achieve the same needs as listed above: >>>> >>>> CallerSensitive.java: >>>> package java.lang; >>>> >>>> /** Previously private API, now public */ >>>> public @interface CallerSensitive { >>>> ... >>>> } >>>> >>>> StackTraceFrame.java: >>>> package java.lang; >>>> >>>> import java.util.Objects. >>>> >>>> public final class StackTraceFrame { >>>> private final Class declaringClass; >>>> private final Executable executable; >>>> private final String fileName; >>>> private final int lineNumber; >>>> >>>> public StackTraceFrame(Class declaringClass, Executable >>>> executable, String fileName, int lineNumber) { >>>> this.declaringClass = Objects.requireNonNull(declaringClass, >>>> "Declaring class is null"); >>>> this.executable = Objects.requireNonNull(executable, "Executable >>>> is null"); >>>> this.fileName = fileName; >>>> this.lineNumber = lineNumber; >>>> } >>>> >>>> public Class getDeclaringClass() { >>>> return this.declaringClass; >>>> } >>>> >>>> public Executable getExecutable() { >>>> return this.executable; >>>> } >>>> >>>> public String getFileName() { >>>> return this.fileName; >>>> } >>>> >>>> public int getLineNumber() { >>>> return this.lineNumber; >>>> } >>>> >>>> public boolean isNative() { >>>> return this.lineNumber == -2; >>>> } >>>> >>>> public String toString() { /* Same as StackTraceElement */ } >>>> public boolean equals() { /* Ditto */ } >>>> public int hashCode() { /* Ditto */ } >>>> >>>> /** Uses @CallerSensitive */ >>>> public static native StackTraceFrame getCallerFrame(); >>>> >>>> /** Works like Java < 7u25 sun.reflect.Reflection#getCallerClass() >>>> */ >>>> public static native StackTraceFrame getCallerFrame(int skipFrames); >>>> >>>> public static native StackTraceFrame[] getCurrentStackTrace(); >>>> } >>>> >>>> Throwable.java: >>>> package java.lang; >>>> >>>> ... >>>> >>>> public class Throwable { >>>> ... >>>> public synchronized Throwable fillInStackTraceFrames() { ... } >>>> >>>> private native Throwable fillInStackTraceFrames(int dummy); >>>> >>>> public StackTraceFrame[] getStackTraceFrames() { >>>> return this.getOurStackTraceFrames().clone(); >>>> } >>>> >>>> private synchronized StackTraceFrame[] getOurStackTraceFrames() { >>>> ... } >>>> ... >>>> } >>>> >>>> Furthermore, I propose that we restore the behavior of >>>> sun.reflect.Reflection#getCallerClass(int) /just for Java 7/ since the >>>> proposed above solution cannot be added to Java 7. >>>> >>>> I would love if we could quickly coalesce around this solution or a >>>> derivative thereof so that it can be implemented before Feature Complete. >>>> The absence of any replacement or alternative for >>>> sun.reflect.Reflection#getCallerClass(int) will be a serious issue in Java 8 >>>> that will cause hardships for many projects. >>>> >>>> [1] >>>> http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-June/018049.html >>>> [2] >>>> http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-June/018349.html, >>>> http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-July/019098.html >>>> [3] >>>> http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-July/018855.html >>> >>> >> >> >> -- >> - DML From brent.christian at oracle.com Mon Jul 29 19:54:08 2013 From: brent.christian at oracle.com (Brent Christian) Date: Mon, 29 Jul 2013 12:54:08 -0700 Subject: Java 8 RFR 8011194: Apps launched via double-clicked .jars have file.encoding value of US-ASCII on Mac OS X In-Reply-To: <51F5FA02.9020909@oracle.com> References: <51F2B781.1050104@oracle.com> <51F5FA02.9020909@oracle.com> Message-ID: <51F6C860.4020000@oracle.com> On 7/28/13 10:13 PM, David Holmes wrote: > On 27/07/2013 3:53 AM, Brent Christian wrote: >> Please review my fix for 8011194 : "Apps launched via double-clicked >> .jars have file.encoding value of US-ASCII on Mac OS X" >> >> http://bugs.sun.com/view_bug.do?bug_id=8011194 >> >> In most cases of launching a Java app on Mac (from the cmdline, or from >> a native .app bundle), reading and displaying UTF-8 characters beyond >> the standard ASCII range works fine. >> >> A notable exception is the launching of an app by double-clicking a .jar >> file. In this case, file.encoding defaults to US-ASCII, and characters >> outside of the ASCII range show up as garbage. > > Why does this occur? What sets the encoding to US-ASCII? "US-ASCII" is the answer we get from nl_langinfo(CODESET) because no values for LANG/LC* are set in the environment when double-clicking a .jar. We get "UTF-8" when launching from the command line because the default Terminal.app setup on Mac will setup LANG for you (to "en_US.UTF-8" in the US). -Brent From brian.burkhalter at oracle.com Mon Jul 29 20:06:47 2013 From: brian.burkhalter at oracle.com (Brian Burkhalter) Date: Mon, 29 Jul 2013 13:06:47 -0700 Subject: Java 8 RFR 8020539: Clean up doclint problems in java.util package, part 2 In-Reply-To: <51F6142A.2080201@oracle.com> References: <50FE640E-DC42-47F2-9FAD-8472A013EB9B@oracle.com> <51E77802.8070001@oracle.com> <67232DB5-4077-4A4D-9729-B06C7FD911BF@oracle.com> <51F6142A.2080201@oracle.com> Message-ID: Joe / Chris: The updated webrev is in the same place, http://cr.openjdk.java.net/~bpb/8020539/ If this looks good I will need an approval. On Jul 29, 2013, at 12:05 AM, Joe Darcy wrote: > I recommend a few changes here: > > * For readability, rename "NonASCIIDigit" as "NonAsciiDigit" Changed. > * Since Scanner is in the regex package, it may be more appropriate to stick more of a regex notation than an ebnf notation, but keeping the definition list structure tags. Changed back to regex notation. >> >>> Offhand, I wasn't aware Dequeue and Queue were maintained in Doug's CVS, but I agree changes to those files should flow through there first. >> Deque and Queue removed from the webrev: >> >> http://cr.openjdk.java.net/~bpb/8020539/ >> > > Otherwise, the changes look fine. If you like, the non-Scanner changes can be split out and pushed first. I've left it as one changeset. On Jul 29, 2013, at 2:43 AM, Chris Hegarty wrote: > Looks fine ( I did not go through the Scanner changes ). > > Some minor comments: > > 1) List > Trivially I wonder why you decided to go with '< '>', rather > than
                                                                    {@code ... }
                                                                    , which I think is more readable. Changed. > 2) Map > Trivially, I would keep the @param's order the same as the actual > method parameters order. Changed. > 3) Optional > Strangely, there doesn't appear to be a '@param' for the class level > type T. doclint is not warning about this either. Not changed. Thanks, Brian From jhuxhorn at googlemail.com Mon Jul 29 20:57:31 2013 From: jhuxhorn at googlemail.com (=?UTF-8?Q?J=C3=B6rn_Huxhorn?=) Date: Mon, 29 Jul 2013 22:57:31 +0200 Subject: =?UTF-8?Q?Re=3A_Classes_on_the_stack_trace_(was=3A_getElementClass/StackTraceElement=2C_was=3A_=40CallerSensitive_public_API=2C_was=3A_sun.reflect.Reflection.getCallerClass)?= In-Reply-To: <4E98395F-FCBA-43CC-A479-90603FA3BBB0@nicholaswilliams.net> References: <00313922-A81A-49DE-9B4B-D56BC8A6D4BC@nicholaswilliams.net> <51F66C76.10209@redhat.com> <4E98395F-FCBA-43CC-A479-90603FA3BBB0@nicholaswilliams.net> Message-ID: I second all of that. It was my understanding that the whole purpose of EA and DP was pinpointing problems like these before they hit consumers. What's the point of them if feedback can't cause the reverting of a breaking change? If this is not rectified then the old "Java is slow"-mantra will once again be quite true. That, and lots of applications will break since not everyone updating to j7u40 will also update all libraries that currently depend on that method - if a timely fix will exist at all at that point. Throwing UnsupportedOperationException all of a sudden isn't exactly the most subtle way of handling this. And please don't argue that everyone should just add that runtime property. This isn't realistic. On 29. Juli 2013 at 21:03:10, Nick Williams (nicholas+openjdk at nicholaswilliams.net) wrote: Some interesting things to note: 1) Someone has been asking for a public API replacement for getCallerClass() since Java 4 (http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4851444). I /would/ have been asking for this for that long, except I haven't needed it until recently and assumed it already existed. .NET has had an API similar to what I proposed below since .NET 1.1. 2)?http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8014925?discusses the change to getCallerClass(int) and says it will be completely removed (with no system property to re-enable) as early as 7u55. The bug then talks about how feedback needs to be solicited on how the community is using it so that a public API, if needed, can be created. This is that feedback, and the answer appears to be a resounding YES, a public API needs to replace it because this change is disastrous for many projects. As Paul says, at the very least getCallerClass(int) should keep working like it does in <7u25 (with or without a system property) through the rest of Java 7 and Java 8 if a replacement public API is not adopted. 3) The performance test numbers below don't reflect the fact that some use cases (like Log4j) have to use Thread/Throwable#getStackTrace() AND Reflection/SecurityManager. These use cases need the method name/line number AND the Class instance. If Reflection#getCallerClass() is taken away from us and SecurityManager#getClassContext() is unavailable (possible if an existing SecurityManager prohibits instantiating the SecurityManager class), these use cases have to call getStackTrace() and THEN Class#forName() for each StackTraceElement. I'm sure you can see where performance becomes a serious issue at that point. The proposed API below was designed to solve all of the uses cases that have been discussed in a well-performing way. Nick On Jul 29, 2013, at 10:47 AM, J?rn Huxhorn wrote: The numbers are from this link:?http://stackoverflow.com/questions/421280/in-java-how-do-i-find-the-caller-of-a-method-using-stacktrace-or-reflection Even if this benchmark suffers from micro-benchmark issues: a slow-down of 10x would be bad, a slow-down of 100x would be a catastrophe. I'd suggest to at least postpone the UnsupportedOperationException change until we find a suitable replacement. This change will also break existing Groovy scripts. See?http://jira.codehaus.org/browse/GROOVY-6279?- but there are other issues as well. Cheers, J?rn. On 29. Juli 2013 at 16:49:02, Nicholas Williams (nicholas+openjdk at nicholaswilliams.net) wrote: I wasn't the one who ran the test, so I don't know for sure. My theory ? was that getCallerClass() returns a single frame, but the ? SecurityManager must allocate an array of appropriate size (which ? involves some overhead) and then return all of the frames. I chalked ? the difference up to that. My conclusion from the data was: If you ? need a whole stack, SecurityManager is clearly the best option. If you ? need a single frame, getCallerClass() is the only option that makes ? any sense. ? On Mon, Jul 29, 2013 at 8:21 AM, David M. Lloyd wrote: ? I find it very interesting that reflection is no less than two orders of ? magnitude faster than the security manager solution. How big was the stack ? in these tests? It makes me wonder if maybe the implementation of the ? security manager's getContext() method should be reevaluated a bit. ? On 07/29/2013 07:53 AM, Nick Williams wrote: ? Just so that everyone understands how important this subject is, this ? change to getCallerClass(...) is being labeled a "disaster" for logging ? frameworks everywhere. Here's a benchmark for getting Classes from the ? following methods: ? 1,000,000 calls of all alternatives were measured as follows : ? Reflection: 10.195 ms. ? Current Thread StackTrace: 5886.964 ms. ? Throwable StackTrace: 4700.073 ms. ? SecurityManager: 1046.804 ms. ? My goal here is to get the entire list engaged in coming up with the right ? solution. We (the community) can't afford for Java 8 not to have an ? equivalent replacement for getCallerClass(). ? Nick ? On Jul 27, 2013, at 2:01 PM, Nick Williams wrote: ? All, ? In the last two months, there have been a number of discussions ? surrounding stack traces, Classes on the stack trace, and caller classes ? [1], [2], [3]. These are all related discussions and the solution to them is ? equally related, so I wanted to consolidate it all into this one discussion ? where I hope we can finalize on a solution and get it implemented for Java ? 8. ? In a nut shell, here are the underlying needs that I have seen expressed ? through many, many messages: ? - Some code needs to get the Class of the caller of the current method, ? skipping any reflection methods. ? - Some code needs to get the Class of the caller /n/ stack frames before ? the current method, skipping any reflection methods. ? - Some code needs to get the current stack trace, populated with Classes, ? Executables, file names, line numbers, and native flags instead of the ? String class names and String method names in StackTraceElement. This ? /should/ include any reflection methods, just like StackTraceElement[]s. ? - Some code needs to get the stack trace from when a Throwable was ? created, populated with Classes, Executables, file names, line numbers, and ? native flags instead of the String class names and String method names in ? StackTraceElement. This /should/ include any reflection methods, just like ? StackTraceElement[]s. ? - There needs to be a reflection way to achieve all of this since some ? libraries (e.g., Log4j) need to be compiled against Java 6 but run on 7 and ? 8 (and thus can't use @CallerSensitive). ? I believe the solutions to these needs are all related. Importantly, I ? think it is very important that action be taken in Java 8 due to the changes ? made to sun.reflect.Reflection#getCallerClass(...). While we all understand ? that relying on private sun.* APIs is not safe, the fact is that many people ? have relied on sun.reflect.Reflection#getCallerClass(...) due to the fact ? that there is simply no other way to do this in the standard API. This ? includes Log4j 2, Logback, SLF4j, and Groovy, some features of which will ? stop working correctly in Java 7 >= u25. ? I would point out that this could all easily be solved simply by adding a ? getElementClass() method to StackTraceElement, but there was strong ? opposition to this, largely due to serialization issues. Since that is ? apparently not an option, I propose the following API, based on the various ? discussions in the last two months, StackTraceElement, and the API that .NET ? provides to achieve the same needs as listed above: ? CallerSensitive.java: ? package java.lang; ? /** Previously private API, now public */ ? public @interface CallerSensitive { ? ... ? } ? StackTraceFrame.java: ? package java.lang; ? import java.util.Objects. ? public final class StackTraceFrame { ? private final Class declaringClass; ? private final Executable executable; ? private final String fileName; ? private final int lineNumber; ? public StackTraceFrame(Class declaringClass, Executable ? executable, String fileName, int lineNumber) { ? this.declaringClass = Objects.requireNonNull(declaringClass, ? "Declaring class is null"); ? this.executable = Objects.requireNonNull(executable, "Executable ? is null"); ? this.fileName = fileName; ? this.lineNumber = lineNumber; ? } ? public Class getDeclaringClass() { ? return this.declaringClass; ? } ? public Executable getExecutable() { ? return this.executable; ? } ? public String getFileName() { ? return this.fileName; ? } ? public int getLineNumber() { ? return this.lineNumber; ? } ? public boolean isNative() { ? return this.lineNumber == -2; ? } ? public String toString() { /* Same as StackTraceElement */ } ? public boolean equals() { /* Ditto */ } ? public int hashCode() { /* Ditto */ } ? /** Uses @CallerSensitive */ ? public static native StackTraceFrame getCallerFrame(); ? /** Works like Java < 7u25 sun.reflect.Reflection#getCallerClass() ? */ ? public static native StackTraceFrame getCallerFrame(int skipFrames); ? public static native StackTraceFrame[] getCurrentStackTrace(); ? } ? Throwable.java: ? package java.lang; ? ... ? public class Throwable { ? ... ? public synchronized Throwable fillInStackTraceFrames() { ... } ? private native Throwable fillInStackTraceFrames(int dummy); ? public StackTraceFrame[] getStackTraceFrames() { ? return this.getOurStackTraceFrames().clone(); ? } ? private synchronized StackTraceFrame[] getOurStackTraceFrames() { ? ... } ? ... ? } ? Furthermore, I propose that we restore the behavior of ? sun.reflect.Reflection#getCallerClass(int) /just for Java 7/ since the ? proposed above solution cannot be added to Java 7. ? I would love if we could quickly coalesce around this solution or a ? derivative thereof so that it can be implemented before Feature Complete. ? The absence of any replacement or alternative for ? sun.reflect.Reflection#getCallerClass(int) will be a serious issue in Java 8 ? that will cause hardships for many projects. ? [1] ? http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-June/018049.html ? [2] ? http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-June/018349.html, ? http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-July/019098.html ? [3] ? http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-July/018855.html ? -- ? - DML From jason.uh at oracle.com Mon Jul 29 21:31:49 2013 From: jason.uh at oracle.com (jason.uh at oracle.com) Date: Mon, 29 Jul 2013 21:31:49 +0000 Subject: hg: jdk8/tl/jdk: 8012971: PKCS11Test hiding exception failures Message-ID: <20130729213215.976924845E@hg.openjdk.java.net> Changeset: c042fd498f79 Author: ascarpino Date: 2013-07-19 11:34 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/c042fd498f79 8012971: PKCS11Test hiding exception failures Reviewed-by: vinnie, valeriep ! test/ProblemList.txt ! test/sun/security/pkcs11/PKCS11Test.java ! test/sun/security/pkcs11/SecmodTest.java From jason.uh at oracle.com Mon Jul 29 21:33:20 2013 From: jason.uh at oracle.com (jason.uh at oracle.com) Date: Mon, 29 Jul 2013 21:33:20 +0000 Subject: hg: jdk8/tl/jdk: 8020424: The NSS version should be detected before running crypto tests Message-ID: <20130729213332.186E64845F@hg.openjdk.java.net> Changeset: e47569593fa0 Author: ascarpino Date: 2013-07-29 13:43 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/e47569593fa0 8020424: The NSS version should be detected before running crypto tests Reviewed-by: valeriep ! test/ProblemList.txt ! test/sun/security/pkcs11/KeyStore/SecretKeysBasic.java ! test/sun/security/pkcs11/PKCS11Test.java + test/sun/security/pkcs11/README ! test/sun/security/pkcs11/ec/ReadCertificates.java ! test/sun/security/pkcs11/ec/TestCurves.java ! test/sun/security/pkcs11/ec/TestECDH.java ! test/sun/security/pkcs11/ec/TestECDH2.java ! test/sun/security/pkcs11/ec/TestECDSA.java ! test/sun/security/pkcs11/ec/TestECDSA2.java ! test/sun/security/pkcs11/ec/TestECGenSpec.java ! test/sun/security/pkcs11/ec/TestKeyFactory.java From david.lloyd at redhat.com Mon Jul 29 21:59:09 2013 From: david.lloyd at redhat.com (David M. Lloyd) Date: Mon, 29 Jul 2013 16:59:09 -0500 Subject: Classes on the stack trace (was: getElementClass/StackTraceElement, was: @CallerSensitive public API, was: sun.reflect.Reflection.getCallerClass) In-Reply-To: References: <00313922-A81A-49DE-9B4B-D56BC8A6D4BC@nicholaswilliams.net> <51F66C76.10209@redhat.com> <4E98395F-FCBA-43CC-A479-90603FA3BBB0@nicholaswilliams.net> Message-ID: <51F6E5AD.6030802@redhat.com> I expect that at this stage, patches speak louder than words :) On 07/29/2013 03:57 PM, J?rn Huxhorn wrote: > I second all of that. > > It was my understanding that the whole purpose of EA and DP was pinpointing problems like these before they hit consumers. What's the point of them if feedback can't cause the reverting of a breaking change? > > If this is not rectified then the old "Java is slow"-mantra will once again be quite true. > That, and lots of applications will break since not everyone updating to j7u40 will also update all libraries that currently depend on that method - if a timely fix will exist at all at that point. Throwing UnsupportedOperationException all of a sudden isn't exactly the most subtle way of handling this. > > And please don't argue that everyone should just add that runtime property. This isn't realistic. > On 29. Juli 2013 at 21:03:10, Nick Williams (nicholas+openjdk at nicholaswilliams.net) wrote: > > Some interesting things to note: > > 1) Someone has been asking for a public API replacement for getCallerClass() since Java 4 (http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4851444). I /would/ have been asking for this for that long, except I haven't needed it until recently and assumed it already existed. .NET has had an API similar to what I proposed below since .NET 1.1. > > 2) http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8014925 discusses the change to getCallerClass(int) and says it will be completely removed (with no system property to re-enable) as early as 7u55. The bug then talks about how feedback needs to be solicited on how the community is using it so that a public API, if needed, can be created. This is that feedback, and the answer appears to be a resounding YES, a public API needs to replace it because this change is disastrous for many projects. As Paul says, at the very least getCallerClass(int) should keep working like it does in <7u25 (with or without a system property) through the rest of Java 7 and Java 8 if a replacement public API is not adopted. > > 3) The performance test numbers below don't reflect the fact that some use cases (like Log4j) have to use Thread/Throwable#getStackTrace() AND Reflection/SecurityManager. These use cases need the method name/line number AND the Class instance. If Reflection#getCallerClass() is taken away from us and SecurityManager#getClassContext() is unavailable (possible if an existing SecurityManager prohibits instantiating the SecurityManager class), these use cases have to call getStackTrace() and THEN Class#forName() for each StackTraceElement. I'm sure you can see where performance becomes a serious issue at that point. The proposed API below was designed to solve all of the uses cases that have been discussed in a well-performing way. > > Nick > > On Jul 29, 2013, at 10:47 AM, J?rn Huxhorn wrote: > > The numbers are from this link: http://stackoverflow.com/questions/421280/in-java-how-do-i-find-the-caller-of-a-method-using-stacktrace-or-reflection > > Even if this benchmark suffers from micro-benchmark issues: > a slow-down of 10x would be bad, a slow-down of 100x would be a catastrophe. > > I'd suggest to at least postpone the UnsupportedOperationException change until we find a suitable replacement. This change will also break existing Groovy scripts. See http://jira.codehaus.org/browse/GROOVY-6279 - but there are other issues as well. > > Cheers, > J?rn. > > On 29. Juli 2013 at 16:49:02, Nicholas Williams (nicholas+openjdk at nicholaswilliams.net) wrote: > > I wasn't the one who ran the test, so I don't know for sure. My theory > was that getCallerClass() returns a single frame, but the > SecurityManager must allocate an array of appropriate size (which > involves some overhead) and then return all of the frames. I chalked > the difference up to that. My conclusion from the data was: If you > need a whole stack, SecurityManager is clearly the best option. If you > need a single frame, getCallerClass() is the only option that makes > any sense. > > On Mon, Jul 29, 2013 at 8:21 AM, David M. Lloyd wrote: > I find it very interesting that reflection is no less than two orders of > magnitude faster than the security manager solution. How big was the stack > in these tests? It makes me wonder if maybe the implementation of the > security manager's getContext() method should be reevaluated a bit. > > > On 07/29/2013 07:53 AM, Nick Williams wrote: > > Just so that everyone understands how important this subject is, this > change to getCallerClass(...) is being labeled a "disaster" for logging > frameworks everywhere. Here's a benchmark for getting Classes from the > following methods: > > 1,000,000 calls of all alternatives were measured as follows : > Reflection: 10.195 ms. > Current Thread StackTrace: 5886.964 ms. > Throwable StackTrace: 4700.073 ms. > SecurityManager: 1046.804 ms. > > > My goal here is to get the entire list engaged in coming up with the right > solution. We (the community) can't afford for Java 8 not to have an > equivalent replacement for getCallerClass(). > > Nick > > On Jul 27, 2013, at 2:01 PM, Nick Williams wrote: > > All, > > In the last two months, there have been a number of discussions > surrounding stack traces, Classes on the stack trace, and caller classes > [1], [2], [3]. These are all related discussions and the solution to them is > equally related, so I wanted to consolidate it all into this one discussion > where I hope we can finalize on a solution and get it implemented for Java > 8. > > In a nut shell, here are the underlying needs that I have seen expressed > through many, many messages: > > - Some code needs to get the Class of the caller of the current method, > skipping any reflection methods. > - Some code needs to get the Class of the caller /n/ stack frames before > the current method, skipping any reflection methods. > - Some code needs to get the current stack trace, populated with Classes, > Executables, file names, line numbers, and native flags instead of the > String class names and String method names in StackTraceElement. This > /should/ include any reflection methods, just like StackTraceElement[]s. > - Some code needs to get the stack trace from when a Throwable was > created, populated with Classes, Executables, file names, line numbers, and > native flags instead of the String class names and String method names in > StackTraceElement. This /should/ include any reflection methods, just like > StackTraceElement[]s. > - There needs to be a reflection way to achieve all of this since some > libraries (e.g., Log4j) need to be compiled against Java 6 but run on 7 and > 8 (and thus can't use @CallerSensitive). > > I believe the solutions to these needs are all related. Importantly, I > think it is very important that action be taken in Java 8 due to the changes > made to sun.reflect.Reflection#getCallerClass(...). While we all understand > that relying on private sun.* APIs is not safe, the fact is that many people > have relied on sun.reflect.Reflection#getCallerClass(...) due to the fact > that there is simply no other way to do this in the standard API. This > includes Log4j 2, Logback, SLF4j, and Groovy, some features of which will > stop working correctly in Java 7 >= u25. > > I would point out that this could all easily be solved simply by adding a > getElementClass() method to StackTraceElement, but there was strong > opposition to this, largely due to serialization issues. Since that is > apparently not an option, I propose the following API, based on the various > discussions in the last two months, StackTraceElement, and the API that .NET > provides to achieve the same needs as listed above: > > CallerSensitive.java: > package java.lang; > > /** Previously private API, now public */ > public @interface CallerSensitive { > ... > } > > StackTraceFrame.java: > package java.lang; > > import java.util.Objects. > > public final class StackTraceFrame { > private final Class declaringClass; > private final Executable executable; > private final String fileName; > private final int lineNumber; > > public StackTraceFrame(Class declaringClass, Executable > executable, String fileName, int lineNumber) { > this.declaringClass = Objects.requireNonNull(declaringClass, > "Declaring class is null"); > this.executable = Objects.requireNonNull(executable, "Executable > is null"); > this.fileName = fileName; > this.lineNumber = lineNumber; > } > > public Class getDeclaringClass() { > return this.declaringClass; > } > > public Executable getExecutable() { > return this.executable; > } > > public String getFileName() { > return this.fileName; > } > > public int getLineNumber() { > return this.lineNumber; > } > > public boolean isNative() { > return this.lineNumber == -2; > } > > public String toString() { /* Same as StackTraceElement */ } > public boolean equals() { /* Ditto */ } > public int hashCode() { /* Ditto */ } > > /** Uses @CallerSensitive */ > public static native StackTraceFrame getCallerFrame(); > > /** Works like Java < 7u25 sun.reflect.Reflection#getCallerClass() > */ > public static native StackTraceFrame getCallerFrame(int skipFrames); > > public static native StackTraceFrame[] getCurrentStackTrace(); > } > > Throwable.java: > package java.lang; > > ... > > public class Throwable { > ... > public synchronized Throwable fillInStackTraceFrames() { ... } > > private native Throwable fillInStackTraceFrames(int dummy); > > public StackTraceFrame[] getStackTraceFrames() { > return this.getOurStackTraceFrames().clone(); > } > > private synchronized StackTraceFrame[] getOurStackTraceFrames() { > ... } > ... > } > > Furthermore, I propose that we restore the behavior of > sun.reflect.Reflection#getCallerClass(int) /just for Java 7/ since the > proposed above solution cannot be added to Java 7. > > I would love if we could quickly coalesce around this solution or a > derivative thereof so that it can be implemented before Feature Complete. > The absence of any replacement or alternative for > sun.reflect.Reflection#getCallerClass(int) will be a serious issue in Java 8 > that will cause hardships for many projects. > > [1] > http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-June/018049.html > [2] > http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-June/018349.html, > http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-July/019098.html > [3] > http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-July/018855.html > > > > > -- > - DML > -- - DML From nicholas+openjdk at nicholaswilliams.net Mon Jul 29 22:16:46 2013 From: nicholas+openjdk at nicholaswilliams.net (Nick Williams) Date: Mon, 29 Jul 2013 17:16:46 -0500 Subject: Classes on the stack trace (was: getElementClass/StackTraceElement, was: @CallerSensitive public API, was: sun.reflect.Reflection.getCallerClass) In-Reply-To: <51F6E5AD.6030802@redhat.com> References: <00313922-A81A-49DE-9B4B-D56BC8A6D4BC@nicholaswilliams.net> <51F66C76.10209@redhat.com> <4E98395F-FCBA-43CC-A479-90603FA3BBB0@nicholaswilliams.net> <51F6E5AD.6030802@redhat.com> Message-ID: <5C6626B4-347B-48BC-AC80-9D632FC9DC7B@nicholaswilliams.net> I would happily contribute a patch if I were able to. However, I have almost no idea what I'm doing on the native side, and I spent three hours perusing the Mercurial repository and still can't figure out where anything is. Even so, I would be willing to try. But I can't just blindly make up a patch. I need some kind of guidance as to what you're looking for. Is the API I propose below acceptable? If I propose a patch implementing that API /and it is generally accepted as correct/ is it going to be accepted? Or am I going to spend significant time trying to figure it out with the possibility that it might be rejected merely because of the API. My goal in this email was to get the community to coalesce around an API. Once that happens, if nobody more qualified than I is willing or has time to implement it I will surely give it a try. But I don't want the start working on something that the community is going to reject, especially having not received any feedback on this API so far. Nick On Jul 29, 2013, at 4:59 PM, David M. Lloyd wrote: > I expect that at this stage, patches speak louder than words :) > > On 07/29/2013 03:57 PM, J?rn Huxhorn wrote: >> I second all of that. >> >> It was my understanding that the whole purpose of EA and DP was pinpointing problems like these before they hit consumers. What's the point of them if feedback can't cause the reverting of a breaking change? >> >> If this is not rectified then the old "Java is slow"-mantra will once again be quite true. >> That, and lots of applications will break since not everyone updating to j7u40 will also update all libraries that currently depend on that method - if a timely fix will exist at all at that point. Throwing UnsupportedOperationException all of a sudden isn't exactly the most subtle way of handling this. >> >> And please don't argue that everyone should just add that runtime property. This isn't realistic. >> On 29. Juli 2013 at 21:03:10, Nick Williams (nicholas+openjdk at nicholaswilliams.net) wrote: >> >> Some interesting things to note: >> >> 1) Someone has been asking for a public API replacement for getCallerClass() since Java 4 (http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4851444). I /would/ have been asking for this for that long, except I haven't needed it until recently and assumed it already existed. .NET has had an API similar to what I proposed below since .NET 1.1. >> >> 2) http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8014925 discusses the change to getCallerClass(int) and says it will be completely removed (with no system property to re-enable) as early as 7u55. The bug then talks about how feedback needs to be solicited on how the community is using it so that a public API, if needed, can be created. This is that feedback, and the answer appears to be a resounding YES, a public API needs to replace it because this change is disastrous for many projects. As Paul says, at the very least getCallerClass(int) should keep working like it does in <7u25 (with or without a system property) through the rest of Java 7 and Java 8 if a replacement public API is not adopted. >> >> 3) The performance test numbers below don't reflect the fact that some use cases (like Log4j) have to use Thread/Throwable#getStackTrace() AND Reflection/SecurityManager. These use cases need the method name/line number AND the Class instance. If Reflection#getCallerClass() is taken away from us and SecurityManager#getClassContext() is unavailable (possible if an existing SecurityManager prohibits instantiating the SecurityManager class), these use cases have to call getStackTrace() and THEN Class#forName() for each StackTraceElement. I'm sure you can see where performance becomes a serious issue at that point. The proposed API below was designed to solve all of the uses cases that have been discussed in a well-performing way. >> >> Nick >> >> On Jul 29, 2013, at 10:47 AM, J?rn Huxhorn wrote: >> >> The numbers are from this link: http://stackoverflow.com/questions/421280/in-java-how-do-i-find-the-caller-of-a-method-using-stacktrace-or-reflection >> >> Even if this benchmark suffers from micro-benchmark issues: >> a slow-down of 10x would be bad, a slow-down of 100x would be a catastrophe. >> >> I'd suggest to at least postpone the UnsupportedOperationException change until we find a suitable replacement. This change will also break existing Groovy scripts. See http://jira.codehaus.org/browse/GROOVY-6279 - but there are other issues as well. >> >> Cheers, >> J?rn. >> >> On 29. Juli 2013 at 16:49:02, Nicholas Williams (nicholas+openjdk at nicholaswilliams.net) wrote: >> >> I wasn't the one who ran the test, so I don't know for sure. My theory >> was that getCallerClass() returns a single frame, but the >> SecurityManager must allocate an array of appropriate size (which >> involves some overhead) and then return all of the frames. I chalked >> the difference up to that. My conclusion from the data was: If you >> need a whole stack, SecurityManager is clearly the best option. If you >> need a single frame, getCallerClass() is the only option that makes >> any sense. >> >> On Mon, Jul 29, 2013 at 8:21 AM, David M. Lloyd wrote: >> I find it very interesting that reflection is no less than two orders of >> magnitude faster than the security manager solution. How big was the stack >> in these tests? It makes me wonder if maybe the implementation of the >> security manager's getContext() method should be reevaluated a bit. >> >> >> On 07/29/2013 07:53 AM, Nick Williams wrote: >> >> Just so that everyone understands how important this subject is, this >> change to getCallerClass(...) is being labeled a "disaster" for logging >> frameworks everywhere. Here's a benchmark for getting Classes from the >> following methods: >> >> 1,000,000 calls of all alternatives were measured as follows : >> Reflection: 10.195 ms. >> Current Thread StackTrace: 5886.964 ms. >> Throwable StackTrace: 4700.073 ms. >> SecurityManager: 1046.804 ms. >> >> >> My goal here is to get the entire list engaged in coming up with the right >> solution. We (the community) can't afford for Java 8 not to have an >> equivalent replacement for getCallerClass(). >> >> Nick >> >> On Jul 27, 2013, at 2:01 PM, Nick Williams wrote: >> >> All, >> >> In the last two months, there have been a number of discussions >> surrounding stack traces, Classes on the stack trace, and caller classes >> [1], [2], [3]. These are all related discussions and the solution to them is >> equally related, so I wanted to consolidate it all into this one discussion >> where I hope we can finalize on a solution and get it implemented for Java >> 8. >> >> In a nut shell, here are the underlying needs that I have seen expressed >> through many, many messages: >> >> - Some code needs to get the Class of the caller of the current method, >> skipping any reflection methods. >> - Some code needs to get the Class of the caller /n/ stack frames before >> the current method, skipping any reflection methods. >> - Some code needs to get the current stack trace, populated with Classes, >> Executables, file names, line numbers, and native flags instead of the >> String class names and String method names in StackTraceElement. This >> /should/ include any reflection methods, just like StackTraceElement[]s. >> - Some code needs to get the stack trace from when a Throwable was >> created, populated with Classes, Executables, file names, line numbers, and >> native flags instead of the String class names and String method names in >> StackTraceElement. This /should/ include any reflection methods, just like >> StackTraceElement[]s. >> - There needs to be a reflection way to achieve all of this since some >> libraries (e.g., Log4j) need to be compiled against Java 6 but run on 7 and >> 8 (and thus can't use @CallerSensitive). >> >> I believe the solutions to these needs are all related. Importantly, I >> think it is very important that action be taken in Java 8 due to the changes >> made to sun.reflect.Reflection#getCallerClass(...). While we all understand >> that relying on private sun.* APIs is not safe, the fact is that many people >> have relied on sun.reflect.Reflection#getCallerClass(...) due to the fact >> that there is simply no other way to do this in the standard API. This >> includes Log4j 2, Logback, SLF4j, and Groovy, some features of which will >> stop working correctly in Java 7 >= u25. >> >> I would point out that this could all easily be solved simply by adding a >> getElementClass() method to StackTraceElement, but there was strong >> opposition to this, largely due to serialization issues. Since that is >> apparently not an option, I propose the following API, based on the various >> discussions in the last two months, StackTraceElement, and the API that .NET >> provides to achieve the same needs as listed above: >> >> CallerSensitive.java: >> package java.lang; >> >> /** Previously private API, now public */ >> public @interface CallerSensitive { >> ... >> } >> >> StackTraceFrame.java: >> package java.lang; >> >> import java.util.Objects. >> >> public final class StackTraceFrame { >> private final Class declaringClass; >> private final Executable executable; >> private final String fileName; >> private final int lineNumber; >> >> public StackTraceFrame(Class declaringClass, Executable >> executable, String fileName, int lineNumber) { >> this.declaringClass = Objects.requireNonNull(declaringClass, >> "Declaring class is null"); >> this.executable = Objects.requireNonNull(executable, "Executable >> is null"); >> this.fileName = fileName; >> this.lineNumber = lineNumber; >> } >> >> public Class getDeclaringClass() { >> return this.declaringClass; >> } >> >> public Executable getExecutable() { >> return this.executable; >> } >> >> public String getFileName() { >> return this.fileName; >> } >> >> public int getLineNumber() { >> return this.lineNumber; >> } >> >> public boolean isNative() { >> return this.lineNumber == -2; >> } >> >> public String toString() { /* Same as StackTraceElement */ } >> public boolean equals() { /* Ditto */ } >> public int hashCode() { /* Ditto */ } >> >> /** Uses @CallerSensitive */ >> public static native StackTraceFrame getCallerFrame(); >> >> /** Works like Java < 7u25 sun.reflect.Reflection#getCallerClass() >> */ >> public static native StackTraceFrame getCallerFrame(int skipFrames); >> >> public static native StackTraceFrame[] getCurrentStackTrace(); >> } >> >> Throwable.java: >> package java.lang; >> >> ... >> >> public class Throwable { >> ... >> public synchronized Throwable fillInStackTraceFrames() { ... } >> >> private native Throwable fillInStackTraceFrames(int dummy); >> >> public StackTraceFrame[] getStackTraceFrames() { >> return this.getOurStackTraceFrames().clone(); >> } >> >> private synchronized StackTraceFrame[] getOurStackTraceFrames() { >> ... } >> ... >> } >> >> Furthermore, I propose that we restore the behavior of >> sun.reflect.Reflection#getCallerClass(int) /just for Java 7/ since the >> proposed above solution cannot be added to Java 7. >> >> I would love if we could quickly coalesce around this solution or a >> derivative thereof so that it can be implemented before Feature Complete. >> The absence of any replacement or alternative for >> sun.reflect.Reflection#getCallerClass(int) will be a serious issue in Java 8 >> that will cause hardships for many projects. >> >> [1] >> http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-June/018049.html >> [2] >> http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-June/018349.html, >> http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-July/019098.html >> [3] >> http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-July/018855.html >> >> >> >> >> -- >> - DML >> > > > -- > - DML From david.lloyd at redhat.com Mon Jul 29 22:41:07 2013 From: david.lloyd at redhat.com (David M. Lloyd) Date: Mon, 29 Jul 2013 17:41:07 -0500 Subject: Classes on the stack trace (was: getElementClass/StackTraceElement, was: @CallerSensitive public API, was: sun.reflect.Reflection.getCallerClass) In-Reply-To: <5C6626B4-347B-48BC-AC80-9D632FC9DC7B@nicholaswilliams.net> References: <00313922-A81A-49DE-9B4B-D56BC8A6D4BC@nicholaswilliams.net> <51F66C76.10209@redhat.com> <4E98395F-FCBA-43CC-A479-90603FA3BBB0@nicholaswilliams.net> <51F6E5AD.6030802@redhat.com> <5C6626B4-347B-48BC-AC80-9D632FC9DC7B@nicholaswilliams.net> Message-ID: <51F6EF83.2080703@redhat.com> I don't see how Throwables could be deserialized with the proposed changes to that class (Class.forName() only works when everything is visible from one class loader - a trivial case which is rarely true in practice, especially in an app server situation). I think you'd have to leave that part off. Other than that, I think StackTraceFrame would definitely be very useful; I think that adding a public getCallerClass(int) method is a lot more realistic though. Unfortunately I'm not sure the Executable is actually physically available at runtime in hotspot - certainly not as an actual Executable in any case. At the very least though, generalizing access to the classes on the call stack would have a lot of uses. We know that it is possible to access the call stack, given that there are at least two places which do it, so maybe it makes sense to build from there. On 07/29/2013 05:16 PM, Nick Williams wrote: > I would happily contribute a patch if I were able to. However, I have almost no idea what I'm doing on the native side, and I spent three hours perusing the Mercurial repository and still can't figure out where anything is. > > Even so, I would be willing to try. But I can't just blindly make up a patch. I need some kind of guidance as to what you're looking for. Is the API I propose below acceptable? If I propose a patch implementing that API /and it is generally accepted as correct/ is it going to be accepted? Or am I going to spend significant time trying to figure it out with the possibility that it might be rejected merely because of the API. > > My goal in this email was to get the community to coalesce around an API. Once that happens, if nobody more qualified than I is willing or has time to implement it I will surely give it a try. But I don't want the start working on something that the community is going to reject, especially having not received any feedback on this API so far. > > Nick > > On Jul 29, 2013, at 4:59 PM, David M. Lloyd wrote: > >> I expect that at this stage, patches speak louder than words :) >> >> On 07/29/2013 03:57 PM, J?rn Huxhorn wrote: >>> I second all of that. >>> >>> It was my understanding that the whole purpose of EA and DP was pinpointing problems like these before they hit consumers. What's the point of them if feedback can't cause the reverting of a breaking change? >>> >>> If this is not rectified then the old "Java is slow"-mantra will once again be quite true. >>> That, and lots of applications will break since not everyone updating to j7u40 will also update all libraries that currently depend on that method - if a timely fix will exist at all at that point. Throwing UnsupportedOperationException all of a sudden isn't exactly the most subtle way of handling this. >>> >>> And please don't argue that everyone should just add that runtime property. This isn't realistic. >>> On 29. Juli 2013 at 21:03:10, Nick Williams (nicholas+openjdk at nicholaswilliams.net) wrote: >>> >>> Some interesting things to note: >>> >>> 1) Someone has been asking for a public API replacement for getCallerClass() since Java 4 (http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4851444). I /would/ have been asking for this for that long, except I haven't needed it until recently and assumed it already existed. .NET has had an API similar to what I proposed below since .NET 1.1. >>> >>> 2) http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8014925 discusses the change to getCallerClass(int) and says it will be completely removed (with no system property to re-enable) as early as 7u55. The bug then talks about how feedback needs to be solicited on how the community is using it so that a public API, if needed, can be created. This is that feedback, and the answer appears to be a resounding YES, a public API needs to replace it because this change is disastrous for many projects. As Paul says, at the very least getCallerClass(int) should keep working like it does in <7u25 (with or without a system property) through the rest of Java 7 and Java 8 if a replacement public API is not adopted. >>> >>> 3) The performance test numbers below don't reflect the fact that some use cases (like Log4j) have to use Thread/Throwable#getStackTrace() AND Reflection/SecurityManager. These use cases need the method name/line number AND the Class instance. If Reflection#getCallerClass() is taken away from us and SecurityManager#getClassContext() is unavailable (possible if an existing SecurityManager prohibits instantiating the SecurityManager class), these use cases have to call getStackTrace() and THEN Class#forName() for each StackTraceElement. I'm sure you can see where performance becomes a serious issue at that point. The proposed API below was designed to solve all of the uses cases that have been discussed in a well-performing way. >>> >>> Nick >>> >>> On Jul 29, 2013, at 10:47 AM, J?rn Huxhorn wrote: >>> >>> The numbers are from this link: http://stackoverflow.com/questions/421280/in-java-how-do-i-find-the-caller-of-a-method-using-stacktrace-or-reflection >>> >>> Even if this benchmark suffers from micro-benchmark issues: >>> a slow-down of 10x would be bad, a slow-down of 100x would be a catastrophe. >>> >>> I'd suggest to at least postpone the UnsupportedOperationException change until we find a suitable replacement. This change will also break existing Groovy scripts. See http://jira.codehaus.org/browse/GROOVY-6279 - but there are other issues as well. >>> >>> Cheers, >>> J?rn. >>> >>> On 29. Juli 2013 at 16:49:02, Nicholas Williams (nicholas+openjdk at nicholaswilliams.net) wrote: >>> >>> I wasn't the one who ran the test, so I don't know for sure. My theory >>> was that getCallerClass() returns a single frame, but the >>> SecurityManager must allocate an array of appropriate size (which >>> involves some overhead) and then return all of the frames. I chalked >>> the difference up to that. My conclusion from the data was: If you >>> need a whole stack, SecurityManager is clearly the best option. If you >>> need a single frame, getCallerClass() is the only option that makes >>> any sense. >>> >>> On Mon, Jul 29, 2013 at 8:21 AM, David M. Lloyd wrote: >>> I find it very interesting that reflection is no less than two orders of >>> magnitude faster than the security manager solution. How big was the stack >>> in these tests? It makes me wonder if maybe the implementation of the >>> security manager's getContext() method should be reevaluated a bit. >>> >>> >>> On 07/29/2013 07:53 AM, Nick Williams wrote: >>> >>> Just so that everyone understands how important this subject is, this >>> change to getCallerClass(...) is being labeled a "disaster" for logging >>> frameworks everywhere. Here's a benchmark for getting Classes from the >>> following methods: >>> >>> 1,000,000 calls of all alternatives were measured as follows : >>> Reflection: 10.195 ms. >>> Current Thread StackTrace: 5886.964 ms. >>> Throwable StackTrace: 4700.073 ms. >>> SecurityManager: 1046.804 ms. >>> >>> >>> My goal here is to get the entire list engaged in coming up with the right >>> solution. We (the community) can't afford for Java 8 not to have an >>> equivalent replacement for getCallerClass(). >>> >>> Nick >>> >>> On Jul 27, 2013, at 2:01 PM, Nick Williams wrote: >>> >>> All, >>> >>> In the last two months, there have been a number of discussions >>> surrounding stack traces, Classes on the stack trace, and caller classes >>> [1], [2], [3]. These are all related discussions and the solution to them is >>> equally related, so I wanted to consolidate it all into this one discussion >>> where I hope we can finalize on a solution and get it implemented for Java >>> 8. >>> >>> In a nut shell, here are the underlying needs that I have seen expressed >>> through many, many messages: >>> >>> - Some code needs to get the Class of the caller of the current method, >>> skipping any reflection methods. >>> - Some code needs to get the Class of the caller /n/ stack frames before >>> the current method, skipping any reflection methods. >>> - Some code needs to get the current stack trace, populated with Classes, >>> Executables, file names, line numbers, and native flags instead of the >>> String class names and String method names in StackTraceElement. This >>> /should/ include any reflection methods, just like StackTraceElement[]s. >>> - Some code needs to get the stack trace from when a Throwable was >>> created, populated with Classes, Executables, file names, line numbers, and >>> native flags instead of the String class names and String method names in >>> StackTraceElement. This /should/ include any reflection methods, just like >>> StackTraceElement[]s. >>> - There needs to be a reflection way to achieve all of this since some >>> libraries (e.g., Log4j) need to be compiled against Java 6 but run on 7 and >>> 8 (and thus can't use @CallerSensitive). >>> >>> I believe the solutions to these needs are all related. Importantly, I >>> think it is very important that action be taken in Java 8 due to the changes >>> made to sun.reflect.Reflection#getCallerClass(...). While we all understand >>> that relying on private sun.* APIs is not safe, the fact is that many people >>> have relied on sun.reflect.Reflection#getCallerClass(...) due to the fact >>> that there is simply no other way to do this in the standard API. This >>> includes Log4j 2, Logback, SLF4j, and Groovy, some features of which will >>> stop working correctly in Java 7 >= u25. >>> >>> I would point out that this could all easily be solved simply by adding a >>> getElementClass() method to StackTraceElement, but there was strong >>> opposition to this, largely due to serialization issues. Since that is >>> apparently not an option, I propose the following API, based on the various >>> discussions in the last two months, StackTraceElement, and the API that .NET >>> provides to achieve the same needs as listed above: >>> >>> CallerSensitive.java: >>> package java.lang; >>> >>> /** Previously private API, now public */ >>> public @interface CallerSensitive { >>> ... >>> } >>> >>> StackTraceFrame.java: >>> package java.lang; >>> >>> import java.util.Objects. >>> >>> public final class StackTraceFrame { >>> private final Class declaringClass; >>> private final Executable executable; >>> private final String fileName; >>> private final int lineNumber; >>> >>> public StackTraceFrame(Class declaringClass, Executable >>> executable, String fileName, int lineNumber) { >>> this.declaringClass = Objects.requireNonNull(declaringClass, >>> "Declaring class is null"); >>> this.executable = Objects.requireNonNull(executable, "Executable >>> is null"); >>> this.fileName = fileName; >>> this.lineNumber = lineNumber; >>> } >>> >>> public Class getDeclaringClass() { >>> return this.declaringClass; >>> } >>> >>> public Executable getExecutable() { >>> return this.executable; >>> } >>> >>> public String getFileName() { >>> return this.fileName; >>> } >>> >>> public int getLineNumber() { >>> return this.lineNumber; >>> } >>> >>> public boolean isNative() { >>> return this.lineNumber == -2; >>> } >>> >>> public String toString() { /* Same as StackTraceElement */ } >>> public boolean equals() { /* Ditto */ } >>> public int hashCode() { /* Ditto */ } >>> >>> /** Uses @CallerSensitive */ >>> public static native StackTraceFrame getCallerFrame(); >>> >>> /** Works like Java < 7u25 sun.reflect.Reflection#getCallerClass() >>> */ >>> public static native StackTraceFrame getCallerFrame(int skipFrames); >>> >>> public static native StackTraceFrame[] getCurrentStackTrace(); >>> } >>> >>> Throwable.java: >>> package java.lang; >>> >>> ... >>> >>> public class Throwable { >>> ... >>> public synchronized Throwable fillInStackTraceFrames() { ... } >>> >>> private native Throwable fillInStackTraceFrames(int dummy); >>> >>> public StackTraceFrame[] getStackTraceFrames() { >>> return this.getOurStackTraceFrames().clone(); >>> } >>> >>> private synchronized StackTraceFrame[] getOurStackTraceFrames() { >>> ... } >>> ... >>> } >>> >>> Furthermore, I propose that we restore the behavior of >>> sun.reflect.Reflection#getCallerClass(int) /just for Java 7/ since the >>> proposed above solution cannot be added to Java 7. >>> >>> I would love if we could quickly coalesce around this solution or a >>> derivative thereof so that it can be implemented before Feature Complete. >>> The absence of any replacement or alternative for >>> sun.reflect.Reflection#getCallerClass(int) will be a serious issue in Java 8 >>> that will cause hardships for many projects. >>> >>> [1] >>> http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-June/018049.html >>> [2] >>> http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-June/018349.html, >>> http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-July/019098.html >>> [3] >>> http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-July/018855.html >>> >>> >>> >>> >>> -- >>> - DML >>> >> >> >> -- >> - DML > -- - DML From pbenedict at apache.org Mon Jul 29 22:48:06 2013 From: pbenedict at apache.org (Paul Benedict) Date: Mon, 29 Jul 2013 17:48:06 -0500 Subject: Classes on the stack trace (was: getElementClass/StackTraceElement, was: @CallerSensitive public API, was: sun.reflect.Reflection.getCallerClass) Message-ID: +1 with Nick. There's no point in submitting a patch unless someone who is in charge of Core Libs Dev is willing to first offer technical direction. Where does Oracle want to go with the solution? There are no official responses -- it's been quiet on their front for sometime. I don't know if that means the proposal is being ignored, or there are offline discussions happening, or people are enjoying summer vacations, or something else. I just don't know. Isn't this where someone usually speaks up to "sponsor" a commit? -- Cheers, Paul > Nick Williams wrote: > > I would happily contribute a patch if I were able to. However, I have > almost no idea what I'm doing on the native side, and I spent three > hours perusing the Mercurial repository and still can't figure out > where anything is. > > Even so, I would be willing to try. But I can't just blindly make up > a patch. I need some kind of guidance as to what you're looking for. > Is the API I propose below acceptable? If I propose a patch implementing > that API /and it is generally accepted as correct/ is it going to be > accepted? Or am I going to spend significant time trying to figure it > out with the possibility that it might be rejected merely because of > the API. > > My goal in this email was to get the community to coalesce around an > API. Once that happens, if nobody more qualified than I is willing > or has time to implement it I will surely give it a try. But I don't > want the start working on something that the community is going to > reject, especially having not received any feedback on this API > so far. > > Nick From nicholas+openjdk at nicholaswilliams.net Mon Jul 29 23:21:23 2013 From: nicholas+openjdk at nicholaswilliams.net (Nick Williams) Date: Mon, 29 Jul 2013 18:21:23 -0500 Subject: Classes on the stack trace (was: getElementClass/StackTraceElement, was: @CallerSensitive public API, was: sun.reflect.Reflection.getCallerClass) In-Reply-To: <51F6EF83.2080703@redhat.com> References: <00313922-A81A-49DE-9B4B-D56BC8A6D4BC@nicholaswilliams.net> <51F66C76.10209@redhat.com> <4E98395F-FCBA-43CC-A479-90603FA3BBB0@nicholaswilliams.net> <51F6E5AD.6030802@redhat.com> <5C6626B4-347B-48BC-AC80-9D632FC9DC7B@nicholaswilliams.net> <51F6EF83.2080703@redhat.com> Message-ID: Okay. Some questions then: 1) Instead of Executable, StackTraceFrame could simply have the method name. Using Executable would be more future-proof (I anticipate someone wanting to know that someday), so if it turns out it's available I'd prefer to use it, but if it's not physically available there we'll have to do without and simply use the method name. Sound reasonable? 2) StackTraceElement is serializable, and Class is serializable, so in theory StackTraceFrame could be serializable and technically Throwable would be serializable. I would have to follow the same serialization rules that Throwable follows for its StackTraceElement[], but it's doable. The question is deserialization, which as you pointed out won't work if a class on the trace isn't available in the ClassLoader that deserialization is occurring in. I would be fine with, and even suggest, making the StackTraceFrame[] transient so that it wasn't serialized with the exception. I think that's better than omitting it from Throwable altogether. (However, I would point out that my original suggestion of adding the Class to StackTraceElement was shot down for serialization reasons, and when I suggested making it transient that was also shot down.) Being able to obtain the Classes from the stack trace in an exception is one of the key features that Log4j needs, so leaving out any way to obtain this from a Throwable would be disappointing. I think making it transient is OK. I can't imagine still needing the Class from a deserialized Throwable. Thoughts? 3) What about getCallerFrame() and getCallerFrame(int) (as I suggested) AND getCallerClass() and getCallerClass(int) (as you mentioned)? That should create the best of both worlds. 4) What about @CallerSensitive? Part of my proposal was moving that to java.lang. There is a LOT of code that's currently using the private @CallerSensitive. How should I handle that? 5) What about Java 7? As has been widely reported, this change broke a lot of code running on Java 7. We're starting to get near-daily reports of problems now. The proposed idea is to forget about the system property in Java 7 and restore getCallerClass(int) to it's previous operation. How should I proceed on that? 6) Is there, as Paul Benedict suggested, someone willing to sponsor this commit if I create a patch? 7) Any suggestions on what to use and how to get started checking out and creating patches against JDK? I hadn't even heard of Mercurial until I started looking at this issue back in May, and I still don't understand how the project is laid out. Is everything I'm going to need to change within hg.openjdk.java.net/jdk8/jdk8/jdk/? Or are there files in other locations that I'll need to change? Nick On Jul 29, 2013, at 5:41 PM, David M. Lloyd wrote: > I don't see how Throwables could be deserialized with the proposed changes to that class (Class.forName() only works when everything is visible from one class loader - a trivial case which is rarely true in practice, especially in an app server situation). I think you'd have to leave that part off. > > Other than that, I think StackTraceFrame would definitely be very useful; I think that adding a public getCallerClass(int) method is a lot more realistic though. Unfortunately I'm not sure the Executable is actually physically available at runtime in hotspot - certainly not as an actual Executable in any case. > > At the very least though, generalizing access to the classes on the call stack would have a lot of uses. We know that it is possible to access the call stack, given that there are at least two places which do it, so maybe it makes sense to build from there. > > On 07/29/2013 05:16 PM, Nick Williams wrote: >> I would happily contribute a patch if I were able to. However, I have almost no idea what I'm doing on the native side, and I spent three hours perusing the Mercurial repository and still can't figure out where anything is. >> >> Even so, I would be willing to try. But I can't just blindly make up a patch. I need some kind of guidance as to what you're looking for. Is the API I propose below acceptable? If I propose a patch implementing that API /and it is generally accepted as correct/ is it going to be accepted? Or am I going to spend significant time trying to figure it out with the possibility that it might be rejected merely because of the API. >> >> My goal in this email was to get the community to coalesce around an API. Once that happens, if nobody more qualified than I is willing or has time to implement it I will surely give it a try. But I don't want the start working on something that the community is going to reject, especially having not received any feedback on this API so far. >> >> Nick >> >> On Jul 29, 2013, at 4:59 PM, David M. Lloyd wrote: >> >>> I expect that at this stage, patches speak louder than words :) >>> >>> On 07/29/2013 03:57 PM, J?rn Huxhorn wrote: >>>> I second all of that. >>>> >>>> It was my understanding that the whole purpose of EA and DP was pinpointing problems like these before they hit consumers. What's the point of them if feedback can't cause the reverting of a breaking change? >>>> >>>> If this is not rectified then the old "Java is slow"-mantra will once again be quite true. >>>> That, and lots of applications will break since not everyone updating to j7u40 will also update all libraries that currently depend on that method - if a timely fix will exist at all at that point. Throwing UnsupportedOperationException all of a sudden isn't exactly the most subtle way of handling this. >>>> >>>> And please don't argue that everyone should just add that runtime property. This isn't realistic. >>>> On 29. Juli 2013 at 21:03:10, Nick Williams (nicholas+openjdk at nicholaswilliams.net) wrote: >>>> >>>> Some interesting things to note: >>>> >>>> 1) Someone has been asking for a public API replacement for getCallerClass() since Java 4 (http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4851444). I /would/ have been asking for this for that long, except I haven't needed it until recently and assumed it already existed. .NET has had an API similar to what I proposed below since .NET 1.1. >>>> >>>> 2) http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8014925 discusses the change to getCallerClass(int) and says it will be completely removed (with no system property to re-enable) as early as 7u55. The bug then talks about how feedback needs to be solicited on how the community is using it so that a public API, if needed, can be created. This is that feedback, and the answer appears to be a resounding YES, a public API needs to replace it because this change is disastrous for many projects. As Paul says, at the very least getCallerClass(int) should keep working like it does in <7u25 (with or without a system property) through the rest of Java 7 and Java 8 if a replacement public API is not adopted. >>>> >>>> 3) The performance test numbers below don't reflect the fact that some use cases (like Log4j) have to use Thread/Throwable#getStackTrace() AND Reflection/SecurityManager. These use cases need the method name/line number AND the Class instance. If Reflection#getCallerClass() is taken away from us and SecurityManager#getClassContext() is unavailable (possible if an existing SecurityManager prohibits instantiating the SecurityManager class), these use cases have to call getStackTrace() and THEN Class#forName() for each StackTraceElement. I'm sure you can see where performance becomes a serious issue at that point. The proposed API below was designed to solve all of the uses cases that have been discussed in a well-performing way. >>>> >>>> Nick >>>> >>>> On Jul 29, 2013, at 10:47 AM, J?rn Huxhorn wrote: >>>> >>>> The numbers are from this link: http://stackoverflow.com/questions/421280/in-java-how-do-i-find-the-caller-of-a-method-using-stacktrace-or-reflection >>>> >>>> Even if this benchmark suffers from micro-benchmark issues: >>>> a slow-down of 10x would be bad, a slow-down of 100x would be a catastrophe. >>>> >>>> I'd suggest to at least postpone the UnsupportedOperationException change until we find a suitable replacement. This change will also break existing Groovy scripts. See http://jira.codehaus.org/browse/GROOVY-6279 - but there are other issues as well. >>>> >>>> Cheers, >>>> J?rn. >>>> >>>> On 29. Juli 2013 at 16:49:02, Nicholas Williams (nicholas+openjdk at nicholaswilliams.net) wrote: >>>> >>>> I wasn't the one who ran the test, so I don't know for sure. My theory >>>> was that getCallerClass() returns a single frame, but the >>>> SecurityManager must allocate an array of appropriate size (which >>>> involves some overhead) and then return all of the frames. I chalked >>>> the difference up to that. My conclusion from the data was: If you >>>> need a whole stack, SecurityManager is clearly the best option. If you >>>> need a single frame, getCallerClass() is the only option that makes >>>> any sense. >>>> >>>> On Mon, Jul 29, 2013 at 8:21 AM, David M. Lloyd wrote: >>>> I find it very interesting that reflection is no less than two orders of >>>> magnitude faster than the security manager solution. How big was the stack >>>> in these tests? It makes me wonder if maybe the implementation of the >>>> security manager's getContext() method should be reevaluated a bit. >>>> >>>> >>>> On 07/29/2013 07:53 AM, Nick Williams wrote: >>>> >>>> Just so that everyone understands how important this subject is, this >>>> change to getCallerClass(...) is being labeled a "disaster" for logging >>>> frameworks everywhere. Here's a benchmark for getting Classes from the >>>> following methods: >>>> >>>> 1,000,000 calls of all alternatives were measured as follows : >>>> Reflection: 10.195 ms. >>>> Current Thread StackTrace: 5886.964 ms. >>>> Throwable StackTrace: 4700.073 ms. >>>> SecurityManager: 1046.804 ms. >>>> >>>> >>>> My goal here is to get the entire list engaged in coming up with the right >>>> solution. We (the community) can't afford for Java 8 not to have an >>>> equivalent replacement for getCallerClass(). >>>> >>>> Nick >>>> >>>> On Jul 27, 2013, at 2:01 PM, Nick Williams wrote: >>>> >>>> All, >>>> >>>> In the last two months, there have been a number of discussions >>>> surrounding stack traces, Classes on the stack trace, and caller classes >>>> [1], [2], [3]. These are all related discussions and the solution to them is >>>> equally related, so I wanted to consolidate it all into this one discussion >>>> where I hope we can finalize on a solution and get it implemented for Java >>>> 8. >>>> >>>> In a nut shell, here are the underlying needs that I have seen expressed >>>> through many, many messages: >>>> >>>> - Some code needs to get the Class of the caller of the current method, >>>> skipping any reflection methods. >>>> - Some code needs to get the Class of the caller /n/ stack frames before >>>> the current method, skipping any reflection methods. >>>> - Some code needs to get the current stack trace, populated with Classes, >>>> Executables, file names, line numbers, and native flags instead of the >>>> String class names and String method names in StackTraceElement. This >>>> /should/ include any reflection methods, just like StackTraceElement[]s. >>>> - Some code needs to get the stack trace from when a Throwable was >>>> created, populated with Classes, Executables, file names, line numbers, and >>>> native flags instead of the String class names and String method names in >>>> StackTraceElement. This /should/ include any reflection methods, just like >>>> StackTraceElement[]s. >>>> - There needs to be a reflection way to achieve all of this since some >>>> libraries (e.g., Log4j) need to be compiled against Java 6 but run on 7 and >>>> 8 (and thus can't use @CallerSensitive). >>>> >>>> I believe the solutions to these needs are all related. Importantly, I >>>> think it is very important that action be taken in Java 8 due to the changes >>>> made to sun.reflect.Reflection#getCallerClass(...). While we all understand >>>> that relying on private sun.* APIs is not safe, the fact is that many people >>>> have relied on sun.reflect.Reflection#getCallerClass(...) due to the fact >>>> that there is simply no other way to do this in the standard API. This >>>> includes Log4j 2, Logback, SLF4j, and Groovy, some features of which will >>>> stop working correctly in Java 7 >= u25. >>>> >>>> I would point out that this could all easily be solved simply by adding a >>>> getElementClass() method to StackTraceElement, but there was strong >>>> opposition to this, largely due to serialization issues. Since that is >>>> apparently not an option, I propose the following API, based on the various >>>> discussions in the last two months, StackTraceElement, and the API that .NET >>>> provides to achieve the same needs as listed above: >>>> >>>> CallerSensitive.java: >>>> package java.lang; >>>> >>>> /** Previously private API, now public */ >>>> public @interface CallerSensitive { >>>> ... >>>> } >>>> >>>> StackTraceFrame.java: >>>> package java.lang; >>>> >>>> import java.util.Objects. >>>> >>>> public final class StackTraceFrame { >>>> private final Class declaringClass; >>>> private final Executable executable; >>>> private final String fileName; >>>> private final int lineNumber; >>>> >>>> public StackTraceFrame(Class declaringClass, Executable >>>> executable, String fileName, int lineNumber) { >>>> this.declaringClass = Objects.requireNonNull(declaringClass, >>>> "Declaring class is null"); >>>> this.executable = Objects.requireNonNull(executable, "Executable >>>> is null"); >>>> this.fileName = fileName; >>>> this.lineNumber = lineNumber; >>>> } >>>> >>>> public Class getDeclaringClass() { >>>> return this.declaringClass; >>>> } >>>> >>>> public Executable getExecutable() { >>>> return this.executable; >>>> } >>>> >>>> public String getFileName() { >>>> return this.fileName; >>>> } >>>> >>>> public int getLineNumber() { >>>> return this.lineNumber; >>>> } >>>> >>>> public boolean isNative() { >>>> return this.lineNumber == -2; >>>> } >>>> >>>> public String toString() { /* Same as StackTraceElement */ } >>>> public boolean equals() { /* Ditto */ } >>>> public int hashCode() { /* Ditto */ } >>>> >>>> /** Uses @CallerSensitive */ >>>> public static native StackTraceFrame getCallerFrame(); >>>> >>>> /** Works like Java < 7u25 sun.reflect.Reflection#getCallerClass() >>>> */ >>>> public static native StackTraceFrame getCallerFrame(int skipFrames); >>>> >>>> public static native StackTraceFrame[] getCurrentStackTrace(); >>>> } >>>> >>>> Throwable.java: >>>> package java.lang; >>>> >>>> ... >>>> >>>> public class Throwable { >>>> ... >>>> public synchronized Throwable fillInStackTraceFrames() { ... } >>>> >>>> private native Throwable fillInStackTraceFrames(int dummy); >>>> >>>> public StackTraceFrame[] getStackTraceFrames() { >>>> return this.getOurStackTraceFrames().clone(); >>>> } >>>> >>>> private synchronized StackTraceFrame[] getOurStackTraceFrames() { >>>> ... } >>>> ... >>>> } >>>> >>>> Furthermore, I propose that we restore the behavior of >>>> sun.reflect.Reflection#getCallerClass(int) /just for Java 7/ since the >>>> proposed above solution cannot be added to Java 7. >>>> >>>> I would love if we could quickly coalesce around this solution or a >>>> derivative thereof so that it can be implemented before Feature Complete. >>>> The absence of any replacement or alternative for >>>> sun.reflect.Reflection#getCallerClass(int) will be a serious issue in Java 8 >>>> that will cause hardships for many projects. >>>> >>>> [1] >>>> http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-June/018049.html >>>> [2] >>>> http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-June/018349.html, >>>> http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-July/019098.html >>>> [3] >>>> http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-July/018855.html >>>> >>>> >>>> >>>> >>>> -- >>>> - DML >>>> >>> >>> >>> -- >>> - DML >> > > > -- > - DML From david.lloyd at redhat.com Mon Jul 29 23:43:13 2013 From: david.lloyd at redhat.com (David M. Lloyd) Date: Mon, 29 Jul 2013 18:43:13 -0500 Subject: Classes on the stack trace (was: getElementClass/StackTraceElement, was: @CallerSensitive public API, was: sun.reflect.Reflection.getCallerClass) In-Reply-To: References: <00313922-A81A-49DE-9B4B-D56BC8A6D4BC@nicholaswilliams.net> <51F66C76.10209@redhat.com> <4E98395F-FCBA-43CC-A479-90603FA3BBB0@nicholaswilliams.net> <51F6E5AD.6030802@redhat.com> <5C6626B4-347B-48BC-AC80-9D632FC9DC7B@nicholaswilliams.net> <51F6EF83.2080703@redhat.com> Message-ID: <51F6FE11.2090704@redhat.com> Answers: 1) Seems reasonable enough. 2) I think this will be quite complicated in practice. First, we don't want to obliterate performance, so we need some way to only assemble this information if necessary (assembling two stack traces is likely to be twice as expensive as assembling one, after all). If you solve that issue, you still have to have a sane way to deal with the case where a deserialized exception will simply not have that information present. 3) Yes, that sounds good, but again to me the minimum acceptable functionality would be just the classes. 4) I don't know much about what that annotation actually entails, semantically, so I can't really comment. 5) I think we should continue to lobby Oracle to keep that method around at least until 8. At worst, move it to an openjdk package, so code can detect the right one at runtime. 6) I'm sure if we came up with something reasonable and nobody from Oracle wanted to step up, I could find someone at Red Hat to do it. 7) Franky, HG is junk, and the way OpenJDK uses it is pure torture. But until/unless I figure out a way to maintain a continuous Git mirror (something I kick around once every month or two), I guess we're at its mercy. But the quick guide is, there are actually a bunch of repositories, and you have to check them all out (there's an outer one and several inner ones). Once you implement your changes, you'll have to use "hg diff" to get them out. I have no idea how to make a so-called "webrev", the final step in this insanely crusty stone-age process, but I know people who do. So getting a diff or diffs is really the key step. On 07/29/2013 06:21 PM, Nick Williams wrote: > Okay. Some questions then: > > 1) Instead of Executable, StackTraceFrame could simply have the method name. Using Executable would be more future-proof (I anticipate someone wanting to know that someday), so if it turns out it's available I'd prefer to use it, but if it's not physically available there we'll have to do without and simply use the method name. Sound reasonable? > > 2) StackTraceElement is serializable, and Class is serializable, so in theory StackTraceFrame could be serializable and technically Throwable would be serializable. I would have to follow the same serialization rules that Throwable follows for its StackTraceElement[], but it's doable. The question is deserialization, which as you pointed out won't work if a class on the trace isn't available in the ClassLoader that deserialization is occurring in. I would be fine with, and even suggest, making the StackTraceFrame[] transient so that it wasn't serialized with the exception. I think that's better than omitting it from Throwable altogether. (However, I would point out that my original suggestion of adding the Class to StackTraceElement was shot down for serialization reasons, and when I suggested making it transient that was also shot down.) Being able to obtain the Classes from the stack trace in an exception is one of the key features that Log4j needs, so leaving out any w! ay to obta in this from a Throwable would be disappointing. I think making it transient is OK. I can't imagine still needing the Class from a deserialized Throwable. Thoughts? > > 3) What about getCallerFrame() and getCallerFrame(int) (as I suggested) AND getCallerClass() and getCallerClass(int) (as you mentioned)? That should create the best of both worlds. > > 4) What about @CallerSensitive? Part of my proposal was moving that to java.lang. There is a LOT of code that's currently using the private @CallerSensitive. How should I handle that? > > 5) What about Java 7? As has been widely reported, this change broke a lot of code running on Java 7. We're starting to get near-daily reports of problems now. The proposed idea is to forget about the system property in Java 7 and restore getCallerClass(int) to it's previous operation. How should I proceed on that? > > 6) Is there, as Paul Benedict suggested, someone willing to sponsor this commit if I create a patch? > > 7) Any suggestions on what to use and how to get started checking out and creating patches against JDK? I hadn't even heard of Mercurial until I started looking at this issue back in May, and I still don't understand how the project is laid out. Is everything I'm going to need to change within hg.openjdk.java.net/jdk8/jdk8/jdk/? Or are there files in other locations that I'll need to change? > > Nick > > On Jul 29, 2013, at 5:41 PM, David M. Lloyd wrote: > >> I don't see how Throwables could be deserialized with the proposed changes to that class (Class.forName() only works when everything is visible from one class loader - a trivial case which is rarely true in practice, especially in an app server situation). I think you'd have to leave that part off. >> >> Other than that, I think StackTraceFrame would definitely be very useful; I think that adding a public getCallerClass(int) method is a lot more realistic though. Unfortunately I'm not sure the Executable is actually physically available at runtime in hotspot - certainly not as an actual Executable in any case. >> >> At the very least though, generalizing access to the classes on the call stack would have a lot of uses. We know that it is possible to access the call stack, given that there are at least two places which do it, so maybe it makes sense to build from there. >> >> On 07/29/2013 05:16 PM, Nick Williams wrote: >>> I would happily contribute a patch if I were able to. However, I have almost no idea what I'm doing on the native side, and I spent three hours perusing the Mercurial repository and still can't figure out where anything is. >>> >>> Even so, I would be willing to try. But I can't just blindly make up a patch. I need some kind of guidance as to what you're looking for. Is the API I propose below acceptable? If I propose a patch implementing that API /and it is generally accepted as correct/ is it going to be accepted? Or am I going to spend significant time trying to figure it out with the possibility that it might be rejected merely because of the API. >>> >>> My goal in this email was to get the community to coalesce around an API. Once that happens, if nobody more qualified than I is willing or has time to implement it I will surely give it a try. But I don't want the start working on something that the community is going to reject, especially having not received any feedback on this API so far. >>> >>> Nick >>> >>> On Jul 29, 2013, at 4:59 PM, David M. Lloyd wrote: >>> >>>> I expect that at this stage, patches speak louder than words :) >>>> >>>> On 07/29/2013 03:57 PM, J?rn Huxhorn wrote: >>>>> I second all of that. >>>>> >>>>> It was my understanding that the whole purpose of EA and DP was pinpointing problems like these before they hit consumers. What's the point of them if feedback can't cause the reverting of a breaking change? >>>>> >>>>> If this is not rectified then the old "Java is slow"-mantra will once again be quite true. >>>>> That, and lots of applications will break since not everyone updating to j7u40 will also update all libraries that currently depend on that method - if a timely fix will exist at all at that point. Throwing UnsupportedOperationException all of a sudden isn't exactly the most subtle way of handling this. >>>>> >>>>> And please don't argue that everyone should just add that runtime property. This isn't realistic. >>>>> On 29. Juli 2013 at 21:03:10, Nick Williams (nicholas+openjdk at nicholaswilliams.net) wrote: >>>>> >>>>> Some interesting things to note: >>>>> >>>>> 1) Someone has been asking for a public API replacement for getCallerClass() since Java 4 (http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4851444). I /would/ have been asking for this for that long, except I haven't needed it until recently and assumed it already existed. .NET has had an API similar to what I proposed below since .NET 1.1. >>>>> >>>>> 2) http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8014925 discusses the change to getCallerClass(int) and says it will be completely removed (with no system property to re-enable) as early as 7u55. The bug then talks about how feedback needs to be solicited on how the community is using it so that a public API, if needed, can be created. This is that feedback, and the answer appears to be a resounding YES, a public API needs to replace it because this change is disastrous for many projects. As Paul says, at the very least getCallerClass(int) should keep working like it does in <7u25 (with or without a system property) through the rest of Java 7 and Java 8 if a replacement public API is not adopted. >>>>> >>>>> 3) The performance test numbers below don't reflect the fact that some use cases (like Log4j) have to use Thread/Throwable#getStackTrace() AND Reflection/SecurityManager. These use cases need the method name/line number AND the Class instance. If Reflection#getCallerClass() is taken away from us and SecurityManager#getClassContext() is unavailable (possible if an existing SecurityManager prohibits instantiating the SecurityManager class), these use cases have to call getStackTrace() and THEN Class#forName() for each StackTraceElement. I'm sure you can see where performance becomes a serious issue at that point. The proposed API below was designed to solve all of the uses cases that have been discussed in a well-performing way. >>>>> >>>>> Nick >>>>> >>>>> On Jul 29, 2013, at 10:47 AM, J?rn Huxhorn wrote: >>>>> >>>>> The numbers are from this link: http://stackoverflow.com/questions/421280/in-java-how-do-i-find-the-caller-of-a-method-using-stacktrace-or-reflection >>>>> >>>>> Even if this benchmark suffers from micro-benchmark issues: >>>>> a slow-down of 10x would be bad, a slow-down of 100x would be a catastrophe. >>>>> >>>>> I'd suggest to at least postpone the UnsupportedOperationException change until we find a suitable replacement. This change will also break existing Groovy scripts. See http://jira.codehaus.org/browse/GROOVY-6279 - but there are other issues as well. >>>>> >>>>> Cheers, >>>>> J?rn. >>>>> >>>>> On 29. Juli 2013 at 16:49:02, Nicholas Williams (nicholas+openjdk at nicholaswilliams.net) wrote: >>>>> >>>>> I wasn't the one who ran the test, so I don't know for sure. My theory >>>>> was that getCallerClass() returns a single frame, but the >>>>> SecurityManager must allocate an array of appropriate size (which >>>>> involves some overhead) and then return all of the frames. I chalked >>>>> the difference up to that. My conclusion from the data was: If you >>>>> need a whole stack, SecurityManager is clearly the best option. If you >>>>> need a single frame, getCallerClass() is the only option that makes >>>>> any sense. >>>>> >>>>> On Mon, Jul 29, 2013 at 8:21 AM, David M. Lloyd wrote: >>>>> I find it very interesting that reflection is no less than two orders of >>>>> magnitude faster than the security manager solution. How big was the stack >>>>> in these tests? It makes me wonder if maybe the implementation of the >>>>> security manager's getContext() method should be reevaluated a bit. >>>>> >>>>> >>>>> On 07/29/2013 07:53 AM, Nick Williams wrote: >>>>> >>>>> Just so that everyone understands how important this subject is, this >>>>> change to getCallerClass(...) is being labeled a "disaster" for logging >>>>> frameworks everywhere. Here's a benchmark for getting Classes from the >>>>> following methods: >>>>> >>>>> 1,000,000 calls of all alternatives were measured as follows : >>>>> Reflection: 10.195 ms. >>>>> Current Thread StackTrace: 5886.964 ms. >>>>> Throwable StackTrace: 4700.073 ms. >>>>> SecurityManager: 1046.804 ms. >>>>> >>>>> >>>>> My goal here is to get the entire list engaged in coming up with the right >>>>> solution. We (the community) can't afford for Java 8 not to have an >>>>> equivalent replacement for getCallerClass(). >>>>> >>>>> Nick >>>>> >>>>> On Jul 27, 2013, at 2:01 PM, Nick Williams wrote: >>>>> >>>>> All, >>>>> >>>>> In the last two months, there have been a number of discussions >>>>> surrounding stack traces, Classes on the stack trace, and caller classes >>>>> [1], [2], [3]. These are all related discussions and the solution to them is >>>>> equally related, so I wanted to consolidate it all into this one discussion >>>>> where I hope we can finalize on a solution and get it implemented for Java >>>>> 8. >>>>> >>>>> In a nut shell, here are the underlying needs that I have seen expressed >>>>> through many, many messages: >>>>> >>>>> - Some code needs to get the Class of the caller of the current method, >>>>> skipping any reflection methods. >>>>> - Some code needs to get the Class of the caller /n/ stack frames before >>>>> the current method, skipping any reflection methods. >>>>> - Some code needs to get the current stack trace, populated with Classes, >>>>> Executables, file names, line numbers, and native flags instead of the >>>>> String class names and String method names in StackTraceElement. This >>>>> /should/ include any reflection methods, just like StackTraceElement[]s. >>>>> - Some code needs to get the stack trace from when a Throwable was >>>>> created, populated with Classes, Executables, file names, line numbers, and >>>>> native flags instead of the String class names and String method names in >>>>> StackTraceElement. This /should/ include any reflection methods, just like >>>>> StackTraceElement[]s. >>>>> - There needs to be a reflection way to achieve all of this since some >>>>> libraries (e.g., Log4j) need to be compiled against Java 6 but run on 7 and >>>>> 8 (and thus can't use @CallerSensitive). >>>>> >>>>> I believe the solutions to these needs are all related. Importantly, I >>>>> think it is very important that action be taken in Java 8 due to the changes >>>>> made to sun.reflect.Reflection#getCallerClass(...). While we all understand >>>>> that relying on private sun.* APIs is not safe, the fact is that many people >>>>> have relied on sun.reflect.Reflection#getCallerClass(...) due to the fact >>>>> that there is simply no other way to do this in the standard API. This >>>>> includes Log4j 2, Logback, SLF4j, and Groovy, some features of which will >>>>> stop working correctly in Java 7 >= u25. >>>>> >>>>> I would point out that this could all easily be solved simply by adding a >>>>> getElementClass() method to StackTraceElement, but there was strong >>>>> opposition to this, largely due to serialization issues. Since that is >>>>> apparently not an option, I propose the following API, based on the various >>>>> discussions in the last two months, StackTraceElement, and the API that .NET >>>>> provides to achieve the same needs as listed above: >>>>> >>>>> CallerSensitive.java: >>>>> package java.lang; >>>>> >>>>> /** Previously private API, now public */ >>>>> public @interface CallerSensitive { >>>>> ... >>>>> } >>>>> >>>>> StackTraceFrame.java: >>>>> package java.lang; >>>>> >>>>> import java.util.Objects. >>>>> >>>>> public final class StackTraceFrame { >>>>> private final Class declaringClass; >>>>> private final Executable executable; >>>>> private final String fileName; >>>>> private final int lineNumber; >>>>> >>>>> public StackTraceFrame(Class declaringClass, Executable >>>>> executable, String fileName, int lineNumber) { >>>>> this.declaringClass = Objects.requireNonNull(declaringClass, >>>>> "Declaring class is null"); >>>>> this.executable = Objects.requireNonNull(executable, "Executable >>>>> is null"); >>>>> this.fileName = fileName; >>>>> this.lineNumber = lineNumber; >>>>> } >>>>> >>>>> public Class getDeclaringClass() { >>>>> return this.declaringClass; >>>>> } >>>>> >>>>> public Executable getExecutable() { >>>>> return this.executable; >>>>> } >>>>> >>>>> public String getFileName() { >>>>> return this.fileName; >>>>> } >>>>> >>>>> public int getLineNumber() { >>>>> return this.lineNumber; >>>>> } >>>>> >>>>> public boolean isNative() { >>>>> return this.lineNumber == -2; >>>>> } >>>>> >>>>> public String toString() { /* Same as StackTraceElement */ } >>>>> public boolean equals() { /* Ditto */ } >>>>> public int hashCode() { /* Ditto */ } >>>>> >>>>> /** Uses @CallerSensitive */ >>>>> public static native StackTraceFrame getCallerFrame(); >>>>> >>>>> /** Works like Java < 7u25 sun.reflect.Reflection#getCallerClass() >>>>> */ >>>>> public static native StackTraceFrame getCallerFrame(int skipFrames); >>>>> >>>>> public static native StackTraceFrame[] getCurrentStackTrace(); >>>>> } >>>>> >>>>> Throwable.java: >>>>> package java.lang; >>>>> >>>>> ... >>>>> >>>>> public class Throwable { >>>>> ... >>>>> public synchronized Throwable fillInStackTraceFrames() { ... } >>>>> >>>>> private native Throwable fillInStackTraceFrames(int dummy); >>>>> >>>>> public StackTraceFrame[] getStackTraceFrames() { >>>>> return this.getOurStackTraceFrames().clone(); >>>>> } >>>>> >>>>> private synchronized StackTraceFrame[] getOurStackTraceFrames() { >>>>> ... } >>>>> ... >>>>> } >>>>> >>>>> Furthermore, I propose that we restore the behavior of >>>>> sun.reflect.Reflection#getCallerClass(int) /just for Java 7/ since the >>>>> proposed above solution cannot be added to Java 7. >>>>> >>>>> I would love if we could quickly coalesce around this solution or a >>>>> derivative thereof so that it can be implemented before Feature Complete. >>>>> The absence of any replacement or alternative for >>>>> sun.reflect.Reflection#getCallerClass(int) will be a serious issue in Java 8 >>>>> that will cause hardships for many projects. >>>>> >>>>> [1] >>>>> http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-June/018049.html >>>>> [2] >>>>> http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-June/018349.html, >>>>> http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-July/019098.html >>>>> [3] >>>>> http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-July/018855.html >>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> - DML >>>>> >>>> >>>> >>>> -- >>>> - DML >>> >> >> >> -- >> - DML > -- - DML From Alan.Bateman at oracle.com Tue Jul 30 01:38:36 2013 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Mon, 29 Jul 2013 18:38:36 -0700 Subject: Classes on the stack trace (was: getElementClass/StackTraceElement, was: @CallerSensitive public API, was: sun.reflect.Reflection.getCallerClass) In-Reply-To: References: Message-ID: <51F7191C.9000909@oracle.com> On 29/07/2013 15:48, Paul Benedict wrote: > +1 with Nick. There's no point in submitting a patch unless someone who is > in charge of Core Libs Dev is willing to first offer technical direction. > Where does Oracle want to go with the solution? There are no official > responses -- it's been quiet on their front for sometime. I don't know if > that means the proposal is being ignored, or there are offline discussions > happening, or people are enjoying summer vacations, or something else. I > just don't know. > I think several people are on vacation, some people are at the JVM Language summit, others are probably just busy. I'm sure there will be further discussion over the next few weeks. For JDK 8 then I think the use-cases need to be studied to see if it merits introducing new APIs or not (JDK 8 is past feature complete so it might be awkward/tight). The Groovy usage seems to be boil down to be able to distinguish frames associated with Groovy generated classes from other classes, Mandy has created a bug to look into that. Another one that has come up is loading resources on behalf of the caller, we already have a bug open to look at that for at least the purposes of logging resources. On 7u40 then the method has not been removed and there is a workaround to allow existing code using the sun.reflect.Reflection directly to continue to work. I can't say whether this should be re-visited given the usages that have come out of the wood work. The timing on this is tighter given that 7u40 is supposed to be released mid-September. -Alan From david.lloyd at redhat.com Tue Jul 30 02:17:00 2013 From: david.lloyd at redhat.com (David M. Lloyd) Date: Mon, 29 Jul 2013 21:17:00 -0500 Subject: Classes on the stack trace (was: getElementClass/StackTraceElement, was: @CallerSensitive public API, was: sun.reflect.Reflection.getCallerClass) In-Reply-To: <51F7191C.9000909@oracle.com> References: <51F7191C.9000909@oracle.com> Message-ID: <51F7221C.8080302@redhat.com> On 07/29/2013 08:38 PM, Alan Bateman wrote: > On 29/07/2013 15:48, Paul Benedict wrote: >> +1 with Nick. There's no point in submitting a patch unless someone >> who is >> in charge of Core Libs Dev is willing to first offer technical direction. >> Where does Oracle want to go with the solution? There are no official >> responses -- it's been quiet on their front for sometime. I don't know if >> that means the proposal is being ignored, or there are offline >> discussions >> happening, or people are enjoying summer vacations, or something else. I >> just don't know. >> > > I think several people are on vacation, some people are at the JVM > Language summit, others are probably just busy. I'm sure there will be > further discussion over the next few weeks. > > For JDK 8 then I think the use-cases need to be studied to see if it > merits introducing new APIs or not (JDK 8 is past feature complete so it > might be awkward/tight). The Groovy usage seems to be boil down to be > able to distinguish frames associated with Groovy generated classes from > other classes, Mandy has created a bug to look into that. Another one > that has come up is loading resources on behalf of the caller, we > already have a bug open to look at that for at least the purposes of > logging resources. > > On 7u40 then the method has not been removed and there is a workaround > to allow existing code using the sun.reflect.Reflection directly to > continue to work. I can't say whether this should be re-visited given > the usages that have come out of the wood work. The timing on this is > tighter given that 7u40 is supposed to be released mid-September. Your phrasing makes me think I missed something: is the Reflection.getCallerClass() method being removed due to some technical issue that it can only be somehow emulated as a workaround? Or is it just a general cleanup effort? -- - DML From henry.jen at oracle.com Tue Jul 30 02:30:10 2013 From: henry.jen at oracle.com (Henry Jen) Date: Mon, 29 Jul 2013 19:30:10 -0700 Subject: CFR: 8020977: StringJoiner merges with itself not as expected Message-ID: <51F72532.3010101@oracle.com> Hi, Please review a simple fix for 8020977. The fix grab the length before initiate copying operation, so that the 'delimiter' added for this won't be included in copy. For rest cases, the timing window changed a little, but that's fine as simultaneous changes is not determined. Cheers, Henry From henry.jen at oracle.com Tue Jul 30 02:43:56 2013 From: henry.jen at oracle.com (Henry Jen) Date: Mon, 29 Jul 2013 19:43:56 -0700 Subject: CFR: 8020977: StringJoiner merges with itself not as expected In-Reply-To: <51F72532.3010101@oracle.com> References: <51F72532.3010101@oracle.com> Message-ID: <51F7286C.9000508@oracle.com> Sorry, the webrev is at http://cr.openjdk.java.net/~henryjen/tl/8020977/0/webrev/ Cheers, Henry On 07/29/2013 07:30 PM, Henry Jen wrote: > Hi, > > Please review a simple fix for 8020977. > > The fix grab the length before initiate copying operation, so that the > 'delimiter' added for this won't be included in copy. > > For rest cases, the timing window changed a little, but that's fine as > simultaneous changes is not determined. > > Cheers, > Henry > From Roger.Riggs at Oracle.com Tue Jul 30 02:57:26 2013 From: Roger.Riggs at Oracle.com (Roger Riggs) Date: Mon, 29 Jul 2013 22:57:26 -0400 Subject: RFR: java.time test bug Message-ID: <51F72B96.4050407@Oracle.com> Please help review (and commit to jdk-tl or jdk) this java.time test bug 8021767 : test/java/time/tck/java/time/format/TCKFormatStyle.java failing Correct to use fixed locale; not locale of test environment The test incorrectly uses the locale of the test environment and thus fails in some environments. Please review the webrev: http://cr.openjdk.java.net/~rriggs/webrev-8021767-fixedlocale/ Thanks, Roger From xuelei.fan at oracle.com Tue Jul 30 02:38:52 2013 From: xuelei.fan at oracle.com (xuelei.fan at oracle.com) Date: Tue, 30 Jul 2013 02:38:52 +0000 Subject: hg: jdk8/tl/jdk: 8021841: Remove SSLEngineDeadlock.java from problem list Message-ID: <20130730023918.2F77B48467@hg.openjdk.java.net> Changeset: 613cc7beba64 Author: xuelei Date: 2013-07-29 19:36 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/613cc7beba64 8021841: Remove SSLEngineDeadlock.java from problem list Reviewed-by: wetmore ! test/ProblemList.txt From david.holmes at oracle.com Tue Jul 30 03:10:37 2013 From: david.holmes at oracle.com (David Holmes) Date: Tue, 30 Jul 2013 13:10:37 +1000 Subject: Java 8 RFR 8011194: Apps launched via double-clicked .jars have file.encoding value of US-ASCII on Mac OS X In-Reply-To: <51F6C860.4020000@oracle.com> References: <51F2B781.1050104@oracle.com> <51F5FA02.9020909@oracle.com> <51F6C860.4020000@oracle.com> Message-ID: <51F72EAD.7040201@oracle.com> On 30/07/2013 5:54 AM, Brent Christian wrote: > On 7/28/13 10:13 PM, David Holmes wrote: >> On 27/07/2013 3:53 AM, Brent Christian wrote: >>> Please review my fix for 8011194 : "Apps launched via double-clicked >>> .jars have file.encoding value of US-ASCII on Mac OS X" >>> >>> http://bugs.sun.com/view_bug.do?bug_id=8011194 >>> >>> In most cases of launching a Java app on Mac (from the cmdline, or from >>> a native .app bundle), reading and displaying UTF-8 characters beyond >>> the standard ASCII range works fine. >>> >>> A notable exception is the launching of an app by double-clicking a .jar >>> file. In this case, file.encoding defaults to US-ASCII, and characters >>> outside of the ASCII range show up as garbage. >> >> Why does this occur? What sets the encoding to US-ASCII? > > "US-ASCII" is the answer we get from nl_langinfo(CODESET) because no > values for LANG/LC* are set in the environment when double-clicking a .jar. > > We get "UTF-8" when launching from the command line because the default > Terminal.app setup on Mac will setup LANG for you (to "en_US.UTF-8" in > the US). Sounds like a user environment error to me. This isn't my area but I'm not convinced we should be second guessing what we think the encoding should be. What if someone intends for it to be US-ASCII? David ----- > -Brent From Alan.Bateman at oracle.com Tue Jul 30 04:31:45 2013 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Mon, 29 Jul 2013 21:31:45 -0700 Subject: Classes on the stack trace (was: getElementClass/StackTraceElement, was: @CallerSensitive public API, was: sun.reflect.Reflection.getCallerClass) In-Reply-To: <51F7221C.8080302@redhat.com> References: <51F7191C.9000909@oracle.com> <51F7221C.8080302@redhat.com> Message-ID: <51F741B1.7020008@oracle.com> On 29/07/2013 19:17, David M. Lloyd wrote: > > Your phrasing makes me think I missed something: is the > Reflection.getCallerClass() method being removed due to some technical > issue that it can only be somehow emulated as a workaround? Or is it > just a general cleanup effort? > The sun.reflect.Reflection.getCallerClass(int) method was removed as part of JEP 176 [1]. -Alan. [1] http://openjdk.java.net/jeps/176 From masayoshi.okutsu at oracle.com Tue Jul 30 04:31:52 2013 From: masayoshi.okutsu at oracle.com (Masayoshi Okutsu) Date: Tue, 30 Jul 2013 13:31:52 +0900 Subject: RFR: java.time test bug In-Reply-To: <51F72B96.4050407@Oracle.com> References: <51F72B96.4050407@Oracle.com> Message-ID: <51F741B8.9020903@oracle.com> Looks good to me. Masayoshi On 7/30/2013 11:57 AM, Roger Riggs wrote: > Please help review (and commit to jdk-tl or jdk) this java.time test bug > > 8021767 : > test/java/time/tck/java/time/format/TCKFormatStyle.java failing > Correct to use fixed locale; not locale of test environment > > The test incorrectly uses the locale of the test environment and thus > fails in some environments. > > Please review the webrev: > http://cr.openjdk.java.net/~rriggs/webrev-8021767-fixedlocale/ > > Thanks, Roger > From Alan.Bateman at oracle.com Tue Jul 30 04:37:36 2013 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Mon, 29 Jul 2013 21:37:36 -0700 Subject: RFR: java.time test bug In-Reply-To: <51F72B96.4050407@Oracle.com> References: <51F72B96.4050407@Oracle.com> Message-ID: <51F74310.10304@oracle.com> On 29/07/2013 19:57, Roger Riggs wrote: > Please help review (and commit to jdk-tl or jdk) this java.time test bug > > 8021767 : > test/java/time/tck/java/time/format/TCKFormatStyle.java failing > Correct to use fixed locale; not locale of test environment > > The test incorrectly uses the locale of the test environment and thus > fails in some environments. > > Please review the webrev: > http://cr.openjdk.java.net/~rriggs/webrev-8021767-fixedlocale/ > > Thanks, Roger > I've been running into this, the fix looks good to me. -Alan. From joe.darcy at oracle.com Tue Jul 30 04:59:07 2013 From: joe.darcy at oracle.com (Joseph Darcy) Date: Mon, 29 Jul 2013 21:59:07 -0700 Subject: Classes on the stack trace (was: getElementClass/StackTraceElement, was: @CallerSensitive public API, was: sun.reflect.Reflection.getCallerClass) In-Reply-To: <51F741B1.7020008@oracle.com> References: <51F7191C.9000909@oracle.com> <51F7221C.8080302@redhat.com> <51F741B1.7020008@oracle.com> Message-ID: <51F7481B.1080903@oracle.com> On 7/29/2013 9:31 PM, Alan Bateman wrote: > On 29/07/2013 19:17, David M. Lloyd wrote: >> >> Your phrasing makes me think I missed something: is the >> Reflection.getCallerClass() method being removed due to some >> technical issue that it can only be somehow emulated as a >> workaround? Or is it just a general cleanup effort? >> > The sun.reflect.Reflection.getCallerClass(int) method was removed as > part of JEP 176 [1]. > > -Alan. > > [1] http://openjdk.java.net/jeps/176 > And as a sun.* method, this was officially outside of the exported interface of the JDK and not something that should be expected to work if called from outside of the JDK: http://www.oracle.com/technetwork/java/faq-sun-packages-142232.html -Joe From nicholas+openjdk at nicholaswilliams.net Tue Jul 30 04:58:47 2013 From: nicholas+openjdk at nicholaswilliams.net (Nick Williams) Date: Mon, 29 Jul 2013 23:58:47 -0500 Subject: Classes on the stack trace (was: getElementClass/StackTraceElement, was: @CallerSensitive public API, was: sun.reflect.Reflection.getCallerClass) In-Reply-To: <51F7481B.1080903@oracle.com> References: <51F7191C.9000909@oracle.com> <51F7221C.8080302@redhat.com> <51F741B1.7020008@oracle.com> <51F7481B.1080903@oracle.com> Message-ID: <4C7F7BA9-F099-49BE-BC1D-C7ADD0F4850A@nicholaswilliams.net> On Jul 29, 2013, at 11:59 PM, Joseph Darcy wrote: > > On 7/29/2013 9:31 PM, Alan Bateman wrote: >> On 29/07/2013 19:17, David M. Lloyd wrote: >>> >>> Your phrasing makes me think I missed something: is the Reflection.getCallerClass() method being removed due to some technical issue that it can only be somehow emulated as a workaround? Or is it just a general cleanup effort? >>> >> The sun.reflect.Reflection.getCallerClass(int) method was removed as part of JEP 176 [1]. >> >> -Alan. >> >> [1] http://openjdk.java.net/jeps/176 >> > > And as a sun.* method, this was officially outside of the exported interface of the JDK and not something that should be expected to work if called from outside of the JDK. As has been said many, many times in the last few days, we are all well aware of this. It doesn't make the problem any less disastrous for the community. This needs to be replaced with a public API. Nick From paul.sandoz at oracle.com Tue Jul 30 10:53:37 2013 From: paul.sandoz at oracle.com (Paul Sandoz) Date: Tue, 30 Jul 2013 11:53:37 +0100 Subject: RFR 8021863: Stream.concat incorrectly calculates unsized state Message-ID: <7E3DF7C4-32CD-4731-9C10-C38FAE0BB4B8@oracle.com> Hi, http://cr.openjdk.java.net/~psandoz/tl/JDK-8021863-concat-size/webrev/ This patch just tidies up calculating whether the concatenating spliterator is unsized or not before splitting. There was a typo when checking spliterator characteristics, but it turns out the characteristics do not need to be checked. Some tests are also added. Paul. From paul.sandoz at oracle.com Tue Jul 30 11:02:23 2013 From: paul.sandoz at oracle.com (Paul Sandoz) Date: Tue, 30 Jul 2013 12:02:23 +0100 Subject: CFR: 8020977: StringJoiner merges with itself not as expected In-Reply-To: <51F7286C.9000508@oracle.com> References: <51F72532.3010101@oracle.com> <51F7286C.9000508@oracle.com> Message-ID: <9CF21EB7-5B38-467E-A8E4-A6E155D3DEA7@oracle.com> On Jul 30, 2013, at 3:43 AM, Henry Jen wrote: > Sorry, the webrev is at > > http://cr.openjdk.java.net/~henryjen/tl/8020977/0/webrev/ > Looks ok to me. Paul. From jhuxhorn at googlemail.com Tue Jul 30 12:01:00 2013 From: jhuxhorn at googlemail.com (=?UTF-8?Q?J=C3=B6rn_Huxhorn?=) Date: Tue, 30 Jul 2013 14:01:00 +0200 Subject: =?UTF-8?Q?Re=3A_Classes_on_the_stack_trace_(was=3A_getElementClass/StackTraceElement=2C_was=3A_=40CallerSensitive_public_API=2C_was=3A_sun.reflect.Reflection.getCallerClass)?= In-Reply-To: <4C7F7BA9-F099-49BE-BC1D-C7ADD0F4850A@nicholaswilliams.net> References: <51F7191C.9000909@oracle.com> <51F7221C.8080302@redhat.com> <51F741B1.7020008@oracle.com> <51F7481B.1080903@oracle.com> <4C7F7BA9-F099-49BE-BC1D-C7ADD0F4850A@nicholaswilliams.net> Message-ID: This whole issue started with the "fix" of http://bugs.sun.com/view_bug.do?bug_id=8016814 because, obviously, throwing an UnsupportedOperationException is a straightforward and reasonable way of fixing an off-by-one problem with the description "returns the wrong stack frame" (see http://mail.openjdk.java.net/pipermail/jdk7u-dev/2013-June/006791.html). Bonus points for doing this instead of just applying the "1-line fix" in the comments of that bug report. I'm pretty sure that this exception wasn't the kind of fix the reporter of the bug was looking for. (Yes, I know. The 1-line fix was applied and is executing if the JVM parameter is set - but this is not my point.) Ironically, the comment on the "fix" regarded a sudden, unexpected RuntimeException in an unknown amount of third-party code as "Low risk.". This is justified by http://bugs.sun.com/view_bug.do?bug_id=8014925 (created on 2013-05-20 - which is just the blink of an eye in Java time. To put it into perspective: we missed the tenth birthday of http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4851444 which requested this functionality in a proper public API) which contains the following paragraph: > The following describes the transition plan to allow customers to migrate their applications away from this private API: > 1. Disable sun.reflect.Reflection.getCallerClass(int) in 7u40 and provide a flag to re-enable it > 2. Determine how this private API is being used and the use cases > 3. Remove this private API if there is no valid use case or there is a proper replacement for it. Allow at least 2 CPU releases to allow customers to make appropriate change. ?So the earliest for the removal is 7u55. ?If there are valid use cases but no proper replacement, we may keep this private API in jdk7u for longer. With regards to 3., I think we were able to give examples of "valid use cases" for this API. If the only alternatives available are either slow and fragile (100x slower, achieved by extending SecurityManager for the sake of calling the protected getClassContext() method, will break if the RuntimePermission "createSecurityManager" is not granted by a possibly installed SecurityManager) or even slower (450x slower, using Throwable) then this is a showstopper, especially if the code is executed?literally?millions of times, as is the case with logging calls. Yes. It sucks that a private API call is necessary. Yep, one should not depend on such a private API. But the RFE to rectify this has been idling for more than ten years and the performance impact of *not* using it is substantial. The j7u40 change will result in lots of applications simply going BOOM or acting weird after updating which in turn will slow the adoption of Java updates. And that isn't a good idea at all with regards to security fixes. It will likely also prevent reasonable adoption rates for Java 8. Why should I choose a new Java version if it results in a significantly slower overall speed of my applications? If all third-party libraries using the API have been updated so that the application will work at all. There's really only one rational way to handle this situation: - Remove the UnsupportedOperationException from j7u40 und higher Java 7 versions. - Restore sun.reflect.Reflection in Java 8. - Define a proper public API (TBD) with similar performance to the private API, as requested ten years ago, for Java 9. This functionality is available in .NET since 1.1, as previously mentioned. Anything else will simply hurt the Java platform as a whole and reaffirm the "Java is slow" mantra. If keeping the "but this wasn't part of the public API so we did nothing wrong" stance is worth all of this then feel free to just ignore our objections. Seriously, I fail to understand how something like this could have passed the QA. See http://code.ohloh.net/search?s=Reflection.getCallerClass for a rough estimate about the impact of this change. This is probably one of the most used private Java API calls, ever. Cheers, J?rn. On 30. Juli 2013 at 06:59:53, Nick Williams (nicholas+openjdk at nicholaswilliams.net) wrote: On Jul 29, 2013, at 11:59 PM, Joseph Darcy wrote: > > On 7/29/2013 9:31 PM, Alan Bateman wrote: >> On 29/07/2013 19:17, David M. Lloyd wrote: >>> >>> Your phrasing makes me think I missed something: is the Reflection.getCallerClass() method being removed due to some technical issue that it can only be somehow emulated as a workaround? Or is it just a general cleanup effort? >>> >> The sun.reflect.Reflection.getCallerClass(int) method was removed as part of JEP 176 [1]. >> >> -Alan. >> >> [1] http://openjdk.java.net/jeps/176 >> > > And as a sun.* method, this was officially outside of the exported interface of the JDK and not something that should be expected to work if called from outside of the JDK. As has been said many, many times in the last few days, we are all well aware of this. It doesn't make the problem any less disastrous for the community. This needs to be replaced with a public API. Nick From peter.levart at gmail.com Tue Jul 30 12:17:50 2013 From: peter.levart at gmail.com (Peter Levart) Date: Tue, 30 Jul 2013 14:17:50 +0200 Subject: Classes on the stack trace (was: getElementClass/StackTraceElement, was: @CallerSensitive public API, was: sun.reflect.Reflection.getCallerClass) In-Reply-To: References: Message-ID: <51F7AEEE.4040305@gmail.com> On 07/27/2013 09:01 PM, Nick Williams wrote: > All, > > In the last two months, there have been a number of discussions surrounding stack traces, Classes on the stack trace, and caller classes [1], [2], [3]. These are all related discussions and the solution to them is equally related, so I wanted to consolidate it all into this one discussion where I hope we can finalize on a solution and get it implemented for Java 8. > > In a nut shell, here are the underlying needs that I have seen expressed through many, many messages: > > - Some code needs to get the Class of the caller of the current method, skipping any reflection methods. > - Some code needs to get the Class of the caller /n/ stack frames before the current method, skipping any reflection methods. > - Some code needs to get the current stack trace, populated with Classes, Executables, file names, line numbers, and native flags instead of the String class names and String method names in StackTraceElement. This /should/ include any reflection methods, just like StackTraceElement[]s. > - Some code needs to get the stack trace from when a Throwable was created, populated with Classes, Executables, file names, line numbers, and native flags instead of the String class names and String method names in StackTraceElement. This /should/ include any reflection methods, just like StackTraceElement[]s. > - There needs to be a reflection way to achieve all of this since some libraries (e.g., Log4j) need to be compiled against Java 6 but run on 7 and 8 (and thus can't use @CallerSensitive). > > I believe the solutions to these needs are all related. Importantly, I think it is very important that action be taken in Java 8 due to the changes made to sun.reflect.Reflection#getCallerClass(...). While we all understand that relying on private sun.* APIs is not safe, the fact is that many people have relied on sun.reflect.Reflection#getCallerClass(...) due to the fact that there is simply no other way to do this in the standard API. This includes Log4j 2, Logback, SLF4j, and Groovy, some features of which will stop working correctly in Java 7 >= u25. Hi, The needs described above may seem related, but from what I see in this commit: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/da6addef956e my observations are as following (please comment if I missed or misunderstood anything): sun.reflect.Reflection.getCallerClass(int) is/was used internally in JDK more or less for different purposes than outside the JDK. Inside it was used basically for implementing security-sensitive checks like optimizations for public methods which can avoid calling SecurityManager API wen called from withing JDK classes. It was used for security-unrelated purposes too, like for example Class.forName(String) or ResourceBundle.getBundle(String). All internal JDK uses do share one common thing though: it is very important that the right direct caller of a caller-sensitive method is established, since any failure to do so can have devastating effect on security or correctness. The API taking an "int" to count the frames between the top of the call-stack to the indirect caller was convenient, but too fragile to support such important use cases. Every time some code was refactored, there was danger that some call-frame was inadvertently inserted or removed. So I think it was decided to "cripple" the API to only support obtaining the immediate caller of the method making call to the Reflection.getCallerClass() and all uses modified accordingly to make the internal JDK code more robust to refactorings. And there's also MethodHandles which are early-bound. Meaning that the caller is established and bound when the MethodHandle instance is looked-up. The "lookupClass" which is associated with the Lookup object and used in permission checks when obtaining MHs is also used as the bound caller class when the MH is invoked. Now there's a method: java.lang.invoke.MethodHandles.Lookup { public java.lang.invoke.MethodHandles.Lookup in(java.lang.Class requestedLookupClass) that returns a Lookup object which reports a different "lookupClass" and has capabilities to lookup MHs which are combined from capabilities of the original Lookup object and new lookupClass (tipicaly less, never more). Most of such Lookup objects are prevented from looking-up MHs for caller-sensitive methods, since they could be used to "pose" as a caller that is not the one having obtained the MH and therefore gain access to restricted resource, for example: MethodHandle mh = MethodHandles.lookup().in(Object.class).lookupXXX(....) ...such mh could be used to pose as being called from withing Object if allowed to be obtained for caller-sensitive methods. So here comes @CallerSensitive annotation to mark such methods and prevent such lookups (before that - in JDK7, all internal caller-sensitive methods were hand-maintained in a list). So this is, what I think, the background and rationale for changing the API. For outside JDK use, I think there are two main needs, which are actually distinct: a) the caller-sensitive methods b) anything else that is not caller-sensitive, but wants to fiddle with the call-stack For caller-sensitive methods, the approach taken with new Reflection.getCallerClass() is the right one, I think. There's no need to support a fragile API when caller-sensitivity is concerned, so the lack of "int" parameter, combined with annotation for marking such methods is correct approach, I think. The refactorings to support this change in JDK show that this API is adequate. The "surface" public API methods must capture the caller class and pass it down the internal API where it can be used. So what would give Groovy or other language runtimes headaches when all there was was a parameter-less getCallerClass() API? Aren't the intermediate frames inserted by those runtimes controlled by the runtimes? Couldn't the "surface" runtime-inserted methods capture the caller and pass it down? I guess the problem is supporting calling the caller-sensitive methods like Class.forName(String) and such which don't have the overloaded variant taking caller Class or ClassLoader as an argument... John Rose suggested to "capture" the caller in the "surface" method and bind it with a MethodHandle and then pass such MH down the runtime API and finally call that method via MH. For that to work, two problems would have to be resolved first: 1) the runtime-inserted "surface" method would have to be annotated with @CallerSensitive so that illegal "posers" could be prevented 2) this "surface" method would have to be given permission to "pose as" the caller class when looking-up the MethodHandle of the target caller-sensitive method. The 1st part is not a problem I think, but the 2nd part is a problem. What makes the runtime-inserted "surface" method so special that it can be allowed to "pose" as its caller? Now that is the question for mlvm-dev mailing list: Isn't preventing almost all Lookup objects obtained by Lookup.in(RequestedLookupClass.class) from obtaining MHs of @CallerSensitive methods too restrictive? Currently classes are only allowed to "pose as" it's nest-mate classes - the classes that share the same outermost enclosing class, since the check to look-up @CallerSensitive methods is based on the ability to look-up PRIVATE members. So the ability to "pose as" another class when binding caller already exists even for @CallerSensitive methods, just the restriction is too conservative, isn't it? Perhaps a class that is visible from the calling class could be allowed to look-up MHs of @CallerSensitive methods and "pose" as the calling class, bearing all other security checks for combined abilities have passed. For example, why wouldn't class A be allowed to "pose as" class B if they are loaded by the same ClassLoader or if class B is loaded by a ClassLoader that directly or indirectly delegates to the ClassLoader of class A? These are my thoughts about caller-sensitivity and why I think it requires special restricted API. Anything else that needs to examine the whole call-stack is a separate need that is not infected by the strict constraints of caller-sensitivity and for that purpose an API like the one presented below (StackTraceFrame) is a good starting-point, maybe it just doesn't need the static getCallerFrame() method which suggests that it's use is for implementing caller-sensitive methods. Regards, Peter > I would point out that this could all easily be solved simply by adding a getElementClass() method to StackTraceElement, but there was strong opposition to this, largely due to serialization issues. Since that is apparently not an option, I propose the following API, based on the various discussions in the last two months, StackTraceElement, and the API that .NET provides to achieve the same needs as listed above: > > CallerSensitive.java: > package java.lang; > > /** Previously private API, now public */ > public @interface CallerSensitive { > ... > } > > StackTraceFrame.java: > package java.lang; > > import java.util.Objects. > > public final class StackTraceFrame { > private final Class declaringClass; > private final Executable executable; > private final String fileName; > private final int lineNumber; > > public StackTraceFrame(Class declaringClass, Executable executable, String fileName, int lineNumber) { > this.declaringClass = Objects.requireNonNull(declaringClass, "Declaring class is null"); > this.executable = Objects.requireNonNull(executable, "Executable is null"); > this.fileName = fileName; > this.lineNumber = lineNumber; > } > > public Class getDeclaringClass() { > return this.declaringClass; > } > > public Executable getExecutable() { > return this.executable; > } > > public String getFileName() { > return this.fileName; > } > > public int getLineNumber() { > return this.lineNumber; > } > > public boolean isNative() { > return this.lineNumber == -2; > } > > public String toString() { /* Same as StackTraceElement */ } > public boolean equals() { /* Ditto */ } > public int hashCode() { /* Ditto */ } > > /** Uses @CallerSensitive */ > public static native StackTraceFrame getCallerFrame(); > > /** Works like Java < 7u25 sun.reflect.Reflection#getCallerClass() */ > public static native StackTraceFrame getCallerFrame(int skipFrames); > > public static native StackTraceFrame[] getCurrentStackTrace(); > } > > Throwable.java: > package java.lang; > > ... > > public class Throwable { > ... > public synchronized Throwable fillInStackTraceFrames() { ... } > > private native Throwable fillInStackTraceFrames(int dummy); > > public StackTraceFrame[] getStackTraceFrames() { > return this.getOurStackTraceFrames().clone(); > } > > private synchronized StackTraceFrame[] getOurStackTraceFrames() { ... } > ... > } > > Furthermore, I propose that we restore the behavior of sun.reflect.Reflection#getCallerClass(int) /just for Java 7/ since the proposed above solution cannot be added to Java 7. > > I would love if we could quickly coalesce around this solution or a derivative thereof so that it can be implemented before Feature Complete. The absence of any replacement or alternative for sun.reflect.Reflection#getCallerClass(int) will be a serious issue in Java 8 that will cause hardships for many projects. > > [1] http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-June/018049.html > [2] http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-June/018349.html, http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-July/019098.html > [3] http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-July/018855.html From nicholas+openjdk at nicholaswilliams.net Tue Jul 30 12:25:01 2013 From: nicholas+openjdk at nicholaswilliams.net (Nick Williams) Date: Tue, 30 Jul 2013 07:25:01 -0500 Subject: Classes on the stack trace (was: getElementClass/StackTraceElement, was: @CallerSensitive public API, was: sun.reflect.Reflection.getCallerClass) In-Reply-To: References: <51F7191C.9000909@oracle.com> <51F7221C.8080302@redhat.com> <51F741B1.7020008@oracle.com> <51F7481B.1080903@oracle.com> <4C7F7BA9-F099-49BE-BC1D-C7ADD0F4850A@nicholaswilliams.net> Message-ID: 42 MILLION uses of Reflection.getCallerClass(int) on Ohloh!?!? Holy crap... In case anyone is interested, I am almost finished implementing the public API StackTraceFrame and associated C/C++ code. It has been an eye-opening experience, but I think I have it figured out now. I just have to write some tests. Looks like installing and configuring jtreg might be more difficult than cloning and compiling JDK was... Nick On Jul 30, 2013, at 7:01 AM, J?rn Huxhorn wrote: > This whole issue started with the "fix" of http://bugs.sun.com/view_bug.do?bug_id=8016814 because, obviously, throwing an UnsupportedOperationException is a straightforward and reasonable way of fixing an off-by-one problem with the description "returns the wrong stack frame" (see http://mail.openjdk.java.net/pipermail/jdk7u-dev/2013-June/006791.html). > Bonus points for doing this instead of just applying the "1-line fix" in the comments of that bug report. I'm pretty sure that this exception wasn't the kind of fix the reporter of the bug was looking for. (Yes, I know. The 1-line fix was applied and is executing if the JVM parameter is set - but this is not my point.) > > Ironically, the comment on the "fix" regarded a sudden, unexpected RuntimeException in an unknown amount of third-party code as "Low risk.". > > This is justified by http://bugs.sun.com/view_bug.do?bug_id=8014925 (created on 2013-05-20 - which is just the blink of an eye in Java time. To put it into perspective: we missed the tenth birthday of http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4851444 which requested this functionality in a proper public API) which contains the following paragraph: > >> The following describes the transition plan to allow customers to migrate their applications away from this private API: >> 1. Disable sun.reflect.Reflection.getCallerClass(int) in 7u40 and provide a flag to re-enable it >> 2. Determine how this private API is being used and the use cases >> 3. Remove this private API if there is no valid use case or there is a proper replacement for it. Allow at least 2 CPU releases to allow customers to make appropriate change. So the earliest for the removal is 7u55. If there are valid use cases but no proper replacement, we may keep this private API in jdk7u for longer. > > With regards to 3., I think we were able to give examples of "valid use cases" for this API. > > If the only alternatives available are either slow and fragile (100x slower, achieved by extending SecurityManager for the sake of calling the protected getClassContext() method, will break if the RuntimePermission "createSecurityManager" is not granted by a possibly installed SecurityManager) or even slower (450x slower, using Throwable) then this is a showstopper, especially if the code is executed literally millions of times, as is the case with logging calls. > > Yes. It sucks that a private API call is necessary. Yep, one should not depend on such a private API. But the RFE to rectify this has been idling for more than ten years and the performance impact of *not* using it is substantial. > > The j7u40 change will result in lots of applications simply going BOOM or acting weird after updating which in turn will slow the adoption of Java updates. And that isn't a good idea at all with regards to security fixes. It will likely also prevent reasonable adoption rates for Java 8. Why should I choose a new Java version if it results in a significantly slower overall speed of my applications? If all third-party libraries using the API have been updated so that the application will work at all. > > There's really only one rational way to handle this situation: > - Remove the UnsupportedOperationException from j7u40 und higher Java 7 versions. > - Restore sun.reflect.Reflection in Java 8. > - Define a proper public API (TBD) with similar performance to the private API, as requested ten years ago, for Java 9. This functionality is available in .NET since 1.1, as previously mentioned. > > Anything else will simply hurt the Java platform as a whole and reaffirm the "Java is slow" mantra. If keeping the "but this wasn't part of the public API so we did nothing wrong" stance is worth all of this then feel free to just ignore our objections. > > Seriously, I fail to understand how something like this could have passed the QA. See http://code.ohloh.net/search?s=Reflection.getCallerClass for a rough estimate about the impact of this change. This is probably one of the most used private Java API calls, ever. > > Cheers, > J?rn. > > On 30. Juli 2013 at 06:59:53, Nick Williams (nicholas+openjdk at nicholaswilliams.net) wrote: > > > On Jul 29, 2013, at 11:59 PM, Joseph Darcy wrote: > >> >> On 7/29/2013 9:31 PM, Alan Bateman wrote: >>> On 29/07/2013 19:17, David M. Lloyd wrote: >>>> >>>> Your phrasing makes me think I missed something: is the Reflection.getCallerClass() method being removed due to some technical issue that it can only be somehow emulated as a workaround? Or is it just a general cleanup effort? >>>> >>> The sun.reflect.Reflection.getCallerClass(int) method was removed as part of JEP 176 [1]. >>> >>> -Alan. >>> >>> [1] http://openjdk.java.net/jeps/176 >>> >> >> And as a sun.* method, this was officially outside of the exported interface of the JDK and not something that should be expected to work if called from outside of the JDK. > > As has been said many, many times in the last few days, we are all well aware of this. It doesn't make the problem any less disastrous for the community. This needs to be replaced with a public API. > > Nick From nicholas+openjdk at nicholaswilliams.net Tue Jul 30 12:32:56 2013 From: nicholas+openjdk at nicholaswilliams.net (Nick Williams) Date: Tue, 30 Jul 2013 07:32:56 -0500 Subject: Classes on the stack trace (was: getElementClass/StackTraceElement, was: @CallerSensitive public API, was: sun.reflect.Reflection.getCallerClass) In-Reply-To: <51F7AEEE.4040305@gmail.com> References: <51F7AEEE.4040305@gmail.com> Message-ID: <257709C4-59DF-4863-859A-C63F95F7C3D0@nicholaswilliams.net> "For caller-sensitive methods, the approach taken with new Reflection.getCallerClass() is the right one, I think. There's no need to support a fragile API when caller-sensitivity is concerned, so the lack of "int" parameter, combined with annotation for marking such methods is correct approach, I think." Not when the code running on Java 8 was compiled on Java 6 or 7 and thus can't be annotated @CallerSensitive. In these cases, use of any new public API must use reflection (sudo code: If Java 8, use new public caller-sensitive API), so it needs code that it can pass a number into. Nick On Jul 30, 2013, at 7:17 AM, Peter Levart wrote: > > On 07/27/2013 09:01 PM, Nick Williams wrote: >> All, >> >> In the last two months, there have been a number of discussions surrounding stack traces, Classes on the stack trace, and caller classes [1], [2], [3]. These are all related discussions and the solution to them is equally related, so I wanted to consolidate it all into this one discussion where I hope we can finalize on a solution and get it implemented for Java 8. >> >> In a nut shell, here are the underlying needs that I have seen expressed through many, many messages: >> >> - Some code needs to get the Class of the caller of the current method, skipping any reflection methods. >> - Some code needs to get the Class of the caller /n/ stack frames before the current method, skipping any reflection methods. >> - Some code needs to get the current stack trace, populated with Classes, Executables, file names, line numbers, and native flags instead of the String class names and String method names in StackTraceElement. This /should/ include any reflection methods, just like StackTraceElement[]s. >> - Some code needs to get the stack trace from when a Throwable was created, populated with Classes, Executables, file names, line numbers, and native flags instead of the String class names and String method names in StackTraceElement. This /should/ include any reflection methods, just like StackTraceElement[]s. >> - There needs to be a reflection way to achieve all of this since some libraries (e.g., Log4j) need to be compiled against Java 6 but run on 7 and 8 (and thus can't use @CallerSensitive). >> >> I believe the solutions to these needs are all related. Importantly, I think it is very important that action be taken in Java 8 due to the changes made to sun.reflect.Reflection#getCallerClass(...). While we all understand that relying on private sun.* APIs is not safe, the fact is that many people have relied on sun.reflect.Reflection#getCallerClass(...) due to the fact that there is simply no other way to do this in the standard API. This includes Log4j 2, Logback, SLF4j, and Groovy, some features of which will stop working correctly in Java 7 >= u25. > > Hi, > > The needs described above may seem related, but from what I see in this commit: > > http://hg.openjdk.java.net/jdk8/tl/jdk/rev/da6addef956e > > my observations are as following (please comment if I missed or misunderstood anything): > > sun.reflect.Reflection.getCallerClass(int) is/was used internally in JDK more or less for different purposes than outside the JDK. Inside it was used basically for implementing security-sensitive checks like optimizations for public methods which can avoid calling SecurityManager API wen called from withing JDK classes. It was used for security-unrelated purposes too, like for example Class.forName(String) or ResourceBundle.getBundle(String). All internal JDK uses do share one common thing though: it is very important that the right direct caller of a caller-sensitive method is established, since any failure to do so can have devastating effect on security or correctness. > > The API taking an "int" to count the frames between the top of the call-stack to the indirect caller was convenient, but too fragile to support such important use cases. Every time some code was refactored, there was danger that some call-frame was inadvertently inserted or removed. So I think it was decided to "cripple" the API to only support obtaining the immediate caller of the method making call to the Reflection.getCallerClass() and all uses modified accordingly to make the internal JDK code more robust to refactorings. > > And there's also MethodHandles which are early-bound. Meaning that the caller is established and bound when the MethodHandle instance is looked-up. The "lookupClass" which is associated with the Lookup object and used in permission checks when obtaining MHs is also used as the bound caller class when the MH is invoked. Now there's a method: > > java.lang.invoke.MethodHandles.Lookup { > public java.lang.invoke.MethodHandles.Lookup in(java.lang.Class requestedLookupClass) > > that returns a Lookup object which reports a different "lookupClass" and has capabilities to lookup MHs which are combined from capabilities of the original Lookup object and new lookupClass (tipicaly less, never more). Most of such Lookup objects are prevented from looking-up MHs for caller-sensitive methods, since they could be used to "pose" as a caller that is not the one having obtained the MH and therefore gain access to restricted resource, for example: > > MethodHandle mh = MethodHandles.lookup().in(Object.class).lookupXXX(....) > > ...such mh could be used to pose as being called from withing Object if allowed to be obtained for caller-sensitive methods. So here comes @CallerSensitive annotation to mark such methods and prevent such lookups (before that - in JDK7, all internal caller-sensitive methods were hand-maintained in a list). > > So this is, what I think, the background and rationale for changing the API. > > For outside JDK use, I think there are two main needs, which are actually distinct: > > a) the caller-sensitive methods > b) anything else that is not caller-sensitive, but wants to fiddle with the call-stack > > For caller-sensitive methods, the approach taken with new Reflection.getCallerClass() is the right one, I think. There's no need to support a fragile API when caller-sensitivity is concerned, so the lack of "int" parameter, combined with annotation for marking such methods is correct approach, I think. The refactorings to support this change in JDK show that this API is adequate. The "surface" public API methods must capture the caller class and pass it down the internal API where it can be used. > > So what would give Groovy or other language runtimes headaches when all there was was a parameter-less getCallerClass() API? Aren't the intermediate frames inserted by those runtimes controlled by the runtimes? Couldn't the "surface" runtime-inserted methods capture the caller and pass it down? I guess the problem is supporting calling the caller-sensitive methods like Class.forName(String) and such which don't have the overloaded variant taking caller Class or ClassLoader as an argument... > > John Rose suggested to "capture" the caller in the "surface" method and bind it with a MethodHandle and then pass such MH down the runtime API and finally call that method via MH. For that to work, two problems would have to be resolved first: > > 1) the runtime-inserted "surface" method would have to be annotated with @CallerSensitive so that illegal "posers" could be prevented > 2) this "surface" method would have to be given permission to "pose as" the caller class when looking-up the MethodHandle of the target caller-sensitive method. > > The 1st part is not a problem I think, but the 2nd part is a problem. What makes the runtime-inserted "surface" method so special that it can be allowed to "pose" as its caller? > > Now that is the question for mlvm-dev mailing list: Isn't preventing almost all Lookup objects obtained by Lookup.in(RequestedLookupClass.class) from obtaining MHs of @CallerSensitive methods too restrictive? > > Currently classes are only allowed to "pose as" it's nest-mate classes - the classes that share the same outermost enclosing class, since the check to look-up @CallerSensitive methods is based on the ability to look-up PRIVATE members. So the ability to "pose as" another class when binding caller already exists even for @CallerSensitive methods, just the restriction is too conservative, isn't it? > > Perhaps a class that is visible from the calling class could be allowed to look-up MHs of @CallerSensitive methods and "pose" as the calling class, bearing all other security checks for combined abilities have passed. For example, why wouldn't class A be allowed to "pose as" class B if they are loaded by the same ClassLoader or if class B is loaded by a ClassLoader that directly or indirectly delegates to the ClassLoader of class A? > > These are my thoughts about caller-sensitivity and why I think it requires special restricted API. Anything else that needs to examine the whole call-stack is a separate need that is not infected by the strict constraints of caller-sensitivity and for that purpose an API like the one presented below (StackTraceFrame) is a good starting-point, maybe it just doesn't need the static getCallerFrame() method which suggests that it's use is for implementing caller-sensitive methods. > > Regards, Peter > >> I would point out that this could all easily be solved simply by adding a getElementClass() method to StackTraceElement, but there was strong opposition to this, largely due to serialization issues. Since that is apparently not an option, I propose the following API, based on the various discussions in the last two months, StackTraceElement, and the API that .NET provides to achieve the same needs as listed above: >> >> CallerSensitive.java: >> package java.lang; >> >> /** Previously private API, now public */ >> public @interface CallerSensitive { >> ... >> } >> >> StackTraceFrame.java: >> package java.lang; >> >> import java.util.Objects. >> >> public final class StackTraceFrame { >> private final Class declaringClass; >> private final Executable executable; >> private final String fileName; >> private final int lineNumber; >> >> public StackTraceFrame(Class declaringClass, Executable executable, String fileName, int lineNumber) { >> this.declaringClass = Objects.requireNonNull(declaringClass, "Declaring class is null"); >> this.executable = Objects.requireNonNull(executable, "Executable is null"); >> this.fileName = fileName; >> this.lineNumber = lineNumber; >> } >> >> public Class getDeclaringClass() { >> return this.declaringClass; >> } >> >> public Executable getExecutable() { >> return this.executable; >> } >> >> public String getFileName() { >> return this.fileName; >> } >> >> public int getLineNumber() { >> return this.lineNumber; >> } >> >> public boolean isNative() { >> return this.lineNumber == -2; >> } >> >> public String toString() { /* Same as StackTraceElement */ } >> public boolean equals() { /* Ditto */ } >> public int hashCode() { /* Ditto */ } >> >> /** Uses @CallerSensitive */ >> public static native StackTraceFrame getCallerFrame(); >> >> /** Works like Java < 7u25 sun.reflect.Reflection#getCallerClass() */ >> public static native StackTraceFrame getCallerFrame(int skipFrames); >> >> public static native StackTraceFrame[] getCurrentStackTrace(); >> } >> >> Throwable.java: >> package java.lang; >> >> ... >> >> public class Throwable { >> ... >> public synchronized Throwable fillInStackTraceFrames() { ... } >> >> private native Throwable fillInStackTraceFrames(int dummy); >> >> public StackTraceFrame[] getStackTraceFrames() { >> return this.getOurStackTraceFrames().clone(); >> } >> >> private synchronized StackTraceFrame[] getOurStackTraceFrames() { ... } >> ... >> } >> >> Furthermore, I propose that we restore the behavior of sun.reflect.Reflection#getCallerClass(int) /just for Java 7/ since the proposed above solution cannot be added to Java 7. >> >> I would love if we could quickly coalesce around this solution or a derivative thereof so that it can be implemented before Feature Complete. The absence of any replacement or alternative for sun.reflect.Reflection#getCallerClass(int) will be a serious issue in Java 8 that will cause hardships for many projects. >> >> [1] http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-June/018049.html >> [2] http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-June/018349.html, http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-July/019098.html >> [3] http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-July/018855.html > From chris.hegarty at oracle.com Tue Jul 30 12:42:58 2013 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Tue, 30 Jul 2013 13:42:58 +0100 Subject: CFR: 8020977: StringJoiner merges with itself not as expected In-Reply-To: <9CF21EB7-5B38-467E-A8E4-A6E155D3DEA7@oracle.com> References: <51F72532.3010101@oracle.com> <51F7286C.9000508@oracle.com> <9CF21EB7-5B38-467E-A8E4-A6E155D3DEA7@oracle.com> Message-ID: <51F7B4D2.6030704@oracle.com> On 07/30/2013 12:02 PM, Paul Sandoz wrote: > > On Jul 30, 2013, at 3:43 AM, Henry Jen wrote: > >> Sorry, the webrev is at >> >> http://cr.openjdk.java.net/~henryjen/tl/8020977/0/webrev/ >> > > Looks ok to me. +1 looks good to me too. -Chris. > > Paul. > From peter.levart at gmail.com Tue Jul 30 12:45:36 2013 From: peter.levart at gmail.com (Peter Levart) Date: Tue, 30 Jul 2013 14:45:36 +0200 Subject: Classes on the stack trace (was: getElementClass/StackTraceElement, was: @CallerSensitive public API, was: sun.reflect.Reflection.getCallerClass) In-Reply-To: <257709C4-59DF-4863-859A-C63F95F7C3D0@nicholaswilliams.net> References: <51F7AEEE.4040305@gmail.com> <257709C4-59DF-4863-859A-C63F95F7C3D0@nicholaswilliams.net> Message-ID: <51F7B570.5040308@gmail.com> I think there are various techniques to use new API when running on JDK8 and still use old API when running on JDK6 or 7. One way is to have 2 classes implementing the same interface or extending basic class where one is compiled with JDK6/7 and the other with JDK8. During runtime the "correct" implementation is choosen, but code only depends on the interface/basic class... There are other tricks. But I have an idea. What if Reflection.getCallerClass(int) is restored in JDK7 and JDK8 without a @CallerSensitive annotation on it. In order to prevent inadvertent internal JDK usage, the method could throw exception when called from any internal JDK class... Regards, Peter On 07/30/2013 02:32 PM, Nick Williams wrote: > "For caller-sensitive methods, the approach taken with new > Reflection.getCallerClass() is the right one, I think. There's no need > to support a fragile API when caller-sensitivity is concerned, so the > lack of "int" parameter, combined with annotation for marking such > methods is correct approach, I think." > > Not when the code running on Java 8 was compiled on Java 6 or 7 and > thus can't be annotated @CallerSensitive. In these cases, use of any > new public API must use reflection (sudo code: If Java 8, use new > public caller-sensitive API), so it needs code that it can pass a > number into. > > Nick > > On Jul 30, 2013, at 7:17 AM, Peter Levart wrote: > >> >> On 07/27/2013 09:01 PM, Nick Williams wrote: >>> All, >>> >>> In the last two months, there have been a number of discussions surrounding stack traces, Classes on the stack trace, and caller classes [1], [2], [3]. These are all related discussions and the solution to them is equally related, so I wanted to consolidate it all into this one discussion where I hope we can finalize on a solution and get it implemented for Java 8. >>> >>> In a nut shell, here are the underlying needs that I have seen expressed through many, many messages: >>> >>> - Some code needs to get the Class of the caller of the current method, skipping any reflection methods. >>> - Some code needs to get the Class of the caller /n/ stack frames before the current method, skipping any reflection methods. >>> - Some code needs to get the current stack trace, populated with Classes, Executables, file names, line numbers, and native flags instead of the String class names and String method names in StackTraceElement. This /should/ include any reflection methods, just like StackTraceElement[]s. >>> - Some code needs to get the stack trace from when a Throwable was created, populated with Classes, Executables, file names, line numbers, and native flags instead of the String class names and String method names in StackTraceElement. This /should/ include any reflection methods, just like StackTraceElement[]s. >>> - There needs to be a reflection way to achieve all of this since some libraries (e.g., Log4j) need to be compiled against Java 6 but run on 7 and 8 (and thus can't use @CallerSensitive). >>> >>> I believe the solutions to these needs are all related. Importantly, I think it is very important that action be taken in Java 8 due to the changes made to sun.reflect.Reflection#getCallerClass(...). While we all understand that relying on private sun.* APIs is not safe, the fact is that many people have relied on sun.reflect.Reflection#getCallerClass(...) due to the fact that there is simply no other way to do this in the standard API. This includes Log4j 2, Logback, SLF4j, and Groovy, some features of which will stop working correctly in Java 7 >= u25. >> >> Hi, >> >> The needs described above may seem related, but from what I see in >> this commit: >> >> http://hg.openjdk.java.net/jdk8/tl/jdk/rev/da6addef956e >> >> my observations are as following (please comment if I missed or >> misunderstood anything): >> >> sun.reflect.Reflection.getCallerClass(int) is/was used internally in >> JDK more or less for different purposes than outside the JDK. Inside >> it was used basically for implementing security-sensitive checks like >> optimizations for public methods which can avoid calling >> SecurityManager API wen called from withing JDK classes. It was used >> for security-unrelated purposes too, like for example >> Class.forName(String) or ResourceBundle.getBundle(String). All >> internal JDK uses do share one common thing though: it is very >> important that the right direct caller of a caller-sensitive method >> is established, since any failure to do so can have devastating >> effect on security or correctness. >> >> The API taking an "int" to count the frames between the top of the >> call-stack to the indirect caller was convenient, but too fragile to >> support such important use cases. Every time some code was >> refactored, there was danger that some call-frame was inadvertently >> inserted or removed. So I think it was decided to "cripple" the API >> to only support obtaining the immediate caller of the method making >> call to the Reflection.getCallerClass() and all uses modified >> accordingly to make the internal JDK code more robust to refactorings. >> >> And there's also MethodHandles which are early-bound. Meaning that >> the caller is established and bound when the MethodHandle instance is >> looked-up. The "lookupClass" which is associated with the Lookup >> object and used in permission checks when obtaining MHs is also used >> as the bound caller class when the MH is invoked. Now there's a method: >> >> java.lang.invoke.MethodHandles.Lookup { >> public java.lang.invoke.MethodHandles.Lookup >> in(java.lang.Class requestedLookupClass) >> >> that returns a Lookup object which reports a different "lookupClass" >> and has capabilities to lookup MHs which are combined from >> capabilities of the original Lookup object and new lookupClass >> (tipicaly less, never more). Most of such Lookup objects are >> prevented from looking-up MHs for caller-sensitive methods, since >> they could be used to "pose" as a caller that is not the one having >> obtained the MH and therefore gain access to restricted resource, for >> example: >> >> MethodHandle mh = MethodHandles.lookup().in(Object.class).lookupXXX(....) >> >> ...such mh could be used to pose as being called from withing Object >> if allowed to be obtained for caller-sensitive methods. So here comes >> @CallerSensitive annotation to mark such methods and prevent such >> lookups (before that - in JDK7, all internal caller-sensitive methods >> were hand-maintained in a list). >> >> So this is, what I think, the background and rationale for changing >> the API. >> >> For outside JDK use, I think there are two main needs, which are >> actually distinct: >> >> a) the caller-sensitive methods >> b) anything else that is not caller-sensitive, but wants to fiddle >> with the call-stack >> >> For caller-sensitive methods, the approach taken with new >> Reflection.getCallerClass() is the right one, I think. There's no >> need to support a fragile API when caller-sensitivity is concerned, >> so the lack of "int" parameter, combined with annotation for marking >> such methods is correct approach, I think. The refactorings to >> support this change in JDK show that this API is adequate. The >> "surface" public API methods must capture the caller class and pass >> it down the internal API where it can be used. >> >> So what would give Groovy or other language runtimes headaches when >> all there was was a parameter-less getCallerClass() API? Aren't the >> intermediate frames inserted by those runtimes controlled by the >> runtimes? Couldn't the "surface" runtime-inserted methods capture the >> caller and pass it down? I guess the problem is supporting calling >> the caller-sensitive methods like Class.forName(String) and such >> which don't have the overloaded variant taking caller Class or >> ClassLoader as an argument... >> >> John Rose suggested to "capture" the caller in the "surface" method >> and bind it with a MethodHandle and then pass such MH down the >> runtime API and finally call that method via MH. For that to work, >> two problems would have to be resolved first: >> >> 1) the runtime-inserted "surface" method would have to be annotated >> with @CallerSensitive so that illegal "posers" could be prevented >> 2) this "surface" method would have to be given permission to "pose >> as" the caller class when looking-up the MethodHandle of the target >> caller-sensitive method. >> >> The 1st part is not a problem I think, but the 2nd part is a problem. >> What makes the runtime-inserted "surface" method so special that it >> can be allowed to "pose" as its caller? >> >> Now that is the question for mlvm-dev mailing list: Isn't preventing >> almost all Lookup objects obtained by >> Lookup.in(RequestedLookupClass.class) from obtaining MHs of >> @CallerSensitive methods too restrictive? >> >> Currently classes are only allowed to "pose as" it's nest-mate >> classes - the classes that share the same outermost enclosing class, >> since the check to look-up @CallerSensitive methods is based on the >> ability to look-up PRIVATE members. So the ability to "pose as" >> another class when binding caller already exists even for >> @CallerSensitive methods, just the restriction is too conservative, >> isn't it? >> >> Perhaps a class that is visible from the calling class could be >> allowed to look-up MHs of @CallerSensitive methods and "pose" as the >> calling class, bearing all other security checks for combined >> abilities have passed. For example, why wouldn't class A be allowed >> to "pose as" class B if they are loaded by the same ClassLoader or if >> class B is loaded by a ClassLoader that directly or indirectly >> delegates to the ClassLoader of class A? >> >> These are my thoughts about caller-sensitivity and why I think it >> requires special restricted API. Anything else that needs to examine >> the whole call-stack is a separate need that is not infected by the >> strict constraints of caller-sensitivity and for that purpose an API >> like the one presented below (StackTraceFrame) is a good >> starting-point, maybe it just doesn't need the static >> getCallerFrame() method which suggests that it's use is for >> implementing caller-sensitive methods. >> >> Regards, Peter >> >>> I would point out that this could all easily be solved simply by adding a getElementClass() method to StackTraceElement, but there was strong opposition to this, largely due to serialization issues. Since that is apparently not an option, I propose the following API, based on the various discussions in the last two months, StackTraceElement, and the API that .NET provides to achieve the same needs as listed above: >>> >>> CallerSensitive.java: >>> package java.lang; >>> >>> /** Previously private API, now public */ >>> public @interface CallerSensitive { >>> ... >>> } >>> >>> StackTraceFrame.java: >>> package java.lang; >>> >>> import java.util.Objects. >>> >>> public final class StackTraceFrame { >>> private final Class declaringClass; >>> private final Executable executable; >>> private final String fileName; >>> private final int lineNumber; >>> >>> public StackTraceFrame(Class declaringClass, Executable executable, String fileName, int lineNumber) { >>> this.declaringClass = Objects.requireNonNull(declaringClass, "Declaring class is null"); >>> this.executable = Objects.requireNonNull(executable, "Executable is null"); >>> this.fileName = fileName; >>> this.lineNumber = lineNumber; >>> } >>> >>> public Class getDeclaringClass() { >>> return this.declaringClass; >>> } >>> >>> public Executable getExecutable() { >>> return this.executable; >>> } >>> >>> public String getFileName() { >>> return this.fileName; >>> } >>> >>> public int getLineNumber() { >>> return this.lineNumber; >>> } >>> >>> public boolean isNative() { >>> return this.lineNumber == -2; >>> } >>> >>> public String toString() { /* Same as StackTraceElement */ } >>> public boolean equals() { /* Ditto */ } >>> public int hashCode() { /* Ditto */ } >>> >>> /** Uses @CallerSensitive */ >>> public static native StackTraceFrame getCallerFrame(); >>> >>> /** Works like Java < 7u25 sun.reflect.Reflection#getCallerClass() */ >>> public static native StackTraceFrame getCallerFrame(int skipFrames); >>> >>> public static native StackTraceFrame[] getCurrentStackTrace(); >>> } >>> >>> Throwable.java: >>> package java.lang; >>> >>> ... >>> >>> public class Throwable { >>> ... >>> public synchronized Throwable fillInStackTraceFrames() { ... } >>> >>> private native Throwable fillInStackTraceFrames(int dummy); >>> >>> public StackTraceFrame[] getStackTraceFrames() { >>> return this.getOurStackTraceFrames().clone(); >>> } >>> >>> private synchronized StackTraceFrame[] getOurStackTraceFrames() { ... } >>> ... >>> } >>> >>> Furthermore, I propose that we restore the behavior of sun.reflect.Reflection#getCallerClass(int) /just for Java 7/ since the proposed above solution cannot be added to Java 7. >>> >>> I would love if we could quickly coalesce around this solution or a derivative thereof so that it can be implemented before Feature Complete. The absence of any replacement or alternative for sun.reflect.Reflection#getCallerClass(int) will be a serious issue in Java 8 that will cause hardships for many projects. >>> >>> [1]http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-June/018049.html >>> [2]http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-June/018349.html,http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-July/019098.html >>> [3]http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-July/018855.html >> > From jhuxhorn at googlemail.com Tue Jul 30 12:50:45 2013 From: jhuxhorn at googlemail.com (=?UTF-8?Q?J=C3=B6rn_Huxhorn?=) Date: Tue, 30 Jul 2013 14:50:45 +0200 Subject: =?UTF-8?Q?Re=3A_Classes_on_the_stack_trace_(was=3A_getElementClass/StackTraceElement=2C_was=3A_=40CallerSensitive_public_API=2C_was=3A_sun.reflect.Reflection.getCallerClass)?= In-Reply-To: <257709C4-59DF-4863-859A-C63F95F7C3D0@nicholaswilliams.net> References: <51F7AEEE.4040305@gmail.com> <257709C4-59DF-4863-859A-C63F95F7C3D0@nicholaswilliams.net> Message-ID: Omitting the "int" parameter would be a bad idea since it would prevent wrappers. One could imagine a common interface to obtain the caller class where the proper implementation is chosen via fallback, e.g. - if available, use our new API (fastest?) - else, try to use Reflection.getCallerClass (fast) - else, use Throwable (slow) This would guarantee that the caller class could be obtained in some way, albeit probably much slower. That would not by possible if the implementation would only provide access to the direct caller since that would always be the wrapper class. But something like this would be the most backwards compatible way (probably the only one, right?) to use that functionality in projects like logback and log4j that are still required to support Java 6 or even Java 5. On 30. Juli 2013 at 14:33:48, Nick Williams (nicholas+openjdk at nicholaswilliams.net) wrote: "For caller-sensitive methods, the approach taken with new Reflection.getCallerClass() is the right one, I think. There's no need to support a fragile API when caller-sensitivity is concerned, so the lack of "int" parameter, combined with annotation for marking such methods is correct approach, I think." Not when the code running on Java 8 was compiled on Java 6 or 7 and thus can't be annotated @CallerSensitive. In these cases, use of any new public API must use reflection (sudo code: If Java 8, use new public caller-sensitive API), so it needs code that it can pass a number into. Nick On Jul 30, 2013, at 7:17 AM, Peter Levart wrote: > > On 07/27/2013 09:01 PM, Nick Williams wrote: >> All, >> >> In the last two months, there have been a number of discussions surrounding stack traces, Classes on the stack trace, and caller classes [1], [2], [3]. These are all related discussions and the solution to them is equally related, so I wanted to consolidate it all into this one discussion where I hope we can finalize on a solution and get it implemented for Java 8. >> >> In a nut shell, here are the underlying needs that I have seen expressed through many, many messages: >> >> - Some code needs to get the Class of the caller of the current method, skipping any reflection methods. >> - Some code needs to get the Class of the caller /n/ stack frames before the current method, skipping any reflection methods. >> - Some code needs to get the current stack trace, populated with Classes, Executables, file names, line numbers, and native flags instead of the String class names and String method names in StackTraceElement. This /should/ include any reflection methods, just like StackTraceElement[]s. >> - Some code needs to get the stack trace from when a Throwable was created, populated with Classes, Executables, file names, line numbers, and native flags instead of the String class names and String method names in StackTraceElement. This /should/ include any reflection methods, just like StackTraceElement[]s. >> - There needs to be a reflection way to achieve all of this since some libraries (e.g., Log4j) need to be compiled against Java 6 but run on 7 and 8 (and thus can't use @CallerSensitive). >> >> I believe the solutions to these needs are all related. Importantly, I think it is very important that action be taken in Java 8 due to the changes made to sun.reflect.Reflection#getCallerClass(...). While we all understand that relying on private sun.* APIs is not safe, the fact is that many people have relied on sun.reflect.Reflection#getCallerClass(...) due to the fact that there is simply no other way to do this in the standard API. This includes Log4j 2, Logback, SLF4j, and Groovy, some features of which will stop working correctly in Java 7 >= u25. > > Hi, > > The needs described above may seem related, but from what I see in this commit: > > http://hg.openjdk.java.net/jdk8/tl/jdk/rev/da6addef956e > > my observations are as following (please comment if I missed or misunderstood anything): > > sun.reflect.Reflection.getCallerClass(int) is/was used internally in JDK more or less for different purposes than outside the JDK. Inside it was used basically for implementing security-sensitive checks like optimizations for public methods which can avoid calling SecurityManager API wen called from withing JDK classes. It was used for security-unrelated purposes too, like for example Class.forName(String) or ResourceBundle.getBundle(String). All internal JDK uses do share one common thing though: it is very important that the right direct caller of a caller-sensitive method is established, since any failure to do so can have devastating effect on security or correctness. > > The API taking an "int" to count the frames between the top of the call-stack to the indirect caller was convenient, but too fragile to support such important use cases. Every time some code was refactored, there was danger that some call-frame was inadvertently inserted or removed. So I think it was decided to "cripple" the API to only support obtaining the immediate caller of the method making call to the Reflection.getCallerClass() and all uses modified accordingly to make the internal JDK code more robust to refactorings. > > And there's also MethodHandles which are early-bound. Meaning that the caller is established and bound when the MethodHandle instance is looked-up. The "lookupClass" which is associated with the Lookup object and used in permission checks when obtaining MHs is also used as the bound caller class when the MH is invoked. Now there's a method: > > java.lang.invoke.MethodHandles.Lookup { > public java.lang.invoke.MethodHandles.Lookup in(java.lang.Class requestedLookupClass) > > that returns a Lookup object which reports a different "lookupClass" and has capabilities to lookup MHs which are combined from capabilities of the original Lookup object and new lookupClass (tipicaly less, never more). Most of such Lookup objects are prevented from looking-up MHs for caller-sensitive methods, since they could be used to "pose" as a caller that is not the one having obtained the MH and therefore gain access to restricted resource, for example: > > MethodHandle mh = MethodHandles.lookup().in(Object.class).lookupXXX(....) > > ...such mh could be used to pose as being called from withing Object if allowed to be obtained for caller-sensitive methods. So here comes @CallerSensitive annotation to mark such methods and prevent such lookups (before that - in JDK7, all internal caller-sensitive methods were hand-maintained in a list). > > So this is, what I think, the background and rationale for changing the API. > > For outside JDK use, I think there are two main needs, which are actually distinct: > > a) the caller-sensitive methods > b) anything else that is not caller-sensitive, but wants to fiddle with the call-stack > > For caller-sensitive methods, the approach taken with new Reflection.getCallerClass() is the right one, I think. There's no need to support a fragile API when caller-sensitivity is concerned, so the lack of "int" parameter, combined with annotation for marking such methods is correct approach, I think. The refactorings to support this change in JDK show that this API is adequate. The "surface" public API methods must capture the caller class and pass it down the internal API where it can be used. > > So what would give Groovy or other language runtimes headaches when all there was was a parameter-less getCallerClass() API? Aren't the intermediate frames inserted by those runtimes controlled by the runtimes? Couldn't the "surface" runtime-inserted methods capture the caller and pass it down? I guess the problem is supporting calling the caller-sensitive methods like Class.forName(String) and such which don't have the overloaded variant taking caller Class or ClassLoader as an argument... > > John Rose suggested to "capture" the caller in the "surface" method and bind it with a MethodHandle and then pass such MH down the runtime API and finally call that method via MH. For that to work, two problems would have to be resolved first: > > 1) the runtime-inserted "surface" method would have to be annotated with @CallerSensitive so that illegal "posers" could be prevented > 2) this "surface" method would have to be given permission to "pose as" the caller class when looking-up the MethodHandle of the target caller-sensitive method. > > The 1st part is not a problem I think, but the 2nd part is a problem. What makes the runtime-inserted "surface" method so special that it can be allowed to "pose" as its caller? > > Now that is the question for mlvm-dev mailing list: Isn't preventing almost all Lookup objects obtained by Lookup.in(RequestedLookupClass.class) from obtaining MHs of @CallerSensitive methods too restrictive? > > Currently classes are only allowed to "pose as" it's nest-mate classes - the classes that share the same outermost enclosing class, since the check to look-up @CallerSensitive methods is based on the ability to look-up PRIVATE members. So the ability to "pose as" another class when binding caller already exists even for @CallerSensitive methods, just the restriction is too conservative, isn't it? > > Perhaps a class that is visible from the calling class could be allowed to look-up MHs of @CallerSensitive methods and "pose" as the calling class, bearing all other security checks for combined abilities have passed. For example, why wouldn't class A be allowed to "pose as" class B if they are loaded by the same ClassLoader or if class B is loaded by a ClassLoader that directly or indirectly delegates to the ClassLoader of class A? > > These are my thoughts about caller-sensitivity and why I think it requires special restricted API. Anything else that needs to examine the whole call-stack is a separate need that is not infected by the strict constraints of caller-sensitivity and for that purpose an API like the one presented below (StackTraceFrame) is a good starting-point, maybe it just doesn't need the static getCallerFrame() method which suggests that it's use is for implementing caller-sensitive methods. > > Regards, Peter > >> I would point out that this could all easily be solved simply by adding a getElementClass() method to StackTraceElement, but there was strong opposition to this, largely due to serialization issues. Since that is apparently not an option, I propose the following API, based on the various discussions in the last two months, StackTraceElement, and the API that .NET provides to achieve the same needs as listed above: >> >> CallerSensitive.java: >> package java.lang; >> >> /** Previously private API, now public */ >> public @interface CallerSensitive { >> ... >> } >> >> StackTraceFrame.java: >> package java.lang; >> >> import java.util.Objects. >> >> public final class StackTraceFrame { >> private final Class declaringClass; >> private final Executable executable; >> private final String fileName; >> private final int lineNumber; >> >> public StackTraceFrame(Class declaringClass, Executable executable, String fileName, int lineNumber) { >> this.declaringClass = Objects.requireNonNull(declaringClass, "Declaring class is null"); >> this.executable = Objects.requireNonNull(executable, "Executable is null"); >> this.fileName = fileName; >> this.lineNumber = lineNumber; >> } >> >> public Class getDeclaringClass() { >> return this.declaringClass; >> } >> >> public Executable getExecutable() { >> return this.executable; >> } >> >> public String getFileName() { >> return this.fileName; >> } >> >> public int getLineNumber() { >> return this.lineNumber; >> } >> >> public boolean isNative() { >> return this.lineNumber == -2; >> } >> >> public String toString() { /* Same as StackTraceElement */ } >> public boolean equals() { /* Ditto */ } >> public int hashCode() { /* Ditto */ } >> >> /** Uses @CallerSensitive */ >> public static native StackTraceFrame getCallerFrame(); >> >> /** Works like Java < 7u25 sun.reflect.Reflection#getCallerClass() */ >> public static native StackTraceFrame getCallerFrame(int skipFrames); >> >> public static native StackTraceFrame[] getCurrentStackTrace(); >> } >> >> Throwable.java: >> package java.lang; >> >> ... >> >> public class Throwable { >> ... >> public synchronized Throwable fillInStackTraceFrames() { ... } >> >> private native Throwable fillInStackTraceFrames(int dummy); >> >> public StackTraceFrame[] getStackTraceFrames() { >> return this.getOurStackTraceFrames().clone(); >> } >> >> private synchronized StackTraceFrame[] getOurStackTraceFrames() { ... } >> ... >> } >> >> Furthermore, I propose that we restore the behavior of sun.reflect.Reflection#getCallerClass(int) /just for Java 7/ since the proposed above solution cannot be added to Java 7. >> >> I would love if we could quickly coalesce around this solution or a derivative thereof so that it can be implemented before Feature Complete. The absence of any replacement or alternative for sun.reflect.Reflection#getCallerClass(int) will be a serious issue in Java 8 that will cause hardships for many projects. >> >> [1] http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-June/018049.html >> [2] http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-June/018349.html, http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-July/019098.html >> [3] http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-July/018855.html > From nicholas+openjdk at nicholaswilliams.net Tue Jul 30 12:53:18 2013 From: nicholas+openjdk at nicholaswilliams.net (Nick Williams) Date: Tue, 30 Jul 2013 07:53:18 -0500 Subject: Classes on the stack trace (was: getElementClass/StackTraceElement, was: @CallerSensitive public API, was: sun.reflect.Reflection.getCallerClass) In-Reply-To: <51F7B570.5040308@gmail.com> References: <51F7AEEE.4040305@gmail.com> <257709C4-59DF-4863-859A-C63F95F7C3D0@nicholaswilliams.net> <51F7B570.5040308@gmail.com> Message-ID: <09D9E046-9E10-4453-9E46-FB340240F113@nicholaswilliams.net> On Jul 30, 2013, at 7:45 AM, Peter Levart wrote: > I think there are various techniques to use new API when running on JDK8 and still use old API when running on JDK6 or 7. One way is to have 2 classes implementing the same interface or extending basic class where one is compiled with JDK6/7 and the other with JDK8. During runtime the "correct" implementation is choosen, but code only depends on the interface/basic class? Now there's an interesting idea I hadn't considered. It sure wouldn't be easy, though. It would make it harder for projects to fix bugs related to this when discovered, and still slow down adoption of Java 8. > > There are other tricks. > > But I have an idea. What if Reflection.getCallerClass(int) is restored in JDK7 and JDK8 without a @CallerSensitive annotation on it. In order to prevent inadvertent internal JDK usage, the method could throw exception when called from any internal JDK class? I think this MUST happen in Java 7, because adding a public API isn't an option there. As for Java 8, I'm almost done with StackTraceFrame and associated C/C++ code, and it includes both an @CallerSensitive getCallerClass() method and a getCallerClass(int) method. While I would prefer your option for Java 8 over what we have now (obviously), the public StackTraceFrame API is a better approach by the mere fact of being public (and universally available on all JVMs). Nick > > Regards, Peter > > > On 07/30/2013 02:32 PM, Nick Williams wrote: >> "For caller-sensitive methods, the approach taken with new Reflection.getCallerClass() is the right one, I think. There's no need to support a fragile API when caller-sensitivity is concerned, so the lack of "int" parameter, combined with annotation for marking such methods is correct approach, I think." >> >> Not when the code running on Java 8 was compiled on Java 6 or 7 and thus can't be annotated @CallerSensitive. In these cases, use of any new public API must use reflection (sudo code: If Java 8, use new public caller-sensitive API), so it needs code that it can pass a number into. >> >> Nick >> >> On Jul 30, 2013, at 7:17 AM, Peter Levart wrote: >> >>> >>> On 07/27/2013 09:01 PM, Nick Williams wrote: >>>> All, >>>> >>>> In the last two months, there have been a number of discussions surrounding stack traces, Classes on the stack trace, and caller classes [1], [2], [3]. These are all related discussions and the solution to them is equally related, so I wanted to consolidate it all into this one discussion where I hope we can finalize on a solution and get it implemented for Java 8. >>>> >>>> In a nut shell, here are the underlying needs that I have seen expressed through many, many messages: >>>> >>>> - Some code needs to get the Class of the caller of the current method, skipping any reflection methods. >>>> - Some code needs to get the Class of the caller /n/ stack frames before the current method, skipping any reflection methods. >>>> - Some code needs to get the current stack trace, populated with Classes, Executables, file names, line numbers, and native flags instead of the String class names and String method names in StackTraceElement. This /should/ include any reflection methods, just like StackTraceElement[]s. >>>> - Some code needs to get the stack trace from when a Throwable was created, populated with Classes, Executables, file names, line numbers, and native flags instead of the String class names and String method names in StackTraceElement. This /should/ include any reflection methods, just like StackTraceElement[]s. >>>> - There needs to be a reflection way to achieve all of this since some libraries (e.g., Log4j) need to be compiled against Java 6 but run on 7 and 8 (and thus can't use @CallerSensitive). >>>> >>>> I believe the solutions to these needs are all related. Importantly, I think it is very important that action be taken in Java 8 due to the changes made to sun.reflect.Reflection#getCallerClass(...). While we all understand that relying on private sun.* APIs is not safe, the fact is that many people have relied on sun.reflect.Reflection#getCallerClass(...) due to the fact that there is simply no other way to do this in the standard API. This includes Log4j 2, Logback, SLF4j, and Groovy, some features of which will stop working correctly in Java 7 >= u25. >>> >>> Hi, >>> >>> The needs described above may seem related, but from what I see in this commit: >>> >>> http://hg.openjdk.java.net/jdk8/tl/jdk/rev/da6addef956e >>> >>> my observations are as following (please comment if I missed or misunderstood anything): >>> >>> sun.reflect.Reflection.getCallerClass(int) is/was used internally in JDK more or less for different purposes than outside the JDK. Inside it was used basically for implementing security-sensitive checks like optimizations for public methods which can avoid calling SecurityManager API wen called from withing JDK classes. It was used for security-unrelated purposes too, like for example Class.forName(String) or ResourceBundle.getBundle(String). All internal JDK uses do share one common thing though: it is very important that the right direct caller of a caller-sensitive method is established, since any failure to do so can have devastating effect on security or correctness. >>> >>> The API taking an "int" to count the frames between the top of the call-stack to the indirect caller was convenient, but too fragile to support such important use cases. Every time some code was refactored, there was danger that some call-frame was inadvertently inserted or removed. So I think it was decided to "cripple" the API to only support obtaining the immediate caller of the method making call to the Reflection.getCallerClass() and all uses modified accordingly to make the internal JDK code more robust to refactorings. >>> >>> And there's also MethodHandles which are early-bound. Meaning that the caller is established and bound when the MethodHandle instance is looked-up. The "lookupClass" which is associated with the Lookup object and used in permission checks when obtaining MHs is also used as the bound caller class when the MH is invoked. Now there's a method: >>> >>> java.lang.invoke.MethodHandles.Lookup { >>> public java.lang.invoke.MethodHandles.Lookup in(java.lang.Class requestedLookupClass) >>> >>> that returns a Lookup object which reports a different "lookupClass" and has capabilities to lookup MHs which are combined from capabilities of the original Lookup object and new lookupClass (tipicaly less, never more). Most of such Lookup objects are prevented from looking-up MHs for caller-sensitive methods, since they could be used to "pose" as a caller that is not the one having obtained the MH and therefore gain access to restricted resource, for example: >>> >>> MethodHandle mh = MethodHandles.lookup().in(Object.class).lookupXXX(....) >>> >>> ...such mh could be used to pose as being called from withing Object if allowed to be obtained for caller-sensitive methods. So here comes @CallerSensitive annotation to mark such methods and prevent such lookups (before that - in JDK7, all internal caller-sensitive methods were hand-maintained in a list). >>> >>> So this is, what I think, the background and rationale for changing the API. >>> >>> For outside JDK use, I think there are two main needs, which are actually distinct: >>> >>> a) the caller-sensitive methods >>> b) anything else that is not caller-sensitive, but wants to fiddle with the call-stack >>> >>> For caller-sensitive methods, the approach taken with new Reflection.getCallerClass() is the right one, I think. There's no need to support a fragile API when caller-sensitivity is concerned, so the lack of "int" parameter, combined with annotation for marking such methods is correct approach, I think. The refactorings to support this change in JDK show that this API is adequate. The "surface" public API methods must capture the caller class and pass it down the internal API where it can be used. >>> >>> So what would give Groovy or other language runtimes headaches when all there was was a parameter-less getCallerClass() API? Aren't the intermediate frames inserted by those runtimes controlled by the runtimes? Couldn't the "surface" runtime-inserted methods capture the caller and pass it down? I guess the problem is supporting calling the caller-sensitive methods like Class.forName(String) and such which don't have the overloaded variant taking caller Class or ClassLoader as an argument... >>> >>> John Rose suggested to "capture" the caller in the "surface" method and bind it with a MethodHandle and then pass such MH down the runtime API and finally call that method via MH. For that to work, two problems would have to be resolved first: >>> >>> 1) the runtime-inserted "surface" method would have to be annotated with @CallerSensitive so that illegal "posers" could be prevented >>> 2) this "surface" method would have to be given permission to "pose as" the caller class when looking-up the MethodHandle of the target caller-sensitive method. >>> >>> The 1st part is not a problem I think, but the 2nd part is a problem. What makes the runtime-inserted "surface" method so special that it can be allowed to "pose" as its caller? >>> >>> Now that is the question for mlvm-dev mailing list: Isn't preventing almost all Lookup objects obtained by Lookup.in(RequestedLookupClass.class) from obtaining MHs of @CallerSensitive methods too restrictive? >>> >>> Currently classes are only allowed to "pose as" it's nest-mate classes - the classes that share the same outermost enclosing class, since the check to look-up @CallerSensitive methods is based on the ability to look-up PRIVATE members. So the ability to "pose as" another class when binding caller already exists even for @CallerSensitive methods, just the restriction is too conservative, isn't it? >>> >>> Perhaps a class that is visible from the calling class could be allowed to look-up MHs of @CallerSensitive methods and "pose" as the calling class, bearing all other security checks for combined abilities have passed. For example, why wouldn't class A be allowed to "pose as" class B if they are loaded by the same ClassLoader or if class B is loaded by a ClassLoader that directly or indirectly delegates to the ClassLoader of class A? >>> >>> These are my thoughts about caller-sensitivity and why I think it requires special restricted API. Anything else that needs to examine the whole call-stack is a separate need that is not infected by the strict constraints of caller-sensitivity and for that purpose an API like the one presented below (StackTraceFrame) is a good starting-point, maybe it just doesn't need the static getCallerFrame() method which suggests that it's use is for implementing caller-sensitive methods. >>> >>> Regards, Peter >>> >>>> I would point out that this could all easily be solved simply by adding a getElementClass() method to StackTraceElement, but there was strong opposition to this, largely due to serialization issues. Since that is apparently not an option, I propose the following API, based on the various discussions in the last two months, StackTraceElement, and the API that .NET provides to achieve the same needs as listed above: >>>> >>>> CallerSensitive.java: >>>> package java.lang; >>>> >>>> /** Previously private API, now public */ >>>> public @interface CallerSensitive { >>>> ... >>>> } >>>> >>>> StackTraceFrame.java: >>>> package java.lang; >>>> >>>> import java.util.Objects. >>>> >>>> public final class StackTraceFrame { >>>> private final Class declaringClass; >>>> private final Executable executable; >>>> private final String fileName; >>>> private final int lineNumber; >>>> >>>> public StackTraceFrame(Class declaringClass, Executable executable, String fileName, int lineNumber) { >>>> this.declaringClass = Objects.requireNonNull(declaringClass, "Declaring class is null"); >>>> this.executable = Objects.requireNonNull(executable, "Executable is null"); >>>> this.fileName = fileName; >>>> this.lineNumber = lineNumber; >>>> } >>>> >>>> public Class getDeclaringClass() { >>>> return this.declaringClass; >>>> } >>>> >>>> public Executable getExecutable() { >>>> return this.executable; >>>> } >>>> >>>> public String getFileName() { >>>> return this.fileName; >>>> } >>>> >>>> public int getLineNumber() { >>>> return this.lineNumber; >>>> } >>>> >>>> public boolean isNative() { >>>> return this.lineNumber == -2; >>>> } >>>> >>>> public String toString() { /* Same as StackTraceElement */ } >>>> public boolean equals() { /* Ditto */ } >>>> public int hashCode() { /* Ditto */ } >>>> >>>> /** Uses @CallerSensitive */ >>>> public static native StackTraceFrame getCallerFrame(); >>>> >>>> /** Works like Java < 7u25 sun.reflect.Reflection#getCallerClass() */ >>>> public static native StackTraceFrame getCallerFrame(int skipFrames); >>>> >>>> public static native StackTraceFrame[] getCurrentStackTrace(); >>>> } >>>> >>>> Throwable.java: >>>> package java.lang; >>>> >>>> ... >>>> >>>> public class Throwable { >>>> ... >>>> public synchronized Throwable fillInStackTraceFrames() { ... } >>>> >>>> private native Throwable fillInStackTraceFrames(int dummy); >>>> >>>> public StackTraceFrame[] getStackTraceFrames() { >>>> return this.getOurStackTraceFrames().clone(); >>>> } >>>> >>>> private synchronized StackTraceFrame[] getOurStackTraceFrames() { ... } >>>> ... >>>> } >>>> >>>> Furthermore, I propose that we restore the behavior of sun.reflect.Reflection#getCallerClass(int) /just for Java 7/ since the proposed above solution cannot be added to Java 7. >>>> >>>> I would love if we could quickly coalesce around this solution or a derivative thereof so that it can be implemented before Feature Complete. The absence of any replacement or alternative for sun.reflect.Reflection#getCallerClass(int) will be a serious issue in Java 8 that will cause hardships for many projects. >>>> >>>> [1] http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-June/018049.html >>>> [2] http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-June/018349.html, http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-July/019098.html >>>> [3] http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-July/018855.html >>> >> > From jawnsy at cpan.org Tue Jul 30 13:02:18 2013 From: jawnsy at cpan.org (Jonathan Yu) Date: Tue, 30 Jul 2013 09:02:18 -0400 Subject: Classes on the stack trace (was: getElementClass/StackTraceElement, was: @CallerSensitive public API, was: sun.reflect.Reflection.getCallerClass) In-Reply-To: References: <51F7191C.9000909@oracle.com> <51F7221C.8080302@redhat.com> <51F741B1.7020008@oracle.com> <51F7481B.1080903@oracle.com> <4C7F7BA9-F099-49BE-BC1D-C7ADD0F4850A@nicholaswilliams.net> Message-ID: On Tue, Jul 30, 2013 at 8:25 AM, Nick Williams < nicholas+openjdk at nicholaswilliams.net> wrote: > 42 MILLION uses of Reflection.getCallerClass(int) on Ohloh!?!? Holy crap... > Considering that the Ohloh search results page also bolds occurrences of "Reflection", "class" and "get" for that search [0], I think it might be a bit of an overestimation. Anyway, only eight million of those results are in Java code, apparently. I totally agree with the general sentiment of this thread, however, that something shouldn't be removed unless there's a viable alternative available. [0] I see this as my top result (CallStack.java): import sun.reflect.*Reflection*; public class CallStack { public static void main(String[] args) { new A().a(); } static *class* A{ void a(){ System.out.println(*Reflection*.*getCallerClass*(0)); System.out.println(*Reflection*.*getCallerClass*(1)); System.out.println(*Reflection*.*getCallerClass*(2)); System.out.println(*Reflection*.*getCallerClass*(3)); System.out.println(Thread.currentThread().*get*StackTrace()[0]); System.out.println(Thread.currentThread().*get*StackTrace()[1]); In case anyone is interested, I am almost finished implementing the public > API StackTraceFrame and associated C/C++ code. It has been an eye-opening > experience, but I think I have it figured out now. I just have to write > some tests. Looks like installing and configuring jtreg might be more > difficult than cloning and compiling JDK was... > > Nick > > On Jul 30, 2013, at 7:01 AM, J?rn Huxhorn wrote: > > > This whole issue started with the "fix" of > http://bugs.sun.com/view_bug.do?bug_id=8016814 because, obviously, > throwing an UnsupportedOperationException is a straightforward and > reasonable way of fixing an off-by-one problem with the description > "returns the wrong stack frame" (see > http://mail.openjdk.java.net/pipermail/jdk7u-dev/2013-June/006791.html). > > Bonus points for doing this instead of just applying the "1-line fix" in > the comments of that bug report. I'm pretty sure that this exception wasn't > the kind of fix the reporter of the bug was looking for. (Yes, I know. The > 1-line fix was applied and is executing if the JVM parameter is set - but > this is not my point.) > > > > Ironically, the comment on the "fix" regarded a sudden, unexpected > RuntimeException in an unknown amount of third-party code as "Low risk.". > > > > This is justified by http://bugs.sun.com/view_bug.do?bug_id=8014925(created on 2013-05-20 - which is just the blink of an eye in Java time. To > put it into perspective: we missed the tenth birthday of > http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4851444 which > requested this functionality in a proper public API) which contains the > following paragraph: > > > >> The following describes the transition plan to allow customers to > migrate their applications away from this private API: > >> 1. Disable sun.reflect.Reflection.getCallerClass(int) in 7u40 and > provide a flag to re-enable it > >> 2. Determine how this private API is being used and the use cases > >> 3. Remove this private API if there is no valid use case or there is a > proper replacement for it. Allow at least 2 CPU releases to allow customers > to make appropriate change. So the earliest for the removal is 7u55. If > there are valid use cases but no proper replacement, we may keep this > private API in jdk7u for longer. > > > > With regards to 3., I think we were able to give examples of "valid use > cases" for this API. > > > > If the only alternatives available are either slow and fragile (100x > slower, achieved by extending SecurityManager for the sake of calling the > protected getClassContext() method, will break if the RuntimePermission > "createSecurityManager" is not granted by a possibly installed > SecurityManager) or even slower (450x slower, using Throwable) then this is > a showstopper, especially if the code is executed literally millions of > times, as is the case with logging calls. > > > > Yes. It sucks that a private API call is necessary. Yep, one should not > depend on such a private API. But the RFE to rectify this has been idling > for more than ten years and the performance impact of *not* using it is > substantial. > > > > The j7u40 change will result in lots of applications simply going BOOM > or acting weird after updating which in turn will slow the adoption of Java > updates. And that isn't a good idea at all with regards to security fixes. > It will likely also prevent reasonable adoption rates for Java 8. Why > should I choose a new Java version if it results in a significantly slower > overall speed of my applications? If all third-party libraries using the > API have been updated so that the application will work at all. > > > > There's really only one rational way to handle this situation: > > - Remove the UnsupportedOperationException from j7u40 und higher Java 7 > versions. > > - Restore sun.reflect.Reflection in Java 8. > > - Define a proper public API (TBD) with similar performance to the > private API, as requested ten years ago, for Java 9. This functionality is > available in .NET since 1.1, as previously mentioned. > > > > Anything else will simply hurt the Java platform as a whole and reaffirm > the "Java is slow" mantra. If keeping the "but this wasn't part of the > public API so we did nothing wrong" stance is worth all of this then feel > free to just ignore our objections. > > > > Seriously, I fail to understand how something like this could have > passed the QA. See > http://code.ohloh.net/search?s=Reflection.getCallerClass for a rough > estimate about the impact of this change. This is probably one of the most > used private Java API calls, ever. > > > > Cheers, > > J?rn. > > > > On 30. Juli 2013 at 06:59:53, Nick Williams ( > nicholas+openjdk at nicholaswilliams.net) wrote: > > > > > > On Jul 29, 2013, at 11:59 PM, Joseph Darcy wrote: > > > >> > >> On 7/29/2013 9:31 PM, Alan Bateman wrote: > >>> On 29/07/2013 19:17, David M. Lloyd wrote: > >>>> > >>>> Your phrasing makes me think I missed something: is the > Reflection.getCallerClass() method being removed due to some technical > issue that it can only be somehow emulated as a workaround? Or is it just a > general cleanup effort? > >>>> > >>> The sun.reflect.Reflection.getCallerClass(int) method was removed as > part of JEP 176 [1]. > >>> > >>> -Alan. > >>> > >>> [1] http://openjdk.java.net/jeps/176 > >>> > >> > >> And as a sun.* method, this was officially outside of the exported > interface of the JDK and not something that should be expected to work if > called from outside of the JDK. > > > > As has been said many, many times in the last few days, we are all well > aware of this. It doesn't make the problem any less disastrous for the > community. This needs to be replaced with a public API. > > > > Nick > > From blackdrag at gmx.org Tue Jul 30 13:19:49 2013 From: blackdrag at gmx.org (Jochen Theodorou) Date: Tue, 30 Jul 2013 15:19:49 +0200 Subject: Classes on the stack trace (was: getElementClass/StackTraceElement, was: @CallerSensitive public API, was: sun.reflect.Reflection.getCallerClass) In-Reply-To: <51F7AEEE.4040305@gmail.com> References: <51F7AEEE.4040305@gmail.com> Message-ID: <51F7BD75.4030708@gmx.org> Am 30.07.2013 14:17, schrieb Peter Levart: [...] > So what would give Groovy or other language runtimes headaches when all > there was was a parameter-less getCallerClass() API? Aren't the > intermediate frames inserted by those runtimes controlled by the > runtimes? Couldn't the "surface" runtime-inserted methods capture the > caller and pass it down? I guess the problem is supporting calling the > caller-sensitive methods like Class.forName(String) and such which don't > have the overloaded variant taking caller Class or ClassLoader as an > argument... Speaking for Groovy... those intermediate frames are runtime controlled, yes, but passing down the caller class is exactly the problem. Imagine I would suggest that each and every method definition in Java automatically gets an additional parameter for the caller class, just to have access to it inside the method. You would not accept that for Java, would you? And so we cannot accept that for Groovy if we want to keep integration with Java... and the good integration with Java is one of the key points of Groovy. Even if we make something like that @CallerSensitive and add the parameter only in those cases, we break being able to override methods. Plus, before Groovy3 is not done we have to support several call paths. And the oldest one, which is still a fallback, does not support transporting the caller class through the runtime layers at all. Changing here is a breaking change. > John Rose suggested to "capture" the caller in the "surface" method and > bind it with a MethodHandle and then pass such MH down the runtime API > and finally call that method via MH. Only that you then need a java7+ only version, plus the already mentioned problem, that not all of the three general call paths support that or can be changed in a way to enable that without breaking user code. bye Jochen -- Jochen "blackdrag" Theodorou - Groovy Project Tech Lead blog: http://blackdragsview.blogspot.com/ german groovy discussion newsgroup: de.comp.lang.misc For Groovy programming sources visit http://groovy-lang.org From Alan.Bateman at oracle.com Tue Jul 30 13:24:25 2013 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Tue, 30 Jul 2013 06:24:25 -0700 Subject: Review request: JDK-8021245 (process) file leak in jdk/src/windows/native/java/lang/ProcessImpl_md.c In-Reply-To: <51F6A113.3090700@oracle.com> References: <51F296CF.2050902@oracle.com> <51F55777.5050404@oracle.com> <51F6A113.3090700@oracle.com> Message-ID: <51F7BE89.5020204@oracle.com> On 29/07/2013 10:06, Alexey Utkin wrote: > Thanks, Alan > > I did "if" reformatting and small refactoring for the code in function > in accordance with > https://jbs.oracle.com/bugs/browse/JDK-5008166 > recommendations. I am sure that the presence of path separator has no > dependence from search direction. > > Here is the webrev: > http://cr.openjdk.java.net/~uta/openjdk-webrevs/JDK-8021245/webrev.01/ This looks much nicer so thumbs up from me. One thing just to say that I don't think the JDK has been supported for Windows 9x/ME for several years so one of the SearchPaths isn't used nowadays. Minor comment is that the new comments probably should a space before/after the /* */ to be consistent with the other comments (no need to generate a new webrev for that of course). -Alan From nicholas+openjdk at nicholaswilliams.net Tue Jul 30 13:37:05 2013 From: nicholas+openjdk at nicholaswilliams.net (Nick Williams) Date: Tue, 30 Jul 2013 08:37:05 -0500 Subject: Compiling jtreg? Message-ID: <21A522C3-C33E-4B30-B41D-90D836E080E5@nicholaswilliams.net> I'm working on a patch for some core libraries (hence why I'm emailing here -- hopefully someone will be sympathetic and help) and need to run the JDK tests. I'm following the instructions on http://openjdk.java.net/jtreg/build.html to get jtreg installed so that I can run it. I have JDK15HOME and JDK16HOME set to my JDK 6 home directory. I have JavaHelp installed at JAVAHELP_HOME. I have JT Harness installed at JTHARNESS_HOME. I have Xalan installed at XALANHOME. I have JUnit installed at JUNIT_HOME. I have TestNG installed at TESTNG_HOME. I cloned the HG repository and executed make -C make just like the directions said. I get 58 compile errors: It can't find Ant, JUnit, or TestNG classes. Can someone point me in the right direction? 1) I assume I must have to specify a classpath somehow for JUnit and TestNG, even though the directions don't say so. Thoughts on how? 2) The instructions say Ant is optional. So why is it mandatory? (I didn't realize that it would take longer / be harder to get the tests running than to get the JDK compiling.) Thanks, Nick From paul.sandoz at oracle.com Tue Jul 30 13:39:45 2013 From: paul.sandoz at oracle.com (Paul Sandoz) Date: Tue, 30 Jul 2013 14:39:45 +0100 Subject: RFR 8021883 j.u.Random/RandomStream.java test needs more robust timeout duration Message-ID: Hi, http://cr.openjdk.java.net/~psandoz/tl/JDK-8021883-random-stream-test/webrev/ This patch updates tests for ThreadLocalRandom streams and increases the timeout duration. Although the original should be enough for most cases in certain virtualized and emulated environments it might not be. I also took the liberty of consolidating the code and sprinkling stream and CompletableFuture dust on things. Paul. From Alan.Bateman at oracle.com Tue Jul 30 14:07:13 2013 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Tue, 30 Jul 2013 07:07:13 -0700 Subject: Compiling jtreg? In-Reply-To: <21A522C3-C33E-4B30-B41D-90D836E080E5@nicholaswilliams.net> References: <21A522C3-C33E-4B30-B41D-90D836E080E5@nicholaswilliams.net> Message-ID: <51F7C891.20504@oracle.com> The jtreg-use list is probably the right place for this question. -Alan. On 30/07/2013 06:37, Nick Williams wrote: > I'm working on a patch for some core libraries (hence why I'm emailing here -- hopefully someone will be sympathetic and help) and need to run the JDK tests. I'm following the instructions on http://openjdk.java.net/jtreg/build.html to get jtreg installed so that I can run it. I have JDK15HOME and JDK16HOME set to my JDK 6 home directory. I have JavaHelp installed at JAVAHELP_HOME. I have JT Harness installed at JTHARNESS_HOME. I have Xalan installed at XALANHOME. I have JUnit installed at JUNIT_HOME. I have TestNG installed at TESTNG_HOME. > > I cloned the HG repository and executed make -C make just like the directions said. I get 58 compile errors: It can't find Ant, JUnit, or TestNG classes. Can someone point me in the right direction? > > 1) I assume I must have to specify a classpath somehow for JUnit and TestNG, even though the directions don't say so. Thoughts on how? > 2) The instructions say Ant is optional. So why is it mandatory? > > (I didn't realize that it would take longer / be harder to get the tests running than to get the JDK compiling.) > > Thanks, > > Nick From alexey.utkin at oracle.com Tue Jul 30 14:09:24 2013 From: alexey.utkin at oracle.com (Alexey Utkin) Date: Tue, 30 Jul 2013 18:09:24 +0400 Subject: Review request: JDK-8021245 (process) file leak in jdk/src/windows/native/java/lang/ProcessImpl_md.c In-Reply-To: <51F7BE89.5020204@oracle.com> References: <51F296CF.2050902@oracle.com> <51F55777.5050404@oracle.com> <51F6A113.3090700@oracle.com> <51F7BE89.5020204@oracle.com> Message-ID: <51F7C914.40204@oracle.com> On 7/30/2013 5:24 PM, Alan Bateman wrote: > On 29/07/2013 10:06, Alexey Utkin wrote: >> Thanks, Alan >> >> I did "if" reformatting and small refactoring for the code in >> function in accordance with >> https://jbs.oracle.com/bugs/browse/JDK-5008166 >> recommendations. I am sure that the presence of path separator has no >> dependence from search direction. >> >> Here is the webrev: >> http://cr.openjdk.java.net/~uta/openjdk-webrevs/JDK-8021245/webrev.01/ > This looks much nicer so thumbs up from me. One thing just to say that > I don't think the JDK has been supported for Windows 9x/ME for several > years so one of the SearchPaths isn't used nowadays. The [selectProcessFlag] function is obsolete. But the code needs to be clean. > Minor comment is that the new comments probably should a space > before/after the /* */ to be consistent with the other comments (no > need to generate a new webrev for that of course). Accepted. > > -Alan > > From peter.levart at gmail.com Tue Jul 30 14:16:45 2013 From: peter.levart at gmail.com (Peter Levart) Date: Tue, 30 Jul 2013 16:16:45 +0200 Subject: Classes on the stack trace (was: getElementClass/StackTraceElement, was: @CallerSensitive public API, was: sun.reflect.Reflection.getCallerClass) In-Reply-To: <51F7BD75.4030708@gmx.org> References: <51F7AEEE.4040305@gmail.com> <51F7BD75.4030708@gmx.org> Message-ID: <51F7CACD.2070703@gmail.com> On 07/30/2013 03:19 PM, Jochen Theodorou wrote: > Am 30.07.2013 14:17, schrieb Peter Levart: > [...] >> So what would give Groovy or other language runtimes headaches when all >> there was was a parameter-less getCallerClass() API? Aren't the >> intermediate frames inserted by those runtimes controlled by the >> runtimes? Couldn't the "surface" runtime-inserted methods capture the >> caller and pass it down? I guess the problem is supporting calling the >> caller-sensitive methods like Class.forName(String) and such which don't >> have the overloaded variant taking caller Class or ClassLoader as an >> argument... > Speaking for Groovy... > those intermediate frames are runtime controlled, yes, but passing down > the caller class is exactly the problem. Imagine I would suggest that > each and every method definition in Java automatically gets an > additional parameter for the caller class, just to have access to it > inside the method. You would not accept that for Java, would you? And so > we cannot accept that for Groovy if we want to keep integration with > Java... Are you talking about internal Groovy implementation (the runtime-inserted methods) or the publicly visible API? One solution for internal implementation of Groovy could be (speaking by heart since I don't know the internals of Groovy) for the "surface" public API method which doesn't have to have the special caller parameter, to capture the caller with getCallerClass() parameterless API (possibly enclosed with a quick check confirming that it might actually be needed) and bind it to a ThreadLocal, then use this ThreadLocal down at the end... > and the good integration with Java is one of the key points of > Groovy. Even if we make something like that @CallerSensitive and add the > parameter only in those cases, we break being able to override methods. I guess I don't know every Groovy need to obtain the caller class. I thought the problem was to support calling caller-sensitive methods in Java API (like Class.forName(String)) from within Groovy code, where there are runtime-inserted frames between the "call-site" and the target method. Are there any other needs? > Plus, before Groovy3 is not done we have to support several call paths. > And the oldest one, which is still a fallback, does not support > transporting the caller class through the runtime layers at all. > Changing here is a breaking change. Could you describe those call-paths? Examples of Groovy code and to what it gets translated (equivalent Java code at call site) with a brief description of what each intermediate layer (between the call-site and the target method) does and at which point the caller class is extracted... Regards, Peter >> John Rose suggested to "capture" the caller in the "surface" method and >> bind it with a MethodHandle and then pass such MH down the runtime API >> and finally call that method via MH. > Only that you then need a java7+ only version, plus the already > mentioned problem, that not all of the three general call paths support > that or can be changed in a way to enable that without breaking user code. > > > bye Jochen > From chris.hegarty at oracle.com Tue Jul 30 14:22:47 2013 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Tue, 30 Jul 2013 15:22:47 +0100 Subject: Java 8 RFR 8020539: Clean up doclint problems in java.util package, part 2 In-Reply-To: References: <50FE640E-DC42-47F2-9FAD-8472A013EB9B@oracle.com> <51E77802.8070001@oracle.com> <67232DB5-4077-4A4D-9729-B06C7FD911BF@oracle.com> <51F6142A.2080201@oracle.com> Message-ID: <51F7CC37.2020105@oracle.com> On 07/29/2013 09:06 PM, Brian Burkhalter wrote: > Joe / Chris: > > The updated webrev is in the same place, > http://cr.openjdk.java.net/~bpb/8020539/ > > If this looks good I will need an approval. It looks ok to me. -Chris. > > On Jul 29, 2013, at 12:05 AM, Joe Darcy wrote: > >> I recommend a few changes here: >> >> * For readability, rename "NonASCIIDigit" as "NonAsciiDigit" > > Changed. > >> * Since Scanner is in the regex package, it may be more appropriate to >> stick more of a regex notation than an ebnf notation, but keeping the >> definition list structure tags. > > Changed back to regex notation. > >>> >>>> Offhand, I wasn't aware Dequeue and Queue were maintained in Doug's >>>> CVS, but I agree changes to those files should flow through there first. >>> Deque and Queue removed from the webrev: >>> >>> http://cr.openjdk.java.net/~bpb/8020539/ >>> >> >> Otherwise, the changes look fine. If you like, the non-Scanner changes >> can be split out and pushed first. > > I've left it as one changeset. > > On Jul 29, 2013, at 2:43 AM, Chris Hegarty wrote: > >> Looks fine ( I did not go through the Scanner changes ). >> >> Some minor comments: >> >> 1) List >> Trivially I wonder why you decided to go with '< '>', rather >> than
                                                                    {@code ... }
                                                                    , which I think is more readable. > > Changed. > >> 2) Map >> Trivially, I would keep the @param's order the same as the actual >> method parameters order. > > Changed. > >> 3) Optional >> Strangely, there doesn't appear to be a '@param' for the class level >> type T. doclint is not warning about this either. > > Not changed. > > Thanks, > > Brian From paul.sandoz at oracle.com Tue Jul 30 14:25:45 2013 From: paul.sandoz at oracle.com (Paul Sandoz) Date: Tue, 30 Jul 2013 15:25:45 +0100 Subject: class SplittableRandom In-Reply-To: <51F6B47E.1040102@gmail.com> References: <51DDB26D.8050506@cs.oswego.edu> <51DE6069.2060308@gmail.com> <51DEA230.2060504@cs.oswego.edu> <51DEA3D5.5000509@oracle.com> <51E1549D.4060403@cs.oswego.edu> <51E414C6.9070400@cs.oswego.edu> <6099D28A-0B95-42A4-A59B-5E1C465EDCA9@oracle.com> <480BCC80-2A9C-4321-B81B-47487E90C0D7@oracle.com> <51F6B47E.1040102@gmail.com> Message-ID: <1F6D53ED-F853-4444-A5B3-D28D25E6D5E4@oracle.com> Hi Peter, Given that the user cannot specify gamma values and the for the first 2^16+1 gamma values the minimum bit count is 15, the maximum bit count is 50 and the minimum width is 45, is that not sufficient? i.e. is it likely there will be more than 65537 splits? In the streams API one would be hard pressed to reach this limit, even for splitting an iterator. If i calculated things correctly with an arithmetic progression step size of 1 the limits of the max collection size will be reached (currently we use a step size of 1024) and one is likely to hit other problems way before due to issues with reduction on right-heavy trees. Paul. On Jul 29, 2013, at 7:29 PM, Peter Levart wrote: > > On 07/16/2013 06:01 PM, Guy Steele wrote: >> On Jul 16, 2013, at 3:07 AM, Martin Buchholz wrote: >>> Read Appleby and Stafford ... >>> >>> Hmmm.... mix32 has almost the same job as mix64 - have all the bits in the seed affect all the bits in the output, so the obvious implementation is >>> >>> mix32() { return (int) mix64(); } >>> or more conservatively >>> mix32() { m = mix64(); return (int)m ^ (int)(m >>> 32); } >>> although it would be slightly distressing to have nextInt be more expensive than nextLong. >> Yes---at first I used exactly >> mix32() { return (int) mix64(); } >> but was worried about the time it took, which is why I searched for a cheaper mixing function. >> >>> There might be some clever way of doing murmurhash-style mixing when the input is 64-bit and the output is 32-bit that can do better, but I don't think the current mix32 is it. >> Again, I was astonished that so simply a mixing function seemed to do the job as far as Dieharder is concerned. I agree that it does appear to perform poorly for sparse gamma values. So now the question is: do such sparse gamma values arise in practice? >> >> As Doug has pointed out, we carefully made the two-argument constructor private so that the user cannot specify gamma values. The gamma values are derived only from the gamma-seed 0, using the gamma value GAMMA_GAMMA, and always running the seed through mix64. >> >> I wrote a little test (code and output below) to generate the first 16 billion (well, 2^34+1) gamma values actually generated and gather certain statistics: >> (1) the number of 1-bits in the gamma value (output of Long.bitCount) >> (2) the "width" of the gamma value (64 - Long.numberOfLeadingBits(gamma) - Long.numberOfTrailingBits(gamma)) >> Then it histograms the bit counts, and for each possible bit count tracks the minimum width for gammas having that same bit count. >> Whenever the number of of gammas examined is one more than a power of 2, it prints a report consisting of those two tables and the min over the minwidth table. >> >> Here's a brief summary: >> >> For the first 65 gamma values, no gamma value has fewer than 21 1-bits or more than 41 1-bits. The minimum width is 57. So I predict there will be no weird mixing problems at all when using SplittableRandom to do a balanced split of a stream of generated randoms. >> >> For the first 2^16+1 = 65537 gamma values, the minimum bit count is 15, the maximum bit count is 50 and the minimum width is 45. >> >> For the first 2^24+1 gamma values, the minimum bit count is 12, the maximum bit count is 52 and the minimum width is 35. >> >> For the first 2^32+1 gamma values, the minimum bit count is 9, the maximum bit count is 55 and the minimum width is 28. >> >> For the first 2^34+1 gamma values, the minimum bit count is 8, the maximum bit count is 56 and the minimum width is 28. >> >> So I think we will not hit any really bad gamma values in practice. >> >> --Guy >> > > Hi, > > Would it be possible to skip gammas with less than 12 or more than 52 bits? > > I did some playing with dieharder a week ago, testing SR.nextInt() (mix32) and indeed for sparse gamma values, all dieharder tests show failure. In particular test id=1 (diehard_operm5) is the least forgiving, requiring minimum gamma bit count being about 11 and maximum about 54 in order for such "random" gamma to produce nextInt() bit streams that pass the diehard_operm5 test. Here's a sample of the first 3 dieharder tests (0,1 and 2) for differently sparsed "random" gammas: > > https://raw.github.com/plevart/lambda-hacks/SplittableRandom/SplittableRandom/nextInt_results_0to2.txt > > The alternative: > > public int nextIntAlt1() { > return (int) mix64(nextSeed()); > } > > ... does not exhibit this weakness. It seems to be satisfied with gammas having as few as 1 or as many as 63 bits set to pass dieharder tests: > > https://raw.github.com/plevart/lambda-hacks/SplittableRandom/SplittableRandom/nextIntAlt1_results_0to2.txt > > But such nextInt is slower, approximately as fast as ThreadLocalRandom.nextInt() by my measurements. > > Random streams created by SplittableRandom.nextLong() (mix64) also don't exhibit weaknesses with sparse gammas, so I thought why not using mix64() to produce 64 bits of randomness that is then returned by two consecutive calls to nextInt, like that: > > private int nextInt; > private boolean nextIntZero; > > public int nextIntAlt2() { > if (nextInt != 0) { > int result = nextInt; > nextInt = 0; > return result; > } else if (nextIntZero) { > nextIntZero = false; > return 0; > } else { > long nextLong = mix64(nextSeed()); > nextInt = (int)(nextLong >>> 32); > if (nextInt == 0) nextIntZero = true; > return (int)(nextLong & 0xFFFFFFFFL); > } > } > > The (little-Indian) bitstream produced by nextIntAlt2() is exactly the same as that produced by nextLong() and 1st 3 dieharder tests pass with sparse gammas too: > > https://raw.github.com/plevart/lambda-hacks/SplittableRandom/SplittableRandom/nextIntAlt2_results_0to2.txt > > the measurements produced by micro benchmark show performance somewhere between nextInt() and nextIntAlt1(): > > Benchmark Thr Cnt Sec Mean Mean error Var Units > s.g.t.JmhTest.SR_nextInt 1 8 5 477779.670 1151.048 865504.410 ops/msec > s.g.t.JmhTest.SR_nextIntAlt1 1 8 5 385630.764 513.779 172439.034 ops/msec > s.g.t.JmhTest.SR_nextIntAlt2 1 8 5 432071.940 572.221 213899.640 ops/msec > s.g.t.JmhTest.TLR_nextInt 1 8 5 382334.416 28.907 545.871 ops/msec > > > Here's the JMH micro benchmark I used: > > https://github.com/plevart/lambda-hacks/blob/SplittableRandom/SplittableRandom/src/sr/JmhTest.java > > > Here's the code I used to produce dieharder reports: > > https://github.com/plevart/lambda-hacks/blob/SplittableRandom/SplittableRandom/src/sr/Test.java > > which uses the following utility class to interface dieharder tool: > > https://github.com/plevart/lambda-hacks/blob/SplittableRandom/SplittableRandom/src/si/pele/dieharder/DieharderTest.java > > > Regards, Peter > From peter.levart at gmail.com Tue Jul 30 15:02:04 2013 From: peter.levart at gmail.com (Peter Levart) Date: Tue, 30 Jul 2013 17:02:04 +0200 Subject: class SplittableRandom In-Reply-To: <1F6D53ED-F853-4444-A5B3-D28D25E6D5E4@oracle.com> References: <51DDB26D.8050506@cs.oswego.edu> <51DE6069.2060308@gmail.com> <51DEA230.2060504@cs.oswego.edu> <51DEA3D5.5000509@oracle.com> <51E1549D.4060403@cs.oswego.edu> <51E414C6.9070400@cs.oswego.edu> <6099D28A-0B95-42A4-A59B-5E1C465EDCA9@oracle.com> <480BCC80-2A9C-4321-B81B-47487E90C0D7@oracle.com> <51F6B47E.1040102@gmail.com> <1F6D53ED-F853-4444-A5B3-D28D25E6D5E4@oracle.com> Message-ID: <51F7D56C.8050300@gmail.com> On 07/30/2013 04:25 PM, Paul Sandoz wrote: > Hi Peter, > > Given that the user cannot specify gamma values and the for the first 2^16+1 gamma values the minimum bit count is 15, the maximum bit count is 50 and the minimum width is 45, is that not sufficient? i.e. is it likely there will be more than 65537 splits? > > In the streams API one would be hard pressed to reach this limit, even for splitting an iterator. If i calculated things correctly with an arithmetic progression step size of 1 the limits of the max collection size will be reached (currently we use a step size of 1024) and one is likely to hit other problems way before due to issues with reduction on right-heavy trees. Hi Paul, In streams API it is unlikely, but SplittableRandom is a public API and might be used in other unforeseen scenarios. It's not hard to imagine submitting way more than 2^16 tasks to an Executor, giving each it's own SplittableRandom instance generated from a chain of splits... If it is very rare to encounter a sparse gamma then it is also very cheap to skip it, right? It only takes Long.bitCount(gamma) at each split()... Regards, Peter > Paul. > > On Jul 29, 2013, at 7:29 PM, Peter Levart wrote: > >> On 07/16/2013 06:01 PM, Guy Steele wrote: >>> On Jul 16, 2013, at 3:07 AM, Martin Buchholz wrote: >>>> Read Appleby and Stafford ... >>>> >>>> Hmmm.... mix32 has almost the same job as mix64 - have all the bits in the seed affect all the bits in the output, so the obvious implementation is >>>> >>>> mix32() { return (int) mix64(); } >>>> or more conservatively >>>> mix32() { m = mix64(); return (int)m ^ (int)(m >>> 32); } >>>> although it would be slightly distressing to have nextInt be more expensive than nextLong. >>> Yes---at first I used exactly >>> mix32() { return (int) mix64(); } >>> but was worried about the time it took, which is why I searched for a cheaper mixing function. >>> >>>> There might be some clever way of doing murmurhash-style mixing when the input is 64-bit and the output is 32-bit that can do better, but I don't think the current mix32 is it. >>> Again, I was astonished that so simply a mixing function seemed to do the job as far as Dieharder is concerned. I agree that it does appear to perform poorly for sparse gamma values. So now the question is: do such sparse gamma values arise in practice? >>> >>> As Doug has pointed out, we carefully made the two-argument constructor private so that the user cannot specify gamma values. The gamma values are derived only from the gamma-seed 0, using the gamma value GAMMA_GAMMA, and always running the seed through mix64. >>> >>> I wrote a little test (code and output below) to generate the first 16 billion (well, 2^34+1) gamma values actually generated and gather certain statistics: >>> (1) the number of 1-bits in the gamma value (output of Long.bitCount) >>> (2) the "width" of the gamma value (64 - Long.numberOfLeadingBits(gamma) - Long.numberOfTrailingBits(gamma)) >>> Then it histograms the bit counts, and for each possible bit count tracks the minimum width for gammas having that same bit count. >>> Whenever the number of of gammas examined is one more than a power of 2, it prints a report consisting of those two tables and the min over the minwidth table. >>> >>> Here's a brief summary: >>> >>> For the first 65 gamma values, no gamma value has fewer than 21 1-bits or more than 41 1-bits. The minimum width is 57. So I predict there will be no weird mixing problems at all when using SplittableRandom to do a balanced split of a stream of generated randoms. >>> >>> For the first 2^16+1 = 65537 gamma values, the minimum bit count is 15, the maximum bit count is 50 and the minimum width is 45. >>> >>> For the first 2^24+1 gamma values, the minimum bit count is 12, the maximum bit count is 52 and the minimum width is 35. >>> >>> For the first 2^32+1 gamma values, the minimum bit count is 9, the maximum bit count is 55 and the minimum width is 28. >>> >>> For the first 2^34+1 gamma values, the minimum bit count is 8, the maximum bit count is 56 and the minimum width is 28. >>> >>> So I think we will not hit any really bad gamma values in practice. >>> >>> --Guy >>> >> Hi, >> >> Would it be possible to skip gammas with less than 12 or more than 52 bits? >> >> I did some playing with dieharder a week ago, testing SR.nextInt() (mix32) and indeed for sparse gamma values, all dieharder tests show failure. In particular test id=1 (diehard_operm5) is the least forgiving, requiring minimum gamma bit count being about 11 and maximum about 54 in order for such "random" gamma to produce nextInt() bit streams that pass the diehard_operm5 test. Here's a sample of the first 3 dieharder tests (0,1 and 2) for differently sparsed "random" gammas: >> >> https://raw.github.com/plevart/lambda-hacks/SplittableRandom/SplittableRandom/nextInt_results_0to2.txt >> >> The alternative: >> >> public int nextIntAlt1() { >> return (int) mix64(nextSeed()); >> } >> >> ... does not exhibit this weakness. It seems to be satisfied with gammas having as few as 1 or as many as 63 bits set to pass dieharder tests: >> >> https://raw.github.com/plevart/lambda-hacks/SplittableRandom/SplittableRandom/nextIntAlt1_results_0to2.txt >> >> But such nextInt is slower, approximately as fast as ThreadLocalRandom.nextInt() by my measurements. >> >> Random streams created by SplittableRandom.nextLong() (mix64) also don't exhibit weaknesses with sparse gammas, so I thought why not using mix64() to produce 64 bits of randomness that is then returned by two consecutive calls to nextInt, like that: >> >> private int nextInt; >> private boolean nextIntZero; >> >> public int nextIntAlt2() { >> if (nextInt != 0) { >> int result = nextInt; >> nextInt = 0; >> return result; >> } else if (nextIntZero) { >> nextIntZero = false; >> return 0; >> } else { >> long nextLong = mix64(nextSeed()); >> nextInt = (int)(nextLong >>> 32); >> if (nextInt == 0) nextIntZero = true; >> return (int)(nextLong & 0xFFFFFFFFL); >> } >> } >> >> The (little-Indian) bitstream produced by nextIntAlt2() is exactly the same as that produced by nextLong() and 1st 3 dieharder tests pass with sparse gammas too: >> >> https://raw.github.com/plevart/lambda-hacks/SplittableRandom/SplittableRandom/nextIntAlt2_results_0to2.txt >> >> the measurements produced by micro benchmark show performance somewhere between nextInt() and nextIntAlt1(): >> >> Benchmark Thr Cnt Sec Mean Mean error Var Units >> s.g.t.JmhTest.SR_nextInt 1 8 5 477779.670 1151.048 865504.410 ops/msec >> s.g.t.JmhTest.SR_nextIntAlt1 1 8 5 385630.764 513.779 172439.034 ops/msec >> s.g.t.JmhTest.SR_nextIntAlt2 1 8 5 432071.940 572.221 213899.640 ops/msec >> s.g.t.JmhTest.TLR_nextInt 1 8 5 382334.416 28.907 545.871 ops/msec >> >> >> Here's the JMH micro benchmark I used: >> >> https://github.com/plevart/lambda-hacks/blob/SplittableRandom/SplittableRandom/src/sr/JmhTest.java >> >> >> Here's the code I used to produce dieharder reports: >> >> https://github.com/plevart/lambda-hacks/blob/SplittableRandom/SplittableRandom/src/sr/Test.java >> >> which uses the following utility class to interface dieharder tool: >> >> https://github.com/plevart/lambda-hacks/blob/SplittableRandom/SplittableRandom/src/si/pele/dieharder/DieharderTest.java >> >> >> Regards, Peter >> From dl at cs.oswego.edu Tue Jul 30 15:10:51 2013 From: dl at cs.oswego.edu (Doug Lea) Date: Tue, 30 Jul 2013 11:10:51 -0400 Subject: class SplittableRandom In-Reply-To: <51F6B47E.1040102@gmail.com> References: <51DDB26D.8050506@cs.oswego.edu> <51DE6069.2060308@gmail.com> <51DEA230.2060504@cs.oswego.edu> <51DEA3D5.5000509@oracle.com> <51E1549D.4060403@cs.oswego.edu> <51E414C6.9070400@cs.oswego.edu> <6099D28A-0B95-42A4-A59B-5E1C465EDCA9@oracle.com> <480BCC80-2A9C-4321-B81B-47487E90C0D7@oracle.com> <51F6B47E.1040102@gmail.com> Message-ID: <51F7D77B.6010300@cs.oswego.edu> On 07/29/13 14:29, Peter Levart wrote: > > On 07/16/2013 06:01 PM, Guy Steele wrote: >> So I think we will not hit any really bad gamma values in practice. >> > > Would it be possible to skip gammas with less than 12 or more than 52 bits? > Or better, eliminate dependence on bit density. I'm working on it... -Doug From chris.hegarty at oracle.com Tue Jul 30 15:18:50 2013 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Tue, 30 Jul 2013 16:18:50 +0100 Subject: RFR 8021863: Stream.concat incorrectly calculates unsized state In-Reply-To: <7E3DF7C4-32CD-4731-9C10-C38FAE0BB4B8@oracle.com> References: <7E3DF7C4-32CD-4731-9C10-C38FAE0BB4B8@oracle.com> Message-ID: <51F7D95A.60604@oracle.com> Looks ok to me Paul. -Chris. On 07/30/2013 11:53 AM, Paul Sandoz wrote: > Hi, > > http://cr.openjdk.java.net/~psandoz/tl/JDK-8021863-concat-size/webrev/ > > This patch just tidies up calculating whether the concatenating spliterator is unsized or not before splitting. There was a typo when checking spliterator characteristics, but it turns out the characteristics do not need to be checked. Some tests are also added. > > Paul. > From blackdrag at gmx.org Tue Jul 30 15:33:36 2013 From: blackdrag at gmx.org (Jochen Theodorou) Date: Tue, 30 Jul 2013 17:33:36 +0200 Subject: Classes on the stack trace (was: getElementClass/StackTraceElement, was: @CallerSensitive public API, was: sun.reflect.Reflection.getCallerClass) In-Reply-To: <51F7CACD.2070703@gmail.com> References: <51F7AEEE.4040305@gmail.com> <51F7BD75.4030708@gmx.org> <51F7CACD.2070703@gmail.com> Message-ID: <51F7DCD0.1030306@gmx.org> Am 30.07.2013 16:16, schrieb Peter Levart: > > On 07/30/2013 03:19 PM, Jochen Theodorou wrote: >> Am 30.07.2013 14:17, schrieb Peter Levart: >> [...] >>> So what would give Groovy or other language runtimes headaches when all >>> there was was a parameter-less getCallerClass() API? Aren't the >>> intermediate frames inserted by those runtimes controlled by the >>> runtimes? Couldn't the "surface" runtime-inserted methods capture the >>> caller and pass it down? I guess the problem is supporting calling the >>> caller-sensitive methods like Class.forName(String) and such which don't >>> have the overloaded variant taking caller Class or ClassLoader as an >>> argument... >> Speaking for Groovy... >> those intermediate frames are runtime controlled, yes, but passing down >> the caller class is exactly the problem. Imagine I would suggest that >> each and every method definition in Java automatically gets an >> additional parameter for the caller class, just to have access to it >> inside the method. You would not accept that for Java, would you? And so >> we cannot accept that for Groovy if we want to keep integration with >> Java... > > Are you talking about internal Groovy implementation (the > runtime-inserted methods) or the publicly visible API? that's the problem, it is a mix, some internal, other not. We are going to change that in Groovy 3 > One solution for > internal implementation of Groovy could be (speaking by heart since I > don't know the internals of Groovy) for the "surface" public API method > which doesn't have to have the special caller parameter, to capture the > caller with getCallerClass() parameterless API (possibly enclosed with a > quick check confirming that it might actually be needed) and bind it to > a ThreadLocal, then use this ThreadLocal down at the end... confirming that it might actually be needed is a problem. In the old fallback path we don't know what we call until after we are deep in runtime code, and there it is too late. In the other paths we could mark those methods in a @CallerSensitive style and do it in that case only. >> and the good integration with Java is one of the key points of >> Groovy. Even if we make something like that @CallerSensitive and add the >> parameter only in those cases, we break being able to override methods. > > I guess I don't know every Groovy need to obtain the caller class. I > thought the problem was to support calling caller-sensitive methods in > Java API (like Class.forName(String)) from within Groovy code, where > there are runtime-inserted frames between the "call-site" and the target > method. Are there any other needs? ok, there is a misunderstanding... if we call a Java implemented method from Groovy, which is using getCallerClass() it may or may not work. In general this does not work and our problem is not about that at all. With the change to let getCallerClass() ignore some reflective frames it will work actually better as long as we use our custom callsite caching implementation, it will not work if indy is used or the fallback path. To be able to call a method Class#forName(String), we need to "replace" it with an implementation of our own, which we do with an approach similar to extension methods (only that ours can hide existing implementation methods for groovy). And in there we need to get to the caller class Our problem though is @Grab which is an annotation to add elements to the classpath while running a script. >> Plus, before Groovy3 is not done we have to support several call paths. >> And the oldest one, which is still a fallback, does not support >> transporting the caller class through the runtime layers at all. >> Changing here is a breaking change. > > Could you describe those call-paths? Examples of Groovy code and to what > it gets translated (equivalent Java code at call site) with a brief > description of what each intermediate layer (between the call-site and > the target method) does and at which point the caller class is extracted... the code generated at the call site depends on several factors actually... The call site code itself is usually not very informative I start with Groovy 1.0, since that is basically the fallback path. Here this.foo() translates more or less to ScriptBytecodeAdapter.invokeMethod0(staticCallerClass, this,"foo") which basically does this.getMetaClass().invokeMethod(staticCallerClass, this, "foo"). The problem is that the meta class might be user supplied and the code executed in invokeMethod as well. The invocation is then finally done by reflection. That means we have frames from ScriptBytecodeAdapter, from the meta class, as well as maybe frames from a custom meta class and reflection frames. At the level of ScriptBytecodeAdapter there is a means of transporting the caller class, but that is the static one. Once there is a subclass, this information is different from what is needed here and it cannot simply be exchanged. Even if the bytecode adapter is changed, we cannot change the public API for MetaClass#invokeMethod now. And then the information would be lost. In later versions of Groovy (since 1.6) we introduced a custom call site caching technique, which uses runtime generated classes to create a helper class per call site and is then used for invocation. At the callsite we basically have something like callsiteArray[i].invoke(..). Here again the staticCallerClass can be found. In this version we are able to "get" the method we want to invoke, before invoking it (bypassing MetaClass#invokeMethod). But to be able to get the method, certain conditions have to be met (like no user supplied meta class). If they are not met, then we do basically the same path as in 1.0, only that we don't use ScriptBytecodeAdapter. Instead We use our CallSite class as entrance point, which then makes the call to the meta class. In the "efficent" case we have now frames from the callsite handling code between the callsite and the target method only. This includes reflection in the first instantiation, later the generated class is used so it reduces to two frames of which one is the Callsite entrance point, the other a frame form the generated method. In the fallback case we have frames from the callsite handling code, plus meta class code, plus reflection of course. Again the fallback case prevents us from transporting the caller information to the target method. If we ignore the fallback case, then we could here maybe use the Threadlocal information. It will require a new callsite interface for the bytecode though, meaning this code will not work for precompiled grovvy of older version, excluding from getting into Groovy 2.1.x, since it would be a breaking change. The earliest version for that would be Groovy 2.2.0, which is almost in RC now. Effectively it would mean we would have to do a 2.3.0 very soon after most probably. In Groovy 2 we added an indy implementation, which replaces the callsite caching code. At the callsite we have here basically invokedynamic "foo" with IndyInterface#bootstrap. bootstrap will first introduce a target for IndyInterface#selectMethod, since I need the runtime types instead of the static ones. The static caller class information is here part of the bootstrap method as Lookup object, added by invokedynamic itself. After selectMethod is done we have an initial invocation using invokeExact and later invocations by the handle stored in the callsite. Of course the same conditions as for the callsite caching above have to be met, meaning the fallback path might appear. That makes initially one IndyInterface frame, then invokedynamic and lambda related frames, then optionally the traget method, or in the fallback case the meta class frames plus reflection bye Jochen -- Jochen "blackdrag" Theodorou - Groovy Project Tech Lead blog: http://blackdragsview.blogspot.com/ german groovy discussion newsgroup: de.comp.lang.misc For Groovy programming sources visit http://groovy-lang.org From ivan.gerasimov at oracle.com Tue Jul 30 15:35:10 2013 From: ivan.gerasimov at oracle.com (Ivan Gerasimov) Date: Tue, 30 Jul 2013 19:35:10 +0400 Subject: RFR [7192942] Optimizing calculation of power of 2 in HashMap Message-ID: <51F7DD2E.6060204@oracle.com> Hello everybody! HashTable needs to calculate the power of two that is not less that the given number. This calculation used to be implemented as a relatively inefficient loop (that's why the issue 7192942 was created). The implementation was improved with http://hg.openjdk.java.net/jdk8/jdk8/jdk/rev/2e3cc7f599ca However it can be improved even more. I reused 7192942 number for this propose. Would you please help with reviewing? Here's the webrev: http://cr.openjdk.java.net/~igerasim/7192942/0/webrev/ I also created a benchmark test to make sure the improvement is observable. Here's the jmh benchmark I used: http://cr.openjdk.java.net/~igerasim/bench/powoftwo/src/main/java/org/benches/PowerOfTwoBench.java Benchmark Mode Thr Cnt Sec Mean Mean error Units o.b.PowerOfTwoBench.benchPowerOfTwoA avgt 1 20 5 60.697 0.850 msec/op o.b.PowerOfTwoBench.benchPowerOfTwoB avgt 1 20 5 53.013 0.940 msec/op The first line is for the current implementation and the second one is for the proposed change. Thus, the time gets reduced by 12%. Sincerely yours, Ivan From chris.hegarty at oracle.com Tue Jul 30 15:57:23 2013 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Tue, 30 Jul 2013 16:57:23 +0100 Subject: RFR 8021883 j.u.Random/RandomStream.java test needs more robust timeout duration In-Reply-To: References: Message-ID: <51F7E263.7060206@oracle.com> Paul, This looks like a nice cleanup, as well as fixing the timeout issue. I just don't get the change in failure criteria. The old test used to verify that the arrays of random numbers of all generating threads were not equal, but now your checking the number of tasks? -Chris. > Hi, > > http://cr.openjdk.java.net/~psandoz/tl/JDK-8021883-random-stream-test/webrev/ > > This patch updates tests for ThreadLocalRandom streams and increases the timeout duration. Although the original should be enough for most cases in certain virtualized and emulated environments it might not be. I also took the liberty of consolidating the code and sprinkling stream and CompletableFuture dust on things. > > Paul. > From paul.sandoz at oracle.com Tue Jul 30 16:14:11 2013 From: paul.sandoz at oracle.com (Paul Sandoz) Date: Tue, 30 Jul 2013 17:14:11 +0100 Subject: RFR 8021883 j.u.Random/RandomStream.java test needs more robust timeout duration In-Reply-To: <51F7E263.7060206@oracle.com> References: <51F7E263.7060206@oracle.com> Message-ID: <9ED2D38A-0D67-4C1B-A269-8AFBBE7F8B00@oracle.com> On Jul 30, 2013, at 4:57 PM, Chris Hegarty wrote: > Paul, > > This looks like a nice cleanup, as well as fixing the timeout issue. > > I just don't get the change in failure criteria. The old test used to verify that the arrays of random numbers of all generating threads were not equal, but now your checking the number of tasks? > Previously the first result was checked if it was distinct. Now it checks all results are unique: add results to a set, if results are distinct the size should be the same as the # tasks producing the results. Note i was carefully to replace arrays with lists to ensure equals by content not reference. In fact it would be clearer to do: int rc = cfs.stream().map(CompletableFuture::join).distinct().count(); assertEquals(rc, tasks); Paul. From chris.hegarty at oracle.com Tue Jul 30 16:25:17 2013 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Tue, 30 Jul 2013 17:25:17 +0100 Subject: RFR 8021883 j.u.Random/RandomStream.java test needs more robust timeout duration In-Reply-To: <9ED2D38A-0D67-4C1B-A269-8AFBBE7F8B00@oracle.com> References: <51F7E263.7060206@oracle.com> <9ED2D38A-0D67-4C1B-A269-8AFBBE7F8B00@oracle.com> Message-ID: <51F7E8ED.5030000@oracle.com> On 07/30/2013 05:14 PM, Paul Sandoz wrote: > On Jul 30, 2013, at 4:57 PM, Chris Hegarty wrote: >> Paul, >> >> This looks like a nice cleanup, as well as fixing the timeout issue. >> >> I just don't get the change in failure criteria. The old test used to verify that the arrays of random numbers of all generating threads were not equal, but now your checking the number of tasks? >> > > Previously the first result was checked if it was distinct. Now it checks all results are unique: add results to a set, if results are distinct the size should be the same as the # tasks producing the results. Note i was carefully to replace arrays with lists to ensure equals by content not reference. Ah ok, got it. > In fact it would be clearer to do: > > int rc = cfs.stream().map(CompletableFuture::join).distinct().count(); > assertEquals(rc, tasks); This would be a little more obvious ( to me ). -Chris. > > Paul. > From paul.sandoz at oracle.com Tue Jul 30 16:31:18 2013 From: paul.sandoz at oracle.com (Paul Sandoz) Date: Tue, 30 Jul 2013 17:31:18 +0100 Subject: RFR 8021883 j.u.Random/RandomStream.java test needs more robust timeout duration In-Reply-To: <51F7E8ED.5030000@oracle.com> References: <51F7E263.7060206@oracle.com> <9ED2D38A-0D67-4C1B-A269-8AFBBE7F8B00@oracle.com> <51F7E8ED.5030000@oracle.com> Message-ID: On Jul 30, 2013, at 5:25 PM, Chris Hegarty wrote: > On 07/30/2013 05:14 PM, Paul Sandoz wrote: >> On Jul 30, 2013, at 4:57 PM, Chris Hegarty wrote: >>> Paul, >>> >>> This looks like a nice cleanup, as well as fixing the timeout issue. >>> >>> I just don't get the change in failure criteria. The old test used to verify that the arrays of random numbers of all generating threads were not equal, but now your checking the number of tasks? >>> >> >> Previously the first result was checked if it was distinct. Now it checks all results are unique: add results to a set, if results are distinct the size should be the same as the # tasks producing the results. Note i was carefully to replace arrays with lists to ensure equals by content not reference. > > Ah ok, got it. > >> In fact it would be clearer to do: >> >> int rc = cfs.stream().map(CompletableFuture::join).distinct().count(); >> assertEquals(rc, tasks); > > This would be a little more obvious ( to me ). > Updated patch (and lambda repo). Paul. From mike.duigou at oracle.com Tue Jul 30 16:32:04 2013 From: mike.duigou at oracle.com (Mike Duigou) Date: Tue, 30 Jul 2013 09:32:04 -0700 Subject: RFR [7192942] Optimizing calculation of power of 2 in HashMap In-Reply-To: <51F7DD2E.6060204@oracle.com> References: <51F7DD2E.6060204@oracle.com> Message-ID: <98B37F3D-2B51-4E5C-96E9-52B698BB5E8B@oracle.com> Hi Ivan; This looks like a good improvement. My only disappointment is that I didn't notice it when adding the roundUpToPowerOf2 method! Do you need a sponsor to push the fix? Mike On Jul 30 2013, at 08:35 , Ivan Gerasimov wrote: > Hello everybody! > > HashTable needs to calculate the power of two that is not less that the given number. > This calculation used to be implemented as a relatively inefficient loop (that's why the issue 7192942 was created). > The implementation was improved with http://hg.openjdk.java.net/jdk8/jdk8/jdk/rev/2e3cc7f599ca > > However it can be improved even more. I reused 7192942 number for this propose. > > Would you please help with reviewing? > Here's the webrev: http://cr.openjdk.java.net/~igerasim/7192942/0/webrev/ > > I also created a benchmark test to make sure the improvement is observable. > Here's the jmh benchmark I used: > http://cr.openjdk.java.net/~igerasim/bench/powoftwo/src/main/java/org/benches/PowerOfTwoBench.java > > Benchmark Mode Thr Cnt Sec Mean Mean error Units > o.b.PowerOfTwoBench.benchPowerOfTwoA avgt 1 20 5 60.697 0.850 msec/op > o.b.PowerOfTwoBench.benchPowerOfTwoB avgt 1 20 5 53.013 0.940 msec/op > > The first line is for the current implementation and the second one is for the proposed change. > Thus, the time gets reduced by 12%. > > Sincerely yours, > Ivan From ivan.gerasimov at oracle.com Tue Jul 30 16:41:31 2013 From: ivan.gerasimov at oracle.com (Ivan Gerasimov) Date: Tue, 30 Jul 2013 20:41:31 +0400 Subject: RFR [7192942] Optimizing calculation of power of 2 in HashMap In-Reply-To: <98B37F3D-2B51-4E5C-96E9-52B698BB5E8B@oracle.com> References: <51F7DD2E.6060204@oracle.com> <98B37F3D-2B51-4E5C-96E9-52B698BB5E8B@oracle.com> Message-ID: <51F7ECBB.707@oracle.com> Thanks, Mike! Yes, I need a sponsor and would really appreciate your help. Sincerely yours, Ivan On 30.07.2013 20:32, Mike Duigou wrote: > Hi Ivan; > > This looks like a good improvement. My only disappointment is that I didn't notice it when adding the roundUpToPowerOf2 method! > > Do you need a sponsor to push the fix? > > Mike > > On Jul 30 2013, at 08:35 , Ivan Gerasimov wrote: > >> Hello everybody! >> >> HashTable needs to calculate the power of two that is not less that the given number. >> This calculation used to be implemented as a relatively inefficient loop (that's why the issue 7192942 was created). >> The implementation was improved with http://hg.openjdk.java.net/jdk8/jdk8/jdk/rev/2e3cc7f599ca >> >> However it can be improved even more. I reused 7192942 number for this propose. >> >> Would you please help with reviewing? >> Here's the webrev: http://cr.openjdk.java.net/~igerasim/7192942/0/webrev/ >> >> I also created a benchmark test to make sure the improvement is observable. >> Here's the jmh benchmark I used: >> http://cr.openjdk.java.net/~igerasim/bench/powoftwo/src/main/java/org/benches/PowerOfTwoBench.java >> >> Benchmark Mode Thr Cnt Sec Mean Mean error Units >> o.b.PowerOfTwoBench.benchPowerOfTwoA avgt 1 20 5 60.697 0.850 msec/op >> o.b.PowerOfTwoBench.benchPowerOfTwoB avgt 1 20 5 53.013 0.940 msec/op >> >> The first line is for the current implementation and the second one is for the proposed change. >> Thus, the time gets reduced by 12%. >> >> Sincerely yours, >> Ivan > > From mike.duigou at oracle.com Tue Jul 30 16:44:20 2013 From: mike.duigou at oracle.com (Mike Duigou) Date: Tue, 30 Jul 2013 09:44:20 -0700 Subject: CFR: 8020977: StringJoiner merges with itself not as expected In-Reply-To: <51F72532.3010101@oracle.com> References: <51F72532.3010101@oracle.com> Message-ID: Looks good to me as well. Mike On Jul 29 2013, at 19:30 , Henry Jen wrote: > Hi, > > Please review a simple fix for 8020977. > > The fix grab the length before initiate copying operation, so that the > 'delimiter' added for this won't be included in copy. > > For rest cases, the timing window changed a little, but that's fine as > simultaneous changes is not determined. > > Cheers, > Henry From aleksey.shipilev at oracle.com Tue Jul 30 16:47:29 2013 From: aleksey.shipilev at oracle.com (Aleksey Shipilev) Date: Tue, 30 Jul 2013 20:47:29 +0400 Subject: RFR [7192942] Optimizing calculation of power of 2 in HashMap In-Reply-To: <51F7DD2E.6060204@oracle.com> References: <51F7DD2E.6060204@oracle.com> Message-ID: <51F7EE21.3020907@oracle.com> On 07/30/2013 07:35 PM, Ivan Gerasimov wrote: > I also created a benchmark test to make sure the improvement is observable. > Here's the jmh benchmark I used: > http://cr.openjdk.java.net/~igerasim/bench/powoftwo/src/main/java/org/benches/PowerOfTwoBench.java > The nit: volatile writes are probably offset the results too much, it's better to use the explicit idiom to feed the values: @GenerateMicroBenchmark public void benchPowerOfTwoA(BlackHole bh) { for (i = 0; i != MAX_I; ++i) { bh.consume(roundUpToPowerOf2A(i)); } } -Aleksey. From stuart.marks at oracle.com Tue Jul 30 17:00:54 2013 From: stuart.marks at oracle.com (Stuart Marks) Date: Tue, 30 Jul 2013 10:00:54 -0700 Subject: CFR: 8020977: StringJoiner merges with itself not as expected In-Reply-To: <51F7286C.9000508@oracle.com> References: <51F72532.3010101@oracle.com> <51F7286C.9000508@oracle.com> Message-ID: <51F7F146.80704@oracle.com> Hi Henry, A couple minor comments on this. I don't think it's necessary to snapshot other.value into a local otherBuilder variable. If other == this, when the value is mutated by prepareBuilder(), otherBuilder still points to this.value, whose contents have changed. So the actual data isn't being snapshotted, as is implied by the comment "seize the data". The essence of the change is to snapshot other's original length. Of course this works because we know that prepareBuilder() only appends, so we don't have to copy the entire value. I'd just use other.value and clarify the comment. ** It's a separate issue but I spent some time puzzling over the (other.prefix.length() < length) condition trying to figure out why it's necessary. It turns out that it isn't. :-) [At least that I could see; the tests may prove me wrong.] It's invariant that other.prefix.length() <= other.value.length(). They're only equal length if somebody has added the empty string to other. So the condition saves a call to append() if this is the case. Having this test is an optimization of sorts, but append() handles appending a zero-length interval just fine, so IMO this extra test adds a bit of clutter to the code. Up to you whether you want to do anything about this. Thanks, s'marks On 7/29/13 7:43 PM, Henry Jen wrote: > Sorry, the webrev is at > > http://cr.openjdk.java.net/~henryjen/tl/8020977/0/webrev/ > > Cheers, > Henry > > On 07/29/2013 07:30 PM, Henry Jen wrote: >> Hi, >> >> Please review a simple fix for 8020977. >> >> The fix grab the length before initiate copying operation, so that the >> 'delimiter' added for this won't be included in copy. >> >> For rest cases, the timing window changed a little, but that's fine as >> simultaneous changes is not determined. >> >> Cheers, >> Henry >> > From ivan.gerasimov at oracle.com Tue Jul 30 17:05:23 2013 From: ivan.gerasimov at oracle.com (Ivan Gerasimov) Date: Tue, 30 Jul 2013 21:05:23 +0400 Subject: RFR [7192942] Optimizing calculation of power of 2 in HashMap In-Reply-To: <51F7EE21.3020907@oracle.com> References: <51F7DD2E.6060204@oracle.com> <51F7EE21.3020907@oracle.com> Message-ID: <51F7F253.2090708@oracle.com> On 30.07.2013 20:47, Aleksey Shipilev wrote: > On 07/30/2013 07:35 PM, Ivan Gerasimov wrote: >> I also created a benchmark test to make sure the improvement is observable. >> Here's the jmh benchmark I used: >> http://cr.openjdk.java.net/~igerasim/bench/powoftwo/src/main/java/org/benches/PowerOfTwoBench.java >> > The nit: volatile writes are probably offset the results too much, it's > better to use the explicit idiom to feed the values: > > @GenerateMicroBenchmark > public void benchPowerOfTwoA(BlackHole bh) { > for (i = 0; i != MAX_I; ++i) { > bh.consume(roundUpToPowerOf2A(i)); > } > } Thanks, Aleksey! Yes, this is much clearer. And shows much better improvement too :-) Now it becomes ~45%. Benchmark Mode Thr Cnt Sec Mean Mean error Units o.b.PowerOfTwoBench.benchPowerOfTwoA avgt 1 20 5 16.872 0.276 msec/op o.b.PowerOfTwoBench.benchPowerOfTwoB avgt 1 20 5 9.304 0.378 msec/op Sincerely yours, Ivan > -Aleksey. > > From nicholas+openjdk at nicholaswilliams.net Tue Jul 30 18:02:45 2013 From: nicholas+openjdk at nicholaswilliams.net (Nick Williams) Date: Tue, 30 Jul 2013 13:02:45 -0500 Subject: Try to run core libs tests -- All IO tests failing Message-ID: <68C504A0-F6DE-4A4D-B09C-0EC8FF1137AE@nicholaswilliams.net> I'm running the core libs tests locally (for the first time), and every java.io test is failing. They're all failing for the same reason (output below), and I suspect it's something local and not an actual problem. But the test output is not very helpful. Note that all of the java.beans tests passed with flying colors. Once it got to java.io, everything started failing. Worse, each test is taking 60 seconds to fail. I could be here a while... Thoughts? Here's the output from one of the tests. It looks like all the other test outputs: #Test Results (version 2) #Tue Jul 30 12:38:15 CDT 2013 #-----testdescription----- $file=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test/java/io/BufferedInputStream/ReadAfterClose.java $root=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test keywords=bug4143651 run=ASSUMED_ACTION main ReadAfterClose\n source=ReadAfterClose.java title=Test if I/O methods will check if the stream has been closed. #-----environment----- #-----testresult----- description=file\:/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test/java/io/BufferedInputStream/ReadAfterClose.java elapsed=60007 0\:01\:00.007 end=Tue Jul 30 12\:38\:15 CDT 2013 environment=regtest execStatus=Error. Cannot get VM for test\: java.net.SocketTimeoutException\: Accept timed out hostname=unknown javatestOS=Mac OS X 10.7.5 (x86_64) javatestVersion=4.4.1 jtregVersion=jtreg 4.1 dev b00 script=com.sun.javatest.regtest.RegressionScript sections=script_messages build compile start=Tue Jul 30 12\:37\:15 CDT 2013 test=java/io/BufferedInputStream/ReadAfterClose.java user.name=Nicholas work=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/build/macosx-amd64/testoutput/jdk_io/JTwork/java/io/BufferedInputStream #section:script_messages ----------messages:(5/308)---------- JDK under test: (/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/test/../build/macosx-x86_64-normal-server-release/images/j2sdk-image) openjdk version "1.8.0-internal" OpenJDK Runtime Environment (build 1.8.0-internal-icholas_2013_07_29_21_14-b00) OpenJDK 64-Bit Server VM (build 25.0-b42, mixed mode) #section:build ----------messages:(3/100)---------- command: build ReadAfterClose reason: Named class compiled on demand elapsed time (seconds): 60.005 result: Error. Cannot get VM for test: java.net.SocketTimeoutException: Accept timed out #section:compile ----------messages:(3/235)---------- command: compile -XDignore.symbol.file=true /Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test/java/io/BufferedInputStream/ReadAfterClose.java reason: .class file out of date or does not exist elapsed time (seconds): 60.005 result: Error. Cannot get VM for test: java.net.SocketTimeoutException: Accept timed out test result: Error. Cannot get VM for test: java.net.SocketTimeoutException: Accept timed out From jason.uh at oracle.com Tue Jul 30 18:05:19 2013 From: jason.uh at oracle.com (jason.uh at oracle.com) Date: Tue, 30 Jul 2013 18:05:19 +0000 Subject: hg: jdk8/tl/jdk: 8021833: javadoc cleanup in java.net Message-ID: <20130730180543.A4C1A48485@hg.openjdk.java.net> Changeset: c76f89695c90 Author: juh Date: 2013-07-30 11:04 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/c76f89695c90 8021833: javadoc cleanup in java.net Summary: and converted to {@code }; package.html to package-info.java Reviewed-by: darcy, chegar ! src/share/classes/java/net/Authenticator.java ! src/share/classes/java/net/ContentHandler.java ! src/share/classes/java/net/ContentHandlerFactory.java ! src/share/classes/java/net/CookieHandler.java ! src/share/classes/java/net/CookieManager.java ! src/share/classes/java/net/CookiePolicy.java ! src/share/classes/java/net/CookieStore.java ! src/share/classes/java/net/DatagramPacket.java ! src/share/classes/java/net/DatagramSocket.java ! src/share/classes/java/net/DatagramSocketImpl.java ! src/share/classes/java/net/DatagramSocketImplFactory.java ! src/share/classes/java/net/FileNameMap.java ! src/share/classes/java/net/HttpCookie.java ! src/share/classes/java/net/HttpRetryException.java ! src/share/classes/java/net/HttpURLConnection.java ! src/share/classes/java/net/IDN.java ! src/share/classes/java/net/Inet4Address.java ! src/share/classes/java/net/Inet6Address.java ! src/share/classes/java/net/InetAddress.java ! src/share/classes/java/net/InetSocketAddress.java ! src/share/classes/java/net/InterfaceAddress.java ! src/share/classes/java/net/JarURLConnection.java ! src/share/classes/java/net/MalformedURLException.java ! src/share/classes/java/net/MulticastSocket.java ! src/share/classes/java/net/NetPermission.java ! src/share/classes/java/net/NetworkInterface.java ! src/share/classes/java/net/PasswordAuthentication.java ! src/share/classes/java/net/PortUnreachableException.java ! src/share/classes/java/net/ProtocolException.java ! src/share/classes/java/net/Proxy.java ! src/share/classes/java/net/ProxySelector.java ! src/share/classes/java/net/ResponseCache.java ! src/share/classes/java/net/ServerSocket.java ! src/share/classes/java/net/Socket.java ! src/share/classes/java/net/SocketException.java ! src/share/classes/java/net/SocketImpl.java ! src/share/classes/java/net/SocketImplFactory.java ! src/share/classes/java/net/SocketInputStream.java ! src/share/classes/java/net/SocketOptions.java ! src/share/classes/java/net/SocketOutputStream.java ! src/share/classes/java/net/SocketPermission.java ! src/share/classes/java/net/SocksSocketImpl.java ! src/share/classes/java/net/URI.java ! src/share/classes/java/net/URISyntaxException.java ! src/share/classes/java/net/URL.java ! src/share/classes/java/net/URLClassLoader.java ! src/share/classes/java/net/URLConnection.java ! src/share/classes/java/net/URLDecoder.java ! src/share/classes/java/net/URLEncoder.java ! src/share/classes/java/net/URLStreamHandler.java ! src/share/classes/java/net/URLStreamHandlerFactory.java ! src/share/classes/java/net/UnknownHostException.java ! src/share/classes/java/net/UnknownServiceException.java + src/share/classes/java/net/package-info.java - src/share/classes/java/net/package.html From Alan.Bateman at oracle.com Tue Jul 30 18:10:32 2013 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Tue, 30 Jul 2013 11:10:32 -0700 Subject: Try to run core libs tests -- All IO tests failing In-Reply-To: <68C504A0-F6DE-4A4D-B09C-0EC8FF1137AE@nicholaswilliams.net> References: <68C504A0-F6DE-4A4D-B09C-0EC8FF1137AE@nicholaswilliams.net> Message-ID: <51F80198.4050209@oracle.com> On 30/07/2013 11:02, Nick Williams wrote: > I'm running the core libs tests locally (for the first time), and every java.io test is failing. They're all failing for the same reason (output below), and I suspect it's something local and not an actual problem. But the test output is not very helpful. Note that all of the java.beans tests passed with flying colors. Once it got to java.io, everything started failing. Worse, each test is taking 60 seconds to fail. I could be here a while... > > Thoughts? What command are you using? From the output it suggests that the connection between jtreg and the agent VM cannot be established. -Alan. > > Here's the output from one of the tests. It looks like all the other test outputs: > > #Test Results (version 2) > #Tue Jul 30 12:38:15 CDT 2013 > #-----testdescription----- > $file=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test/java/io/BufferedInputStream/ReadAfterClose.java > $root=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test > keywords=bug4143651 > run=ASSUMED_ACTION main ReadAfterClose\n > source=ReadAfterClose.java > title=Test if I/O methods will check if the stream has been closed. > > #-----environment----- > > #-----testresult----- > description=file\:/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test/java/io/BufferedInputStream/ReadAfterClose.java > elapsed=60007 0\:01\:00.007 > end=Tue Jul 30 12\:38\:15 CDT 2013 > environment=regtest > execStatus=Error. Cannot get VM for test\: java.net.SocketTimeoutException\: Accept timed out > hostname=unknown > javatestOS=Mac OS X 10.7.5 (x86_64) > javatestVersion=4.4.1 > jtregVersion=jtreg 4.1 dev b00 > script=com.sun.javatest.regtest.RegressionScript > sections=script_messages build compile > start=Tue Jul 30 12\:37\:15 CDT 2013 > test=java/io/BufferedInputStream/ReadAfterClose.java > user.name=Nicholas > work=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/build/macosx-amd64/testoutput/jdk_io/JTwork/java/io/BufferedInputStream > > #section:script_messages > ----------messages:(5/308)---------- > JDK under test: (/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/test/../build/macosx-x86_64-normal-server-release/images/j2sdk-image) > openjdk version "1.8.0-internal" > OpenJDK Runtime Environment (build 1.8.0-internal-icholas_2013_07_29_21_14-b00) > OpenJDK 64-Bit Server VM (build 25.0-b42, mixed mode) > > > #section:build > ----------messages:(3/100)---------- > command: build ReadAfterClose > reason: Named class compiled on demand > elapsed time (seconds): 60.005 > result: Error. Cannot get VM for test: java.net.SocketTimeoutException: Accept timed out > > #section:compile > ----------messages:(3/235)---------- > command: compile -XDignore.symbol.file=true /Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test/java/io/BufferedInputStream/ReadAfterClose.java > reason: .class file out of date or does not exist > elapsed time (seconds): 60.005 > result: Error. Cannot get VM for test: java.net.SocketTimeoutException: Accept timed out > > > test result: Error. Cannot get VM for test: java.net.SocketTimeoutException: Accept timed out > From nicholas+openjdk at nicholaswilliams.net Tue Jul 30 18:16:54 2013 From: nicholas+openjdk at nicholaswilliams.net (Nick Williams) Date: Tue, 30 Jul 2013 13:16:54 -0500 Subject: Try to run core libs tests -- All IO tests failing In-Reply-To: <51F80198.4050209@oracle.com> References: <68C504A0-F6DE-4A4D-B09C-0EC8FF1137AE@nicholaswilliams.net> <51F80198.4050209@oracle.com> Message-ID: On Jul 30, 2013, at 1:10 PM, Alan Bateman wrote: > On 30/07/2013 11:02, Nick Williams wrote: >> I'm running the core libs tests locally (for the first time), and every java.io test is failing. They're all failing for the same reason (output below), and I suspect it's something local and not an actual problem. But the test output is not very helpful. Note that all of the java.beans tests passed with flying colors. Once it got to java.io, everything started failing. Worse, each test is taking 60 seconds to fail. I could be here a while... >> >> Thoughts? > What command are you using? From the output it suggests that the connection between jtreg and the agent VM cannot be established. > > -Alan. Command, just like README-builds.html#testing says: cd test && make PRODUCT_HOME=`pwd`/../build/macosx-x86_64-normal-server-release/images/j2sdk-image/ all I assume this is specifically an java.io-related problem because all the java.beans tests passed without exception and so far every java.io test through java.io.Externalizable (that's as far as it has gotten) has failed without exception. Wouldn't a problem with jtreg communicating with the agent VM have shown up in java.beans as well? I could be wrong of course. > > >> >> Here's the output from one of the tests. It looks like all the other test outputs: >> >> #Test Results (version 2) >> #Tue Jul 30 12:38:15 CDT 2013 >> #-----testdescription----- >> $file=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test/java/io/BufferedInputStream/ReadAfterClose.java >> $root=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test >> keywords=bug4143651 >> run=ASSUMED_ACTION main ReadAfterClose\n >> source=ReadAfterClose.java >> title=Test if I/O methods will check if the stream has been closed. >> >> #-----environment----- >> >> #-----testresult----- >> description=file\:/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test/java/io/BufferedInputStream/ReadAfterClose.java >> elapsed=60007 0\:01\:00.007 >> end=Tue Jul 30 12\:38\:15 CDT 2013 >> environment=regtest >> execStatus=Error. Cannot get VM for test\: java.net.SocketTimeoutException\: Accept timed out >> hostname=unknown >> javatestOS=Mac OS X 10.7.5 (x86_64) >> javatestVersion=4.4.1 >> jtregVersion=jtreg 4.1 dev b00 >> script=com.sun.javatest.regtest.RegressionScript >> sections=script_messages build compile >> start=Tue Jul 30 12\:37\:15 CDT 2013 >> test=java/io/BufferedInputStream/ReadAfterClose.java >> user.name=Nicholas >> work=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/build/macosx-amd64/testoutput/jdk_io/JTwork/java/io/BufferedInputStream >> >> #section:script_messages >> ----------messages:(5/308)---------- >> JDK under test: (/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/test/../build/macosx-x86_64-normal-server-release/images/j2sdk-image) >> openjdk version "1.8.0-internal" >> OpenJDK Runtime Environment (build 1.8.0-internal-icholas_2013_07_29_21_14-b00) >> OpenJDK 64-Bit Server VM (build 25.0-b42, mixed mode) >> >> >> #section:build >> ----------messages:(3/100)---------- >> command: build ReadAfterClose >> reason: Named class compiled on demand >> elapsed time (seconds): 60.005 >> result: Error. Cannot get VM for test: java.net.SocketTimeoutException: Accept timed out >> >> #section:compile >> ----------messages:(3/235)---------- >> command: compile -XDignore.symbol.file=true /Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test/java/io/BufferedInputStream/ReadAfterClose.java >> reason: .class file out of date or does not exist >> elapsed time (seconds): 60.005 >> result: Error. Cannot get VM for test: java.net.SocketTimeoutException: Accept timed out >> >> >> test result: Error. Cannot get VM for test: java.net.SocketTimeoutException: Accept timed out >> > From henry.jen at oracle.com Tue Jul 30 18:27:16 2013 From: henry.jen at oracle.com (Henry Jen) Date: Tue, 30 Jul 2013 11:27:16 -0700 Subject: CFR: 8020977: StringJoiner merges with itself not as expected In-Reply-To: <51F7F146.80704@oracle.com> References: <51F72532.3010101@oracle.com> <51F7286C.9000508@oracle.com> <51F7F146.80704@oracle.com> Message-ID: On Jul 30, 2013, at 10:00 AM, Stuart Marks wrote: > Hi Henry, > > A couple minor comments on this. > > I don't think it's necessary to snapshot other.value into a local otherBuilder variable. If other == this, when the value is mutated by prepareBuilder(), otherBuilder still points to this.value, whose contents have changed. So the actual data isn't being snapshotted, as is implied by the comment "seize the data". > > The essence of the change is to snapshot other's original length. Of course this works because we know that prepareBuilder() only appends, so we don't have to copy the entire value. > > I'd just use other.value and clarify the comment. > That's fine, I think the reason in earlier version to capture the other.value is to avoid member access multiple times? As you said, I only try to get the length as that's enough to ensure we "seize" the data. > ** > > It's a separate issue but I spent some time puzzling over the (other.prefix.length() < length) condition trying to figure out why it's necessary. It turns out that it isn't. :-) [At least that I could see; the tests may prove me wrong.] > > It's invariant that other.prefix.length() <= other.value.length(). They're only equal length if somebody has added the empty string to other. So the condition saves a call to append() if this is the case. Having this test is an optimization of sorts, but append() handles appending a zero-length interval just fine, so IMO this extra test adds a bit of clutter to the code. > > Up to you whether you want to do anything about this. > Your analysis is correct, and I think it's really just defensive. I don't think it can happen as we do guard against other.value == null, which is the only case length will be less than prefix. Cheers, Henry From nicholas+openjdk at nicholaswilliams.net Tue Jul 30 18:39:22 2013 From: nicholas+openjdk at nicholaswilliams.net (Nick Williams) Date: Tue, 30 Jul 2013 13:39:22 -0500 Subject: Try to run core libs tests -- All IO tests failing In-Reply-To: References: <68C504A0-F6DE-4A4D-B09C-0EC8FF1137AE@nicholaswilliams.net> <51F80198.4050209@oracle.com> Message-ID: On Jul 30, 2013, at 1:16 PM, Nick Williams wrote: > > On Jul 30, 2013, at 1:10 PM, Alan Bateman wrote: > >> On 30/07/2013 11:02, Nick Williams wrote: >>> I'm running the core libs tests locally (for the first time), and every java.io test is failing. They're all failing for the same reason (output below), and I suspect it's something local and not an actual problem. But the test output is not very helpful. Note that all of the java.beans tests passed with flying colors. Once it got to java.io, everything started failing. Worse, each test is taking 60 seconds to fail. I could be here a while... >>> >>> Thoughts? >> What command are you using? From the output it suggests that the connection between jtreg and the agent VM cannot be established. >> >> -Alan. > > Command, just like README-builds.html#testing says: > > cd test && make PRODUCT_HOME=`pwd`/../build/macosx-x86_64-normal-server-release/images/j2sdk-image/ all > > I assume this is specifically an java.io-related problem because all the java.beans tests passed without exception and so far every java.io test through java.io.Externalizable (that's as far as it has gotten) has failed without exception. Wouldn't a problem with jtreg communicating with the agent VM have shown up in java.beans as well? I could be wrong of course. I see now that java.beans tests run in "othervm mode" while java.io tests run in "agentvm mode." Didn't realize they were being run differently. Your explanation makes much more sense now, but I still don't know what's wrong... > >> >> >>> >>> Here's the output from one of the tests. It looks like all the other test outputs: >>> >>> #Test Results (version 2) >>> #Tue Jul 30 12:38:15 CDT 2013 >>> #-----testdescription----- >>> $file=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test/java/io/BufferedInputStream/ReadAfterClose.java >>> $root=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test >>> keywords=bug4143651 >>> run=ASSUMED_ACTION main ReadAfterClose\n >>> source=ReadAfterClose.java >>> title=Test if I/O methods will check if the stream has been closed. >>> >>> #-----environment----- >>> >>> #-----testresult----- >>> description=file\:/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test/java/io/BufferedInputStream/ReadAfterClose.java >>> elapsed=60007 0\:01\:00.007 >>> end=Tue Jul 30 12\:38\:15 CDT 2013 >>> environment=regtest >>> execStatus=Error. Cannot get VM for test\: java.net.SocketTimeoutException\: Accept timed out >>> hostname=unknown >>> javatestOS=Mac OS X 10.7.5 (x86_64) >>> javatestVersion=4.4.1 >>> jtregVersion=jtreg 4.1 dev b00 >>> script=com.sun.javatest.regtest.RegressionScript >>> sections=script_messages build compile >>> start=Tue Jul 30 12\:37\:15 CDT 2013 >>> test=java/io/BufferedInputStream/ReadAfterClose.java >>> user.name=Nicholas >>> work=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/build/macosx-amd64/testoutput/jdk_io/JTwork/java/io/BufferedInputStream >>> >>> #section:script_messages >>> ----------messages:(5/308)---------- >>> JDK under test: (/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/test/../build/macosx-x86_64-normal-server-release/images/j2sdk-image) >>> openjdk version "1.8.0-internal" >>> OpenJDK Runtime Environment (build 1.8.0-internal-icholas_2013_07_29_21_14-b00) >>> OpenJDK 64-Bit Server VM (build 25.0-b42, mixed mode) >>> >>> >>> #section:build >>> ----------messages:(3/100)---------- >>> command: build ReadAfterClose >>> reason: Named class compiled on demand >>> elapsed time (seconds): 60.005 >>> result: Error. Cannot get VM for test: java.net.SocketTimeoutException: Accept timed out >>> >>> #section:compile >>> ----------messages:(3/235)---------- >>> command: compile -XDignore.symbol.file=true /Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test/java/io/BufferedInputStream/ReadAfterClose.java >>> reason: .class file out of date or does not exist >>> elapsed time (seconds): 60.005 >>> result: Error. Cannot get VM for test: java.net.SocketTimeoutException: Accept timed out >>> >>> >>> test result: Error. Cannot get VM for test: java.net.SocketTimeoutException: Accept timed out >>> >> > From stuart.marks at oracle.com Tue Jul 30 20:00:10 2013 From: stuart.marks at oracle.com (Stuart Marks) Date: Tue, 30 Jul 2013 13:00:10 -0700 Subject: 8016036: RMI specification needs to be updated to allow Activation on remote hosts In-Reply-To: <51F680BF.5060804@oracle.com> References: <51DE3146.2000908@oracle.com> <51F41E5F.6030407@oracle.com> <51F680BF.5060804@oracle.com> Message-ID: <51F81B4A.1000209@oracle.com> On 7/29/13 7:48 AM, Alan Bateman wrote: > On 29/07/2013 07:12, Bob Vandette wrote: >> Excuse me if I'm a bit frustrated by this issue ... >> >> We keep going around and around on this issue. We had a discussion with >> Stuart and the JCK >> team and Stuart didn't want to change the specification. Has he now changed >> his mind? >> >> Security and configuration issues aside, I don't understand why it doesn't >> make sense to remote >> activate an Object in an API that is supposed implement "Remote Method >> Invocation" support. >> The fact that it only supports activation on a local host seems to be a bug >> to me. >> > I understand that this is a bit frustrating but I think we should at least > explore relaxing the specification (if it hasn't been explored already). I'm > not an export on RMI but I'm just concerned that the currently "agreed" > solution to do the activation on another system feels more like a solution to > get tests to pass. Stuart told me that he would look into it and see if > relaxing the specification is feasible or not. Stuart - do you have anything to > add? Well, while one might say that I've changed my mind, I think it's more accurate to say that Alan has corrected a mistake on my part. I had previously thought that it was forbidden to make things optional. Alan showed up on my doorstep the other day wondering why optionality wasn't pursued more thoroughly, and then he showed me some examples where something was made optional in a fairly precise manner. See for example the spec changes in this changeset: http://hg.openjdk.java.net/jdk8/jdk8/jdk/rev/edb71a37fcb7 It seems plausible to investigate similar kinds of changes for RMI Activation. s'marks From nicholas+openjdk at nicholaswilliams.net Tue Jul 30 20:13:53 2013 From: nicholas+openjdk at nicholaswilliams.net (Nick Williams) Date: Tue, 30 Jul 2013 15:13:53 -0500 Subject: Try to run core libs tests -- All IO tests failing In-Reply-To: References: <68C504A0-F6DE-4A4D-B09C-0EC8FF1137AE@nicholaswilliams.net> <51F80198.4050209@oracle.com> Message-ID: Okay, this is indeed very interesting. After two hours it was only about half-way through the java.io tests and all of them had failed so far. On a sheer hunch and nothing more, I unplugged my ethernet cable, thus disconnecting me from any/all networks and the Internet. BOOM. The rest of the java.io tests finished (and passed) in a few seconds, leaving 137 that had failed. I then re-ran the tests while still disconnected from the Internet and 312 of the java.io tests passed this time, leaving only 1 failure (java/io/BufferedReader/Lines.java, output below). I plugged my Ethernet back in and ran the tests again and java.io started failing every test again, timing out after 60 seconds each. Curiously extending my hunch I remained connected over Ethernet and connected to a remote network via OpenVPN. Now all of the java.io test pass again (except that same one, with the same output). What on Earth??? (If it helps, I'm on Mac OS X 10.7.5.) Unfortunately, the one failed java.io test prevents jtreg from continuing on to the next set of tests (java.lang). Anyone know how to tell jtreg to continue running on error? Nick #Test Results (version 2) #Tue Jul 30 14:53:42 CDT 2013 #-----testdescription----- $file=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test/java/io/BufferedReader/Lines.java $root=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test keywords=bug8003258 run=USER_SPECIFIED testng Lines\n source=Lines.java title=\ #-----environment----- #-----testresult----- end=Tue Jul 30 14\:53\:42 CDT 2013 execStatus=Error. Unexpected exception caught from test java/io/BufferedReader/Lines.java\: java.lang.NullPointerException sections=script_messages Details #section:script_messages ----------messages:(0/0)---------- #section:Details ----------messages:(0/0)---------- ----------Stack trace:(10/672)---------- java.lang.NullPointerException at com.sun.javatest.regtest.TestNGReporter.getMatcher(TestNGReporter.java:97) at com.sun.javatest.regtest.TestNGReporter.add(TestNGReporter.java:80) at com.sun.javatest.regtest.TestNGAction.endAction(TestNGAction.java:131) at com.sun.javatest.regtest.MainAction.run(MainAction.java:260) at com.sun.javatest.regtest.RegressionScript.run(RegressionScript.java:149) at com.sun.javatest.Script.run(Script.java:228) at com.sun.javatest.DefaultTestRunner.runTest(DefaultTestRunner.java:174) at com.sun.javatest.DefaultTestRunner.access$100(DefaultTestRunner.java:43) at com.sun.javatest.DefaultTestRunner$1.run(DefaultTestRunner.java:66) result: Not run. Test running... test result: Error. Unexpected exception caught from test java/io/BufferedReader/Lines.java: java.lang.NullPointerException On Jul 30, 2013, at 1:39 PM, Nick Williams wrote: > > On Jul 30, 2013, at 1:16 PM, Nick Williams wrote: > >> >> On Jul 30, 2013, at 1:10 PM, Alan Bateman wrote: >> >>> On 30/07/2013 11:02, Nick Williams wrote: >>>> I'm running the core libs tests locally (for the first time), and every java.io test is failing. They're all failing for the same reason (output below), and I suspect it's something local and not an actual problem. But the test output is not very helpful. Note that all of the java.beans tests passed with flying colors. Once it got to java.io, everything started failing. Worse, each test is taking 60 seconds to fail. I could be here a while... >>>> >>>> Thoughts? >>> What command are you using? From the output it suggests that the connection between jtreg and the agent VM cannot be established. >>> >>> -Alan. >> >> Command, just like README-builds.html#testing says: >> >> cd test && make PRODUCT_HOME=`pwd`/../build/macosx-x86_64-normal-server-release/images/j2sdk-image/ all >> >> I assume this is specifically an java.io-related problem because all the java.beans tests passed without exception and so far every java.io test through java.io.Externalizable (that's as far as it has gotten) has failed without exception. Wouldn't a problem with jtreg communicating with the agent VM have shown up in java.beans as well? I could be wrong of course. > > I see now that java.beans tests run in "othervm mode" while java.io tests run in "agentvm mode." Didn't realize they were being run differently. Your explanation makes much more sense now, but I still don't know what's wrong... > >> >>> >>> >>>> >>>> Here's the output from one of the tests. It looks like all the other test outputs: >>>> >>>> #Test Results (version 2) >>>> #Tue Jul 30 12:38:15 CDT 2013 >>>> #-----testdescription----- >>>> $file=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test/java/io/BufferedInputStream/ReadAfterClose.java >>>> $root=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test >>>> keywords=bug4143651 >>>> run=ASSUMED_ACTION main ReadAfterClose\n >>>> source=ReadAfterClose.java >>>> title=Test if I/O methods will check if the stream has been closed. >>>> >>>> #-----environment----- >>>> >>>> #-----testresult----- >>>> description=file\:/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test/java/io/BufferedInputStream/ReadAfterClose.java >>>> elapsed=60007 0\:01\:00.007 >>>> end=Tue Jul 30 12\:38\:15 CDT 2013 >>>> environment=regtest >>>> execStatus=Error. Cannot get VM for test\: java.net.SocketTimeoutException\: Accept timed out >>>> hostname=unknown >>>> javatestOS=Mac OS X 10.7.5 (x86_64) >>>> javatestVersion=4.4.1 >>>> jtregVersion=jtreg 4.1 dev b00 >>>> script=com.sun.javatest.regtest.RegressionScript >>>> sections=script_messages build compile >>>> start=Tue Jul 30 12\:37\:15 CDT 2013 >>>> test=java/io/BufferedInputStream/ReadAfterClose.java >>>> user.name=Nicholas >>>> work=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/build/macosx-amd64/testoutput/jdk_io/JTwork/java/io/BufferedInputStream >>>> >>>> #section:script_messages >>>> ----------messages:(5/308)---------- >>>> JDK under test: (/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/test/../build/macosx-x86_64-normal-server-release/images/j2sdk-image) >>>> openjdk version "1.8.0-internal" >>>> OpenJDK Runtime Environment (build 1.8.0-internal-icholas_2013_07_29_21_14-b00) >>>> OpenJDK 64-Bit Server VM (build 25.0-b42, mixed mode) >>>> >>>> >>>> #section:build >>>> ----------messages:(3/100)---------- >>>> command: build ReadAfterClose >>>> reason: Named class compiled on demand >>>> elapsed time (seconds): 60.005 >>>> result: Error. Cannot get VM for test: java.net.SocketTimeoutException: Accept timed out >>>> >>>> #section:compile >>>> ----------messages:(3/235)---------- >>>> command: compile -XDignore.symbol.file=true /Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test/java/io/BufferedInputStream/ReadAfterClose.java >>>> reason: .class file out of date or does not exist >>>> elapsed time (seconds): 60.005 >>>> result: Error. Cannot get VM for test: java.net.SocketTimeoutException: Accept timed out >>>> >>>> >>>> test result: Error. Cannot get VM for test: java.net.SocketTimeoutException: Accept timed out >>>> >>> >> > From jonathan.gibbons at oracle.com Tue Jul 30 20:46:34 2013 From: jonathan.gibbons at oracle.com (Jonathan Gibbons) Date: Tue, 30 Jul 2013 13:46:34 -0700 Subject: Try to run core libs tests -- All IO tests failing In-Reply-To: References: <68C504A0-F6DE-4A4D-B09C-0EC8FF1137AE@nicholaswilliams.net> <51F80198.4050209@oracle.com> Message-ID: <51F8262A.3060809@oracle.com> jtreg itself does not "stop on error". If you're driving the tests through the makefiles, the makefiles may partition the work into separate jtreg runs on separate parts of the test suite. -- Jon On 07/30/2013 01:13 PM, Nick Williams wrote: > Okay, this is indeed very interesting. After two hours it was only about half-way through the java.io tests and all of them had failed so far. On a sheer hunch and nothing more, I unplugged my ethernet cable, thus disconnecting me from any/all networks and the Internet. BOOM. The rest of the java.io tests finished (and passed) in a few seconds, leaving 137 that had failed. I then re-ran the tests while still disconnected from the Internet and 312 of the java.io tests passed this time, leaving only 1 failure (java/io/BufferedReader/Lines.java, output below). > > I plugged my Ethernet back in and ran the tests again and java.io started failing every test again, timing out after 60 seconds each. Curiously extending my hunch I remained connected over Ethernet and connected to a remote network via OpenVPN. Now all of the java.io test pass again (except that same one, with the same output). > > What on Earth??? (If it helps, I'm on Mac OS X 10.7.5.) > > Unfortunately, the one failed java.io test prevents jtreg from continuing on to the next set of tests (java.lang). Anyone know how to tell jtreg to continue running on error? > > Nick > > #Test Results (version 2) > #Tue Jul 30 14:53:42 CDT 2013 > #-----testdescription----- > $file=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test/java/io/BufferedReader/Lines.java > $root=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test > keywords=bug8003258 > run=USER_SPECIFIED testng Lines\n > source=Lines.java > title=\ > > #-----environment----- > > #-----testresult----- > end=Tue Jul 30 14\:53\:42 CDT 2013 > execStatus=Error. Unexpected exception caught from test java/io/BufferedReader/Lines.java\: java.lang.NullPointerException > sections=script_messages Details > > #section:script_messages > ----------messages:(0/0)---------- > > #section:Details > ----------messages:(0/0)---------- > ----------Stack trace:(10/672)---------- > java.lang.NullPointerException > at com.sun.javatest.regtest.TestNGReporter.getMatcher(TestNGReporter.java:97) > at com.sun.javatest.regtest.TestNGReporter.add(TestNGReporter.java:80) > at com.sun.javatest.regtest.TestNGAction.endAction(TestNGAction.java:131) > at com.sun.javatest.regtest.MainAction.run(MainAction.java:260) > at com.sun.javatest.regtest.RegressionScript.run(RegressionScript.java:149) > at com.sun.javatest.Script.run(Script.java:228) > at com.sun.javatest.DefaultTestRunner.runTest(DefaultTestRunner.java:174) > at com.sun.javatest.DefaultTestRunner.access$100(DefaultTestRunner.java:43) > at com.sun.javatest.DefaultTestRunner$1.run(DefaultTestRunner.java:66) > result: Not run. Test running... > > > test result: Error. Unexpected exception caught from test java/io/BufferedReader/Lines.java: java.lang.NullPointerException > > > On Jul 30, 2013, at 1:39 PM, Nick Williams wrote: > >> On Jul 30, 2013, at 1:16 PM, Nick Williams wrote: >> >>> On Jul 30, 2013, at 1:10 PM, Alan Bateman wrote: >>> >>>> On 30/07/2013 11:02, Nick Williams wrote: >>>>> I'm running the core libs tests locally (for the first time), and every java.io test is failing. They're all failing for the same reason (output below), and I suspect it's something local and not an actual problem. But the test output is not very helpful. Note that all of the java.beans tests passed with flying colors. Once it got to java.io, everything started failing. Worse, each test is taking 60 seconds to fail. I could be here a while... >>>>> >>>>> Thoughts? >>>> What command are you using? From the output it suggests that the connection between jtreg and the agent VM cannot be established. >>>> >>>> -Alan. >>> Command, just like README-builds.html#testing says: >>> >>> cd test && make PRODUCT_HOME=`pwd`/../build/macosx-x86_64-normal-server-release/images/j2sdk-image/ all >>> >>> I assume this is specifically an java.io-related problem because all the java.beans tests passed without exception and so far every java.io test through java.io.Externalizable (that's as far as it has gotten) has failed without exception. Wouldn't a problem with jtreg communicating with the agent VM have shown up in java.beans as well? I could be wrong of course. >> I see now that java.beans tests run in "othervm mode" while java.io tests run in "agentvm mode." Didn't realize they were being run differently. Your explanation makes much more sense now, but I still don't know what's wrong... >> >>>> >>>>> Here's the output from one of the tests. It looks like all the other test outputs: >>>>> >>>>> #Test Results (version 2) >>>>> #Tue Jul 30 12:38:15 CDT 2013 >>>>> #-----testdescription----- >>>>> $file=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test/java/io/BufferedInputStream/ReadAfterClose.java >>>>> $root=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test >>>>> keywords=bug4143651 >>>>> run=ASSUMED_ACTION main ReadAfterClose\n >>>>> source=ReadAfterClose.java >>>>> title=Test if I/O methods will check if the stream has been closed. >>>>> >>>>> #-----environment----- >>>>> >>>>> #-----testresult----- >>>>> description=file\:/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test/java/io/BufferedInputStream/ReadAfterClose.java >>>>> elapsed=60007 0\:01\:00.007 >>>>> end=Tue Jul 30 12\:38\:15 CDT 2013 >>>>> environment=regtest >>>>> execStatus=Error. Cannot get VM for test\: java.net.SocketTimeoutException\: Accept timed out >>>>> hostname=unknown >>>>> javatestOS=Mac OS X 10.7.5 (x86_64) >>>>> javatestVersion=4.4.1 >>>>> jtregVersion=jtreg 4.1 dev b00 >>>>> script=com.sun.javatest.regtest.RegressionScript >>>>> sections=script_messages build compile >>>>> start=Tue Jul 30 12\:37\:15 CDT 2013 >>>>> test=java/io/BufferedInputStream/ReadAfterClose.java >>>>> user.name=Nicholas >>>>> work=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/build/macosx-amd64/testoutput/jdk_io/JTwork/java/io/BufferedInputStream >>>>> >>>>> #section:script_messages >>>>> ----------messages:(5/308)---------- >>>>> JDK under test: (/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/test/../build/macosx-x86_64-normal-server-release/images/j2sdk-image) >>>>> openjdk version "1.8.0-internal" >>>>> OpenJDK Runtime Environment (build 1.8.0-internal-icholas_2013_07_29_21_14-b00) >>>>> OpenJDK 64-Bit Server VM (build 25.0-b42, mixed mode) >>>>> >>>>> >>>>> #section:build >>>>> ----------messages:(3/100)---------- >>>>> command: build ReadAfterClose >>>>> reason: Named class compiled on demand >>>>> elapsed time (seconds): 60.005 >>>>> result: Error. Cannot get VM for test: java.net.SocketTimeoutException: Accept timed out >>>>> >>>>> #section:compile >>>>> ----------messages:(3/235)---------- >>>>> command: compile -XDignore.symbol.file=true /Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test/java/io/BufferedInputStream/ReadAfterClose.java >>>>> reason: .class file out of date or does not exist >>>>> elapsed time (seconds): 60.005 >>>>> result: Error. Cannot get VM for test: java.net.SocketTimeoutException: Accept timed out >>>>> >>>>> >>>>> test result: Error. Cannot get VM for test: java.net.SocketTimeoutException: Accept timed out >>>>> From nicholas+openjdk at nicholaswilliams.net Tue Jul 30 20:50:55 2013 From: nicholas+openjdk at nicholaswilliams.net (Nick Williams) Date: Tue, 30 Jul 2013 15:50:55 -0500 Subject: Try to run core libs tests -- All IO tests failing In-Reply-To: <51F8262A.3060809@oracle.com> References: <68C504A0-F6DE-4A4D-B09C-0EC8FF1137AE@nicholaswilliams.net> <51F80198.4050209@oracle.com> <51F8262A.3060809@oracle.com> Message-ID: <77FAF780-7A65-4516-B47E-69FB9EADD426@nicholaswilliams.net> Gotchya. I commented out the java.io tests locally for now. By the way, I noticed something. Before, when the java.io tests were failing, the output said "hostname=unknown." However, now that I'm connected to the VPN and they're passing, the output says "hostname=10.211.55.2." When I unplug from the ethernet altogether, the output says "hostname=127.0.0.1." Sounds like that has something to do with this weird failure of all java.io tests. N On Jul 30, 2013, at 3:46 PM, Jonathan Gibbons wrote: > > jtreg itself does not "stop on error". If you're driving the tests through the makefiles, the makefiles may partition the work into separate jtreg runs on separate parts of the test suite. > > -- Jon > > > On 07/30/2013 01:13 PM, Nick Williams wrote: >> Okay, this is indeed very interesting. After two hours it was only about half-way through the java.io tests and all of them had failed so far. On a sheer hunch and nothing more, I unplugged my ethernet cable, thus disconnecting me from any/all networks and the Internet. BOOM. The rest of the java.io tests finished (and passed) in a few seconds, leaving 137 that had failed. I then re-ran the tests while still disconnected from the Internet and 312 of the java.io tests passed this time, leaving only 1 failure (java/io/BufferedReader/Lines.java, output below). >> >> I plugged my Ethernet back in and ran the tests again and java.io started failing every test again, timing out after 60 seconds each. Curiously extending my hunch I remained connected over Ethernet and connected to a remote network via OpenVPN. Now all of the java.io test pass again (except that same one, with the same output). >> >> What on Earth??? (If it helps, I'm on Mac OS X 10.7.5.) >> >> Unfortunately, the one failed java.io test prevents jtreg from continuing on to the next set of tests (java.lang). Anyone know how to tell jtreg to continue running on error? >> >> Nick >> >> #Test Results (version 2) >> #Tue Jul 30 14:53:42 CDT 2013 >> #-----testdescription----- >> $file=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test/java/io/BufferedReader/Lines.java >> $root=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test >> keywords=bug8003258 >> run=USER_SPECIFIED testng Lines\n >> source=Lines.java >> title=\ >> >> #-----environment----- >> >> #-----testresult----- >> end=Tue Jul 30 14\:53\:42 CDT 2013 >> execStatus=Error. Unexpected exception caught from test java/io/BufferedReader/Lines.java\: java.lang.NullPointerException >> sections=script_messages Details >> >> #section:script_messages >> ----------messages:(0/0)---------- >> >> #section:Details >> ----------messages:(0/0)---------- >> ----------Stack trace:(10/672)---------- >> java.lang.NullPointerException >> at com.sun.javatest.regtest.TestNGReporter.getMatcher(TestNGReporter.java:97) >> at com.sun.javatest.regtest.TestNGReporter.add(TestNGReporter.java:80) >> at com.sun.javatest.regtest.TestNGAction.endAction(TestNGAction.java:131) >> at com.sun.javatest.regtest.MainAction.run(MainAction.java:260) >> at com.sun.javatest.regtest.RegressionScript.run(RegressionScript.java:149) >> at com.sun.javatest.Script.run(Script.java:228) >> at com.sun.javatest.DefaultTestRunner.runTest(DefaultTestRunner.java:174) >> at com.sun.javatest.DefaultTestRunner.access$100(DefaultTestRunner.java:43) >> at com.sun.javatest.DefaultTestRunner$1.run(DefaultTestRunner.java:66) >> result: Not run. Test running... >> >> >> test result: Error. Unexpected exception caught from test java/io/BufferedReader/Lines.java: java.lang.NullPointerException >> >> >> On Jul 30, 2013, at 1:39 PM, Nick Williams wrote: >> >>> On Jul 30, 2013, at 1:16 PM, Nick Williams wrote: >>> >>>> On Jul 30, 2013, at 1:10 PM, Alan Bateman wrote: >>>> >>>>> On 30/07/2013 11:02, Nick Williams wrote: >>>>>> I'm running the core libs tests locally (for the first time), and every java.io test is failing. They're all failing for the same reason (output below), and I suspect it's something local and not an actual problem. But the test output is not very helpful. Note that all of the java.beans tests passed with flying colors. Once it got to java.io, everything started failing. Worse, each test is taking 60 seconds to fail. I could be here a while... >>>>>> >>>>>> Thoughts? >>>>> What command are you using? From the output it suggests that the connection between jtreg and the agent VM cannot be established. >>>>> >>>>> -Alan. >>>> Command, just like README-builds.html#testing says: >>>> >>>> cd test && make PRODUCT_HOME=`pwd`/../build/macosx-x86_64-normal-server-release/images/j2sdk-image/ all >>>> >>>> I assume this is specifically an java.io-related problem because all the java.beans tests passed without exception and so far every java.io test through java.io.Externalizable (that's as far as it has gotten) has failed without exception. Wouldn't a problem with jtreg communicating with the agent VM have shown up in java.beans as well? I could be wrong of course. >>> I see now that java.beans tests run in "othervm mode" while java.io tests run in "agentvm mode." Didn't realize they were being run differently. Your explanation makes much more sense now, but I still don't know what's wrong... >>> >>>>> >>>>>> Here's the output from one of the tests. It looks like all the other test outputs: >>>>>> >>>>>> #Test Results (version 2) >>>>>> #Tue Jul 30 12:38:15 CDT 2013 >>>>>> #-----testdescription----- >>>>>> $file=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test/java/io/BufferedInputStream/ReadAfterClose.java >>>>>> $root=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test >>>>>> keywords=bug4143651 >>>>>> run=ASSUMED_ACTION main ReadAfterClose\n >>>>>> source=ReadAfterClose.java >>>>>> title=Test if I/O methods will check if the stream has been closed. >>>>>> >>>>>> #-----environment----- >>>>>> >>>>>> #-----testresult----- >>>>>> description=file\:/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test/java/io/BufferedInputStream/ReadAfterClose.java >>>>>> elapsed=60007 0\:01\:00.007 >>>>>> end=Tue Jul 30 12\:38\:15 CDT 2013 >>>>>> environment=regtest >>>>>> execStatus=Error. Cannot get VM for test\: java.net.SocketTimeoutException\: Accept timed out >>>>>> hostname=unknown >>>>>> javatestOS=Mac OS X 10.7.5 (x86_64) >>>>>> javatestVersion=4.4.1 >>>>>> jtregVersion=jtreg 4.1 dev b00 >>>>>> script=com.sun.javatest.regtest.RegressionScript >>>>>> sections=script_messages build compile >>>>>> start=Tue Jul 30 12\:37\:15 CDT 2013 >>>>>> test=java/io/BufferedInputStream/ReadAfterClose.java >>>>>> user.name=Nicholas >>>>>> work=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/build/macosx-amd64/testoutput/jdk_io/JTwork/java/io/BufferedInputStream >>>>>> >>>>>> #section:script_messages >>>>>> ----------messages:(5/308)---------- >>>>>> JDK under test: (/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/test/../build/macosx-x86_64-normal-server-release/images/j2sdk-image) >>>>>> openjdk version "1.8.0-internal" >>>>>> OpenJDK Runtime Environment (build 1.8.0-internal-icholas_2013_07_29_21_14-b00) >>>>>> OpenJDK 64-Bit Server VM (build 25.0-b42, mixed mode) >>>>>> >>>>>> >>>>>> #section:build >>>>>> ----------messages:(3/100)---------- >>>>>> command: build ReadAfterClose >>>>>> reason: Named class compiled on demand >>>>>> elapsed time (seconds): 60.005 >>>>>> result: Error. Cannot get VM for test: java.net.SocketTimeoutException: Accept timed out >>>>>> >>>>>> #section:compile >>>>>> ----------messages:(3/235)---------- >>>>>> command: compile -XDignore.symbol.file=true /Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test/java/io/BufferedInputStream/ReadAfterClose.java >>>>>> reason: .class file out of date or does not exist >>>>>> elapsed time (seconds): 60.005 >>>>>> result: Error. Cannot get VM for test: java.net.SocketTimeoutException: Accept timed out >>>>>> >>>>>> >>>>>> test result: Error. Cannot get VM for test: java.net.SocketTimeoutException: Accept timed out >>>>>> > From jonathan.gibbons at oracle.com Tue Jul 30 20:53:49 2013 From: jonathan.gibbons at oracle.com (Jonathan Gibbons) Date: Tue, 30 Jul 2013 13:53:49 -0700 Subject: Try to run core libs tests -- All IO tests failing In-Reply-To: <77FAF780-7A65-4516-B47E-69FB9EADD426@nicholaswilliams.net> References: <68C504A0-F6DE-4A4D-B09C-0EC8FF1137AE@nicholaswilliams.net> <51F80198.4050209@oracle.com> <51F8262A.3060809@oracle.com> <77FAF780-7A65-4516-B47E-69FB9EADD426@nicholaswilliams.net> Message-ID: <51F827DD.6060505@oracle.com> Regarding the hostname, jtreg is executing the following code for all tests, not just java.io tests String hostname; try { hostname = InetAddress.getLocalHost().getCanonicalHostName(); } catch (UnknownHostException e) { hostname = "unknown"; } On 07/30/2013 01:50 PM, Nick Williams wrote: > Gotchya. > > I commented out the java.io tests locally for now. > > By the way, I noticed something. Before, when the java.io tests were failing, the output said "hostname=unknown." However, now that I'm connected to the VPN and they're passing, the output says "hostname=10.211.55.2." When I unplug from the ethernet altogether, the output says "hostname=127.0.0.1." > > Sounds like that has something to do with this weird failure of all java.io tests. > > N > > On Jul 30, 2013, at 3:46 PM, Jonathan Gibbons wrote: > >> jtreg itself does not "stop on error". If you're driving the tests through the makefiles, the makefiles may partition the work into separate jtreg runs on separate parts of the test suite. >> >> -- Jon >> >> >> On 07/30/2013 01:13 PM, Nick Williams wrote: >>> Okay, this is indeed very interesting. After two hours it was only about half-way through the java.io tests and all of them had failed so far. On a sheer hunch and nothing more, I unplugged my ethernet cable, thus disconnecting me from any/all networks and the Internet. BOOM. The rest of the java.io tests finished (and passed) in a few seconds, leaving 137 that had failed. I then re-ran the tests while still disconnected from the Internet and 312 of the java.io tests passed this time, leaving only 1 failure (java/io/BufferedReader/Lines.java, output below). >>> >>> I plugged my Ethernet back in and ran the tests again and java.io started failing every test again, timing out after 60 seconds each. Curiously extending my hunch I remained connected over Ethernet and connected to a remote network via OpenVPN. Now all of the java.io test pass again (except that same one, with the same output). >>> >>> What on Earth??? (If it helps, I'm on Mac OS X 10.7.5.) >>> >>> Unfortunately, the one failed java.io test prevents jtreg from continuing on to the next set of tests (java.lang). Anyone know how to tell jtreg to continue running on error? >>> >>> Nick >>> >>> #Test Results (version 2) >>> #Tue Jul 30 14:53:42 CDT 2013 >>> #-----testdescription----- >>> $file=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test/java/io/BufferedReader/Lines.java >>> $root=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test >>> keywords=bug8003258 >>> run=USER_SPECIFIED testng Lines\n >>> source=Lines.java >>> title=\ >>> >>> #-----environment----- >>> >>> #-----testresult----- >>> end=Tue Jul 30 14\:53\:42 CDT 2013 >>> execStatus=Error. Unexpected exception caught from test java/io/BufferedReader/Lines.java\: java.lang.NullPointerException >>> sections=script_messages Details >>> >>> #section:script_messages >>> ----------messages:(0/0)---------- >>> >>> #section:Details >>> ----------messages:(0/0)---------- >>> ----------Stack trace:(10/672)---------- >>> java.lang.NullPointerException >>> at com.sun.javatest.regtest.TestNGReporter.getMatcher(TestNGReporter.java:97) >>> at com.sun.javatest.regtest.TestNGReporter.add(TestNGReporter.java:80) >>> at com.sun.javatest.regtest.TestNGAction.endAction(TestNGAction.java:131) >>> at com.sun.javatest.regtest.MainAction.run(MainAction.java:260) >>> at com.sun.javatest.regtest.RegressionScript.run(RegressionScript.java:149) >>> at com.sun.javatest.Script.run(Script.java:228) >>> at com.sun.javatest.DefaultTestRunner.runTest(DefaultTestRunner.java:174) >>> at com.sun.javatest.DefaultTestRunner.access$100(DefaultTestRunner.java:43) >>> at com.sun.javatest.DefaultTestRunner$1.run(DefaultTestRunner.java:66) >>> result: Not run. Test running... >>> >>> >>> test result: Error. Unexpected exception caught from test java/io/BufferedReader/Lines.java: java.lang.NullPointerException >>> >>> >>> On Jul 30, 2013, at 1:39 PM, Nick Williams wrote: >>> >>>> On Jul 30, 2013, at 1:16 PM, Nick Williams wrote: >>>> >>>>> On Jul 30, 2013, at 1:10 PM, Alan Bateman wrote: >>>>> >>>>>> On 30/07/2013 11:02, Nick Williams wrote: >>>>>>> I'm running the core libs tests locally (for the first time), and every java.io test is failing. They're all failing for the same reason (output below), and I suspect it's something local and not an actual problem. But the test output is not very helpful. Note that all of the java.beans tests passed with flying colors. Once it got to java.io, everything started failing. Worse, each test is taking 60 seconds to fail. I could be here a while... >>>>>>> >>>>>>> Thoughts? >>>>>> What command are you using? From the output it suggests that the connection between jtreg and the agent VM cannot be established. >>>>>> >>>>>> -Alan. >>>>> Command, just like README-builds.html#testing says: >>>>> >>>>> cd test && make PRODUCT_HOME=`pwd`/../build/macosx-x86_64-normal-server-release/images/j2sdk-image/ all >>>>> >>>>> I assume this is specifically an java.io-related problem because all the java.beans tests passed without exception and so far every java.io test through java.io.Externalizable (that's as far as it has gotten) has failed without exception. Wouldn't a problem with jtreg communicating with the agent VM have shown up in java.beans as well? I could be wrong of course. >>>> I see now that java.beans tests run in "othervm mode" while java.io tests run in "agentvm mode." Didn't realize they were being run differently. Your explanation makes much more sense now, but I still don't know what's wrong... >>>> >>>>>>> Here's the output from one of the tests. It looks like all the other test outputs: >>>>>>> >>>>>>> #Test Results (version 2) >>>>>>> #Tue Jul 30 12:38:15 CDT 2013 >>>>>>> #-----testdescription----- >>>>>>> $file=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test/java/io/BufferedInputStream/ReadAfterClose.java >>>>>>> $root=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test >>>>>>> keywords=bug4143651 >>>>>>> run=ASSUMED_ACTION main ReadAfterClose\n >>>>>>> source=ReadAfterClose.java >>>>>>> title=Test if I/O methods will check if the stream has been closed. >>>>>>> >>>>>>> #-----environment----- >>>>>>> >>>>>>> #-----testresult----- >>>>>>> description=file\:/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test/java/io/BufferedInputStream/ReadAfterClose.java >>>>>>> elapsed=60007 0\:01\:00.007 >>>>>>> end=Tue Jul 30 12\:38\:15 CDT 2013 >>>>>>> environment=regtest >>>>>>> execStatus=Error. Cannot get VM for test\: java.net.SocketTimeoutException\: Accept timed out >>>>>>> hostname=unknown >>>>>>> javatestOS=Mac OS X 10.7.5 (x86_64) >>>>>>> javatestVersion=4.4.1 >>>>>>> jtregVersion=jtreg 4.1 dev b00 >>>>>>> script=com.sun.javatest.regtest.RegressionScript >>>>>>> sections=script_messages build compile >>>>>>> start=Tue Jul 30 12\:37\:15 CDT 2013 >>>>>>> test=java/io/BufferedInputStream/ReadAfterClose.java >>>>>>> user.name=Nicholas >>>>>>> work=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/build/macosx-amd64/testoutput/jdk_io/JTwork/java/io/BufferedInputStream >>>>>>> >>>>>>> #section:script_messages >>>>>>> ----------messages:(5/308)---------- >>>>>>> JDK under test: (/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/test/../build/macosx-x86_64-normal-server-release/images/j2sdk-image) >>>>>>> openjdk version "1.8.0-internal" >>>>>>> OpenJDK Runtime Environment (build 1.8.0-internal-icholas_2013_07_29_21_14-b00) >>>>>>> OpenJDK 64-Bit Server VM (build 25.0-b42, mixed mode) >>>>>>> >>>>>>> >>>>>>> #section:build >>>>>>> ----------messages:(3/100)---------- >>>>>>> command: build ReadAfterClose >>>>>>> reason: Named class compiled on demand >>>>>>> elapsed time (seconds): 60.005 >>>>>>> result: Error. Cannot get VM for test: java.net.SocketTimeoutException: Accept timed out >>>>>>> >>>>>>> #section:compile >>>>>>> ----------messages:(3/235)---------- >>>>>>> command: compile -XDignore.symbol.file=true /Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test/java/io/BufferedInputStream/ReadAfterClose.java >>>>>>> reason: .class file out of date or does not exist >>>>>>> elapsed time (seconds): 60.005 >>>>>>> result: Error. Cannot get VM for test: java.net.SocketTimeoutException: Accept timed out >>>>>>> >>>>>>> >>>>>>> test result: Error. Cannot get VM for test: java.net.SocketTimeoutException: Accept timed out >>>>>>> From jonathan.gibbons at oracle.com Tue Jul 30 20:57:06 2013 From: jonathan.gibbons at oracle.com (Jonathan Gibbons) Date: Tue, 30 Jul 2013 13:57:06 -0700 Subject: Try to run core libs tests -- All IO tests failing In-Reply-To: <77FAF780-7A65-4516-B47E-69FB9EADD426@nicholaswilliams.net> References: <68C504A0-F6DE-4A4D-B09C-0EC8FF1137AE@nicholaswilliams.net> <51F80198.4050209@oracle.com> <51F8262A.3060809@oracle.com> <77FAF780-7A65-4516-B47E-69FB9EADD426@nicholaswilliams.net> Message-ID: <51F828A2.8010503@oracle.com> I note, and will fix the NPE in the stack trace. -- Jon On 07/30/2013 01:50 PM, Nick Williams wrote: > Gotchya. > > I commented out the java.io tests locally for now. > > By the way, I noticed something. Before, when the java.io tests were failing, the output said "hostname=unknown." However, now that I'm connected to the VPN and they're passing, the output says "hostname=10.211.55.2." When I unplug from the ethernet altogether, the output says "hostname=127.0.0.1." > > Sounds like that has something to do with this weird failure of all java.io tests. > > N > > On Jul 30, 2013, at 3:46 PM, Jonathan Gibbons wrote: > >> jtreg itself does not "stop on error". If you're driving the tests through the makefiles, the makefiles may partition the work into separate jtreg runs on separate parts of the test suite. >> >> -- Jon >> >> >> On 07/30/2013 01:13 PM, Nick Williams wrote: >>> Okay, this is indeed very interesting. After two hours it was only about half-way through the java.io tests and all of them had failed so far. On a sheer hunch and nothing more, I unplugged my ethernet cable, thus disconnecting me from any/all networks and the Internet. BOOM. The rest of the java.io tests finished (and passed) in a few seconds, leaving 137 that had failed. I then re-ran the tests while still disconnected from the Internet and 312 of the java.io tests passed this time, leaving only 1 failure (java/io/BufferedReader/Lines.java, output below). >>> >>> I plugged my Ethernet back in and ran the tests again and java.io started failing every test again, timing out after 60 seconds each. Curiously extending my hunch I remained connected over Ethernet and connected to a remote network via OpenVPN. Now all of the java.io test pass again (except that same one, with the same output). >>> >>> What on Earth??? (If it helps, I'm on Mac OS X 10.7.5.) >>> >>> Unfortunately, the one failed java.io test prevents jtreg from continuing on to the next set of tests (java.lang). Anyone know how to tell jtreg to continue running on error? >>> >>> Nick >>> >>> #Test Results (version 2) >>> #Tue Jul 30 14:53:42 CDT 2013 >>> #-----testdescription----- >>> $file=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test/java/io/BufferedReader/Lines.java >>> $root=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test >>> keywords=bug8003258 >>> run=USER_SPECIFIED testng Lines\n >>> source=Lines.java >>> title=\ >>> >>> #-----environment----- >>> >>> #-----testresult----- >>> end=Tue Jul 30 14\:53\:42 CDT 2013 >>> execStatus=Error. Unexpected exception caught from test java/io/BufferedReader/Lines.java\: java.lang.NullPointerException >>> sections=script_messages Details >>> >>> #section:script_messages >>> ----------messages:(0/0)---------- >>> >>> #section:Details >>> ----------messages:(0/0)---------- >>> ----------Stack trace:(10/672)---------- >>> java.lang.NullPointerException >>> at com.sun.javatest.regtest.TestNGReporter.getMatcher(TestNGReporter.java:97) >>> at com.sun.javatest.regtest.TestNGReporter.add(TestNGReporter.java:80) >>> at com.sun.javatest.regtest.TestNGAction.endAction(TestNGAction.java:131) >>> at com.sun.javatest.regtest.MainAction.run(MainAction.java:260) >>> at com.sun.javatest.regtest.RegressionScript.run(RegressionScript.java:149) >>> at com.sun.javatest.Script.run(Script.java:228) >>> at com.sun.javatest.DefaultTestRunner.runTest(DefaultTestRunner.java:174) >>> at com.sun.javatest.DefaultTestRunner.access$100(DefaultTestRunner.java:43) >>> at com.sun.javatest.DefaultTestRunner$1.run(DefaultTestRunner.java:66) >>> result: Not run. Test running... >>> >>> >>> test result: Error. Unexpected exception caught from test java/io/BufferedReader/Lines.java: java.lang.NullPointerException >>> >>> >>> On Jul 30, 2013, at 1:39 PM, Nick Williams wrote: >>> >>>> On Jul 30, 2013, at 1:16 PM, Nick Williams wrote: >>>> >>>>> On Jul 30, 2013, at 1:10 PM, Alan Bateman wrote: >>>>> >>>>>> On 30/07/2013 11:02, Nick Williams wrote: >>>>>>> I'm running the core libs tests locally (for the first time), and every java.io test is failing. They're all failing for the same reason (output below), and I suspect it's something local and not an actual problem. But the test output is not very helpful. Note that all of the java.beans tests passed with flying colors. Once it got to java.io, everything started failing. Worse, each test is taking 60 seconds to fail. I could be here a while... >>>>>>> >>>>>>> Thoughts? >>>>>> What command are you using? From the output it suggests that the connection between jtreg and the agent VM cannot be established. >>>>>> >>>>>> -Alan. >>>>> Command, just like README-builds.html#testing says: >>>>> >>>>> cd test && make PRODUCT_HOME=`pwd`/../build/macosx-x86_64-normal-server-release/images/j2sdk-image/ all >>>>> >>>>> I assume this is specifically an java.io-related problem because all the java.beans tests passed without exception and so far every java.io test through java.io.Externalizable (that's as far as it has gotten) has failed without exception. Wouldn't a problem with jtreg communicating with the agent VM have shown up in java.beans as well? I could be wrong of course. >>>> I see now that java.beans tests run in "othervm mode" while java.io tests run in "agentvm mode." Didn't realize they were being run differently. Your explanation makes much more sense now, but I still don't know what's wrong... >>>> >>>>>>> Here's the output from one of the tests. It looks like all the other test outputs: >>>>>>> >>>>>>> #Test Results (version 2) >>>>>>> #Tue Jul 30 12:38:15 CDT 2013 >>>>>>> #-----testdescription----- >>>>>>> $file=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test/java/io/BufferedInputStream/ReadAfterClose.java >>>>>>> $root=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test >>>>>>> keywords=bug4143651 >>>>>>> run=ASSUMED_ACTION main ReadAfterClose\n >>>>>>> source=ReadAfterClose.java >>>>>>> title=Test if I/O methods will check if the stream has been closed. >>>>>>> >>>>>>> #-----environment----- >>>>>>> >>>>>>> #-----testresult----- >>>>>>> description=file\:/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test/java/io/BufferedInputStream/ReadAfterClose.java >>>>>>> elapsed=60007 0\:01\:00.007 >>>>>>> end=Tue Jul 30 12\:38\:15 CDT 2013 >>>>>>> environment=regtest >>>>>>> execStatus=Error. Cannot get VM for test\: java.net.SocketTimeoutException\: Accept timed out >>>>>>> hostname=unknown >>>>>>> javatestOS=Mac OS X 10.7.5 (x86_64) >>>>>>> javatestVersion=4.4.1 >>>>>>> jtregVersion=jtreg 4.1 dev b00 >>>>>>> script=com.sun.javatest.regtest.RegressionScript >>>>>>> sections=script_messages build compile >>>>>>> start=Tue Jul 30 12\:37\:15 CDT 2013 >>>>>>> test=java/io/BufferedInputStream/ReadAfterClose.java >>>>>>> user.name=Nicholas >>>>>>> work=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/build/macosx-amd64/testoutput/jdk_io/JTwork/java/io/BufferedInputStream >>>>>>> >>>>>>> #section:script_messages >>>>>>> ----------messages:(5/308)---------- >>>>>>> JDK under test: (/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/test/../build/macosx-x86_64-normal-server-release/images/j2sdk-image) >>>>>>> openjdk version "1.8.0-internal" >>>>>>> OpenJDK Runtime Environment (build 1.8.0-internal-icholas_2013_07_29_21_14-b00) >>>>>>> OpenJDK 64-Bit Server VM (build 25.0-b42, mixed mode) >>>>>>> >>>>>>> >>>>>>> #section:build >>>>>>> ----------messages:(3/100)---------- >>>>>>> command: build ReadAfterClose >>>>>>> reason: Named class compiled on demand >>>>>>> elapsed time (seconds): 60.005 >>>>>>> result: Error. Cannot get VM for test: java.net.SocketTimeoutException: Accept timed out >>>>>>> >>>>>>> #section:compile >>>>>>> ----------messages:(3/235)---------- >>>>>>> command: compile -XDignore.symbol.file=true /Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test/java/io/BufferedInputStream/ReadAfterClose.java >>>>>>> reason: .class file out of date or does not exist >>>>>>> elapsed time (seconds): 60.005 >>>>>>> result: Error. Cannot get VM for test: java.net.SocketTimeoutException: Accept timed out >>>>>>> >>>>>>> >>>>>>> test result: Error. Cannot get VM for test: java.net.SocketTimeoutException: Accept timed out >>>>>>> From nicholas+openjdk at nicholaswilliams.net Tue Jul 30 20:57:37 2013 From: nicholas+openjdk at nicholaswilliams.net (Nick Williams) Date: Tue, 30 Jul 2013 15:57:37 -0500 Subject: Try to run core libs tests -- All IO tests failing In-Reply-To: <51F827DD.6060505@oracle.com> References: <68C504A0-F6DE-4A4D-B09C-0EC8FF1137AE@nicholaswilliams.net> <51F80198.4050209@oracle.com> <51F8262A.3060809@oracle.com> <77FAF780-7A65-4516-B47E-69FB9EADD426@nicholaswilliams.net> <51F827DD.6060505@oracle.com> Message-ID: <2C77DEF7-8588-41D9-8A5B-CBBE73201440@nicholaswilliams.net> Ahhh. I know what's going on. http://blog.leon-rosenberg.net/2012/08/oracle-kills-getlocalhost-on-macos-x-in.html http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7180557 Maybe someone can fix this year-old Java 7 bug that makes getLocalHost() not work sometimes on Mac OS X? :-) N On Jul 30, 2013, at 3:53 PM, Jonathan Gibbons wrote: > Regarding the hostname, jtreg is executing the following code for all tests, not just java.io tests > > String hostname; > try { > hostname = InetAddress.getLocalHost().getCanonicalHostName(); > } catch (UnknownHostException e) { > hostname = "unknown"; > } > > > > On 07/30/2013 01:50 PM, Nick Williams wrote: >> Gotchya. >> >> I commented out the java.io tests locally for now. >> >> By the way, I noticed something. Before, when the java.io tests were failing, the output said "hostname=unknown." However, now that I'm connected to the VPN and they're passing, the output says "hostname=10.211.55.2." When I unplug from the ethernet altogether, the output says "hostname=127.0.0.1." >> >> Sounds like that has something to do with this weird failure of all java.io tests. >> >> N >> >> On Jul 30, 2013, at 3:46 PM, Jonathan Gibbons wrote: >> >>> jtreg itself does not "stop on error". If you're driving the tests through the makefiles, the makefiles may partition the work into separate jtreg runs on separate parts of the test suite. >>> >>> -- Jon >>> >>> >>> On 07/30/2013 01:13 PM, Nick Williams wrote: >>>> Okay, this is indeed very interesting. After two hours it was only about half-way through the java.io tests and all of them had failed so far. On a sheer hunch and nothing more, I unplugged my ethernet cable, thus disconnecting me from any/all networks and the Internet. BOOM. The rest of the java.io tests finished (and passed) in a few seconds, leaving 137 that had failed. I then re-ran the tests while still disconnected from the Internet and 312 of the java.io tests passed this time, leaving only 1 failure (java/io/BufferedReader/Lines.java, output below). >>>> >>>> I plugged my Ethernet back in and ran the tests again and java.io started failing every test again, timing out after 60 seconds each. Curiously extending my hunch I remained connected over Ethernet and connected to a remote network via OpenVPN. Now all of the java.io test pass again (except that same one, with the same output). >>>> >>>> What on Earth??? (If it helps, I'm on Mac OS X 10.7.5.) >>>> >>>> Unfortunately, the one failed java.io test prevents jtreg from continuing on to the next set of tests (java.lang). Anyone know how to tell jtreg to continue running on error? >>>> >>>> Nick >>>> >>>> #Test Results (version 2) >>>> #Tue Jul 30 14:53:42 CDT 2013 >>>> #-----testdescription----- >>>> $file=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test/java/io/BufferedReader/Lines.java >>>> $root=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test >>>> keywords=bug8003258 >>>> run=USER_SPECIFIED testng Lines\n >>>> source=Lines.java >>>> title=\ >>>> >>>> #-----environment----- >>>> >>>> #-----testresult----- >>>> end=Tue Jul 30 14\:53\:42 CDT 2013 >>>> execStatus=Error. Unexpected exception caught from test java/io/BufferedReader/Lines.java\: java.lang.NullPointerException >>>> sections=script_messages Details >>>> >>>> #section:script_messages >>>> ----------messages:(0/0)---------- >>>> >>>> #section:Details >>>> ----------messages:(0/0)---------- >>>> ----------Stack trace:(10/672)---------- >>>> java.lang.NullPointerException >>>> at com.sun.javatest.regtest.TestNGReporter.getMatcher(TestNGReporter.java:97) >>>> at com.sun.javatest.regtest.TestNGReporter.add(TestNGReporter.java:80) >>>> at com.sun.javatest.regtest.TestNGAction.endAction(TestNGAction.java:131) >>>> at com.sun.javatest.regtest.MainAction.run(MainAction.java:260) >>>> at com.sun.javatest.regtest.RegressionScript.run(RegressionScript.java:149) >>>> at com.sun.javatest.Script.run(Script.java:228) >>>> at com.sun.javatest.DefaultTestRunner.runTest(DefaultTestRunner.java:174) >>>> at com.sun.javatest.DefaultTestRunner.access$100(DefaultTestRunner.java:43) >>>> at com.sun.javatest.DefaultTestRunner$1.run(DefaultTestRunner.java:66) >>>> result: Not run. Test running... >>>> >>>> >>>> test result: Error. Unexpected exception caught from test java/io/BufferedReader/Lines.java: java.lang.NullPointerException >>>> >>>> >>>> On Jul 30, 2013, at 1:39 PM, Nick Williams wrote: >>>> >>>>> On Jul 30, 2013, at 1:16 PM, Nick Williams wrote: >>>>> >>>>>> On Jul 30, 2013, at 1:10 PM, Alan Bateman wrote: >>>>>> >>>>>>> On 30/07/2013 11:02, Nick Williams wrote: >>>>>>>> I'm running the core libs tests locally (for the first time), and every java.io test is failing. They're all failing for the same reason (output below), and I suspect it's something local and not an actual problem. But the test output is not very helpful. Note that all of the java.beans tests passed with flying colors. Once it got to java.io, everything started failing. Worse, each test is taking 60 seconds to fail. I could be here a while... >>>>>>>> >>>>>>>> Thoughts? >>>>>>> What command are you using? From the output it suggests that the connection between jtreg and the agent VM cannot be established. >>>>>>> >>>>>>> -Alan. >>>>>> Command, just like README-builds.html#testing says: >>>>>> >>>>>> cd test && make PRODUCT_HOME=`pwd`/../build/macosx-x86_64-normal-server-release/images/j2sdk-image/ all >>>>>> >>>>>> I assume this is specifically an java.io-related problem because all the java.beans tests passed without exception and so far every java.io test through java.io.Externalizable (that's as far as it has gotten) has failed without exception. Wouldn't a problem with jtreg communicating with the agent VM have shown up in java.beans as well? I could be wrong of course. >>>>> I see now that java.beans tests run in "othervm mode" while java.io tests run in "agentvm mode." Didn't realize they were being run differently. Your explanation makes much more sense now, but I still don't know what's wrong... >>>>> >>>>>>>> Here's the output from one of the tests. It looks like all the other test outputs: >>>>>>>> >>>>>>>> #Test Results (version 2) >>>>>>>> #Tue Jul 30 12:38:15 CDT 2013 >>>>>>>> #-----testdescription----- >>>>>>>> $file=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test/java/io/BufferedInputStream/ReadAfterClose.java >>>>>>>> $root=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test >>>>>>>> keywords=bug4143651 >>>>>>>> run=ASSUMED_ACTION main ReadAfterClose\n >>>>>>>> source=ReadAfterClose.java >>>>>>>> title=Test if I/O methods will check if the stream has been closed. >>>>>>>> >>>>>>>> #-----environment----- >>>>>>>> >>>>>>>> #-----testresult----- >>>>>>>> description=file\:/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test/java/io/BufferedInputStream/ReadAfterClose.java >>>>>>>> elapsed=60007 0\:01\:00.007 >>>>>>>> end=Tue Jul 30 12\:38\:15 CDT 2013 >>>>>>>> environment=regtest >>>>>>>> execStatus=Error. Cannot get VM for test\: java.net.SocketTimeoutException\: Accept timed out >>>>>>>> hostname=unknown >>>>>>>> javatestOS=Mac OS X 10.7.5 (x86_64) >>>>>>>> javatestVersion=4.4.1 >>>>>>>> jtregVersion=jtreg 4.1 dev b00 >>>>>>>> script=com.sun.javatest.regtest.RegressionScript >>>>>>>> sections=script_messages build compile >>>>>>>> start=Tue Jul 30 12\:37\:15 CDT 2013 >>>>>>>> test=java/io/BufferedInputStream/ReadAfterClose.java >>>>>>>> user.name=Nicholas >>>>>>>> work=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/build/macosx-amd64/testoutput/jdk_io/JTwork/java/io/BufferedInputStream >>>>>>>> >>>>>>>> #section:script_messages >>>>>>>> ----------messages:(5/308)---------- >>>>>>>> JDK under test: (/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/test/../build/macosx-x86_64-normal-server-release/images/j2sdk-image) >>>>>>>> openjdk version "1.8.0-internal" >>>>>>>> OpenJDK Runtime Environment (build 1.8.0-internal-icholas_2013_07_29_21_14-b00) >>>>>>>> OpenJDK 64-Bit Server VM (build 25.0-b42, mixed mode) >>>>>>>> >>>>>>>> >>>>>>>> #section:build >>>>>>>> ----------messages:(3/100)---------- >>>>>>>> command: build ReadAfterClose >>>>>>>> reason: Named class compiled on demand >>>>>>>> elapsed time (seconds): 60.005 >>>>>>>> result: Error. Cannot get VM for test: java.net.SocketTimeoutException: Accept timed out >>>>>>>> >>>>>>>> #section:compile >>>>>>>> ----------messages:(3/235)---------- >>>>>>>> command: compile -XDignore.symbol.file=true /Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test/java/io/BufferedInputStream/ReadAfterClose.java >>>>>>>> reason: .class file out of date or does not exist >>>>>>>> elapsed time (seconds): 60.005 >>>>>>>> result: Error. Cannot get VM for test: java.net.SocketTimeoutException: Accept timed out >>>>>>>> >>>>>>>> >>>>>>>> test result: Error. Cannot get VM for test: java.net.SocketTimeoutException: Accept timed out >>>>>>>> > From henry.jen at oracle.com Tue Jul 30 20:58:13 2013 From: henry.jen at oracle.com (Henry Jen) Date: Tue, 30 Jul 2013 13:58:13 -0700 Subject: CFR: 8020977: StringJoiner merges with itself not as expected In-Reply-To: References: <51F72532.3010101@oracle.com> <51F7286C.9000508@oracle.com> <51F7F146.80704@oracle.com> Message-ID: <51F828E5.8010708@oracle.com> Updated webrev adapting feedback from Stuart. I need a sponsor to push the fix. Thanks for reviewing. Cheers, Henry On 07/30/2013 11:27 AM, Henry Jen wrote: > > On Jul 30, 2013, at 10:00 AM, Stuart Marks wrote: > >> Hi Henry, >> >> A couple minor comments on this. >> >> I don't think it's necessary to snapshot other.value into a local otherBuilder variable. If other == this, when the value is mutated by prepareBuilder(), otherBuilder still points to this.value, whose contents have changed. So the actual data isn't being snapshotted, as is implied by the comment "seize the data". >> >> The essence of the change is to snapshot other's original length. Of course this works because we know that prepareBuilder() only appends, so we don't have to copy the entire value. >> >> I'd just use other.value and clarify the comment. >> > > That's fine, I think the reason in earlier version to capture the other.value is to avoid member access multiple times? > > As you said, I only try to get the length as that's enough to ensure we "seize" the data. > >> ** >> >> It's a separate issue but I spent some time puzzling over the (other.prefix.length() < length) condition trying to figure out why it's necessary. It turns out that it isn't. :-) [At least that I could see; the tests may prove me wrong.] >> >> It's invariant that other.prefix.length() <= other.value.length(). They're only equal length if somebody has added the empty string to other. So the condition saves a call to append() if this is the case. Having this test is an optimization of sorts, but append() handles appending a zero-length interval just fine, so IMO this extra test adds a bit of clutter to the code. >> >> Up to you whether you want to do anything about this. >> > > Your analysis is correct, and I think it's really just defensive. I don't think it can happen as we do guard against other.value == null, which is the only case length will be less than prefix. > > Cheers, > Henry > From henry.jen at oracle.com Tue Jul 30 20:59:11 2013 From: henry.jen at oracle.com (Henry Jen) Date: Tue, 30 Jul 2013 13:59:11 -0700 Subject: CFR: 8020977: StringJoiner merges with itself not as expected In-Reply-To: <51F828E5.8010708@oracle.com> References: <51F72532.3010101@oracle.com> <51F7286C.9000508@oracle.com> <51F7F146.80704@oracle.com> <51F828E5.8010708@oracle.com> Message-ID: <51F8291F.9080308@oracle.com> On 07/30/2013 01:58 PM, Henry Jen wrote: > Updated webrev adapting feedback from Stuart. > > I need a sponsor to push the fix. Thanks for reviewing. > Sigh, again, the webrev is at http://cr.openjdk.java.net/~henryjen/tl/8020977/1/webrev/ Cheers, Henry From jonathan.gibbons at oracle.com Tue Jul 30 21:05:07 2013 From: jonathan.gibbons at oracle.com (Jonathan Gibbons) Date: Tue, 30 Jul 2013 14:05:07 -0700 Subject: Try to run core libs tests -- All IO tests failing In-Reply-To: <2C77DEF7-8588-41D9-8A5B-CBBE73201440@nicholaswilliams.net> References: <68C504A0-F6DE-4A4D-B09C-0EC8FF1137AE@nicholaswilliams.net> <51F80198.4050209@oracle.com> <51F8262A.3060809@oracle.com> <77FAF780-7A65-4516-B47E-69FB9EADD426@nicholaswilliams.net> <51F827DD.6060505@oracle.com> <2C77DEF7-8588-41D9-8A5B-CBBE73201440@nicholaswilliams.net> Message-ID: <51F82A83.8020903@oracle.com> Bumped the isue to P2, marked it "Affect 8" and added a link to this thread. -- Jon On 07/30/2013 01:57 PM, Nick Williams wrote: > Ahhh. I know what's going on. > > http://blog.leon-rosenberg.net/2012/08/oracle-kills-getlocalhost-on-macos-x-in.html > http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7180557 > > Maybe someone can fix this year-old Java 7 bug that makes > getLocalHost() not work sometimes on Mac OS X? :-) > > N > > On Jul 30, 2013, at 3:53 PM, Jonathan Gibbons wrote: > >> Regarding the hostname, jtreg is executing the following code for all >> tests, not just java.io tests >> >> String hostname; >> try { >> hostname = InetAddress.getLocalHost().getCanonicalHostName(); >> } catch (UnknownHostException e) { >> hostname = "unknown"; >> } >> >> >> >> On 07/30/2013 01:50 PM, Nick Williams wrote: >>> Gotchya. >>> >>> I commented out the java.io tests locally for now. >>> >>> By the way, I noticed something. Before, when the java.io tests were >>> failing, the output said "hostname=unknown." However, now that I'm >>> connected to the VPN and they're passing, the output says >>> "hostname=10.211.55.2." When I unplug from the ethernet altogether, >>> the output says "hostname=127.0.0.1." >>> >>> Sounds like that has something to do with this weird failure of all >>> java.io tests. >>> >>> N >>> >>> On Jul 30, 2013, at 3:46 PM, Jonathan Gibbons wrote: >>> >>>> jtreg itself does not "stop on error". If you're driving the tests >>>> through the makefiles, the makefiles may partition the work into >>>> separate jtreg runs on separate parts of the test suite. >>>> >>>> -- Jon >>>> >>>> >>>> On 07/30/2013 01:13 PM, Nick Williams wrote: >>>>> Okay, this is indeed very interesting. After two hours it was only >>>>> about half-way through the java.io tests and all of them had >>>>> failed so far. On a sheer hunch and nothing more, I unplugged my >>>>> ethernet cable, thus disconnecting me from any/all networks and >>>>> the Internet. BOOM. The rest of the java.io tests finished (and >>>>> passed) in a few seconds, leaving 137 that had failed. I then >>>>> re-ran the tests while still disconnected from the Internet and >>>>> 312 of the java.io tests passed this time, leaving only 1 failure >>>>> (java/io/BufferedReader/Lines.java, output below). >>>>> >>>>> I plugged my Ethernet back in and ran the tests again and java.io >>>>> started failing every test again, timing out after 60 seconds >>>>> each. Curiously extending my hunch I remained connected over >>>>> Ethernet and connected to a remote network via OpenVPN. Now all of >>>>> the java.io test pass again (except that same one, with the same >>>>> output). >>>>> >>>>> What on Earth??? (If it helps, I'm on Mac OS X 10.7.5.) >>>>> >>>>> Unfortunately, the one failed java.io test prevents jtreg from >>>>> continuing on to the next set of tests (java.lang). Anyone know >>>>> how to tell jtreg to continue running on error? >>>>> >>>>> Nick >>>>> >>>>> #Test Results (version 2) >>>>> #Tue Jul 30 14:53:42 CDT 2013 >>>>> #-----testdescription----- >>>>> $file=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test/java/io/BufferedReader/Lines.java >>>>> $root=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test >>>>> keywords=bug8003258 >>>>> run=USER_SPECIFIED testng Lines\n >>>>> source=Lines.java >>>>> title=\ >>>>> >>>>> #-----environment----- >>>>> >>>>> #-----testresult----- >>>>> end=Tue Jul 30 14\:53\:42 CDT 2013 >>>>> execStatus=Error. Unexpected exception caught from test >>>>> java/io/BufferedReader/Lines.java\: java.lang.NullPointerException >>>>> sections=script_messages Details >>>>> >>>>> #section:script_messages >>>>> ----------messages:(0/0)---------- >>>>> >>>>> #section:Details >>>>> ----------messages:(0/0)---------- >>>>> ----------Stack trace:(10/672)---------- >>>>> java.lang.NullPointerException >>>>> at >>>>> com.sun.javatest.regtest.TestNGReporter.getMatcher(TestNGReporter.java:97) >>>>> at com.sun.javatest.regtest.TestNGReporter.add(TestNGReporter.java:80) >>>>> at >>>>> com.sun.javatest.regtest.TestNGAction.endAction(TestNGAction.java:131) >>>>> at com.sun.javatest.regtest.MainAction.run(MainAction.java:260) >>>>> at >>>>> com.sun.javatest.regtest.RegressionScript.run(RegressionScript.java:149) >>>>> at com.sun.javatest.Script.run(Script.java:228) >>>>> at >>>>> com.sun.javatest.DefaultTestRunner.runTest(DefaultTestRunner.java:174) >>>>> at >>>>> com.sun.javatest.DefaultTestRunner.access$100(DefaultTestRunner.java:43) >>>>> at com.sun.javatest.DefaultTestRunner$1.run(DefaultTestRunner.java:66) >>>>> result: Not run. Test running... >>>>> >>>>> >>>>> test result: Error. Unexpected exception caught from test >>>>> java/io/BufferedReader/Lines.java: java.lang.NullPointerException >>>>> >>>>> >>>>> On Jul 30, 2013, at 1:39 PM, Nick Williams wrote: >>>>> >>>>>> On Jul 30, 2013, at 1:16 PM, Nick Williams wrote: >>>>>> >>>>>>> On Jul 30, 2013, at 1:10 PM, Alan Bateman wrote: >>>>>>> >>>>>>>> On 30/07/2013 11:02, Nick Williams wrote: >>>>>>>>> I'm running the core libs tests locally (for the first time), >>>>>>>>> and every java.io test is failing. They're all failing for the >>>>>>>>> same reason (output below), and I suspect it's something local >>>>>>>>> and not an actual problem. But the test output is not very >>>>>>>>> helpful. Note that all of the java.beans tests passed with >>>>>>>>> flying colors. Once it got to java.io, everything started >>>>>>>>> failing. Worse, each test is taking 60 seconds to fail. I >>>>>>>>> could be here a while... >>>>>>>>> >>>>>>>>> Thoughts? >>>>>>>> What command are you using? From the output it suggests that >>>>>>>> the connection between jtreg and the agent VM cannot be >>>>>>>> established. >>>>>>>> >>>>>>>> -Alan. >>>>>>> Command, just like README-builds.html#testing says: >>>>>>> >>>>>>> cd test && make >>>>>>> PRODUCT_HOME=`pwd`/../build/macosx-x86_64-normal-server-release/images/j2sdk-image/ >>>>>>> all >>>>>>> >>>>>>> I assume this is specifically an java.io-related problem because >>>>>>> all the java.beans tests passed without exception and so far >>>>>>> every java.io test through java.io.Externalizable (that's as far >>>>>>> as it has gotten) has failed without exception. Wouldn't a >>>>>>> problem with jtreg communicating with the agent VM have shown up >>>>>>> in java.beans as well? I could be wrong of course. >>>>>> I see now that java.beans tests run in "othervm mode" while >>>>>> java.io tests run in "agentvm mode." Didn't realize they were >>>>>> being run differently. Your explanation makes much more sense >>>>>> now, but I still don't know what's wrong... >>>>>> >>>>>>>>> Here's the output from one of the tests. It looks like all the >>>>>>>>> other test outputs: >>>>>>>>> >>>>>>>>> #Test Results (version 2) >>>>>>>>> #Tue Jul 30 12:38:15 CDT 2013 >>>>>>>>> #-----testdescription----- >>>>>>>>> $file=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test/java/io/BufferedInputStream/ReadAfterClose.java >>>>>>>>> $root=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test >>>>>>>>> keywords=bug4143651 >>>>>>>>> run=ASSUMED_ACTION main ReadAfterClose\n >>>>>>>>> source=ReadAfterClose.java >>>>>>>>> title=Test if I/O methods will check if the stream has been >>>>>>>>> closed. >>>>>>>>> >>>>>>>>> #-----environment----- >>>>>>>>> >>>>>>>>> #-----testresult----- >>>>>>>>> description=file\:/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test/java/io/BufferedInputStream/ReadAfterClose.java >>>>>>>>> elapsed=60007 0\:01\:00.007 >>>>>>>>> end=Tue Jul 30 12\:38\:15 CDT 2013 >>>>>>>>> environment=regtest >>>>>>>>> execStatus=Error. Cannot get VM for test\: >>>>>>>>> java.net.SocketTimeoutException\: Accept timed out >>>>>>>>> hostname=unknown >>>>>>>>> javatestOS=Mac OS X 10.7.5 (x86_64) >>>>>>>>> javatestVersion=4.4.1 >>>>>>>>> jtregVersion=jtreg 4.1 dev b00 >>>>>>>>> script=com.sun.javatest.regtest.RegressionScript >>>>>>>>> sections=script_messages build compile >>>>>>>>> start=Tue Jul 30 12\:37\:15 CDT 2013 >>>>>>>>> test=java/io/BufferedInputStream/ReadAfterClose.java >>>>>>>>> user.name=Nicholas >>>>>>>>> work=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/build/macosx-amd64/testoutput/jdk_io/JTwork/java/io/BufferedInputStream >>>>>>>>> >>>>>>>>> #section:script_messages >>>>>>>>> ----------messages:(5/308)---------- >>>>>>>>> JDK under test: >>>>>>>>> (/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/test/../build/macosx-x86_64-normal-server-release/images/j2sdk-image) >>>>>>>>> openjdk version "1.8.0-internal" >>>>>>>>> OpenJDK Runtime Environment (build >>>>>>>>> 1.8.0-internal-icholas_2013_07_29_21_14-b00) >>>>>>>>> OpenJDK 64-Bit Server VM (build 25.0-b42, mixed mode) >>>>>>>>> >>>>>>>>> >>>>>>>>> #section:build >>>>>>>>> ----------messages:(3/100)---------- >>>>>>>>> command: build ReadAfterClose >>>>>>>>> reason: Named class compiled on demand >>>>>>>>> elapsed time (seconds): 60.005 >>>>>>>>> result: Error. Cannot get VM for test: >>>>>>>>> java.net.SocketTimeoutException: Accept timed out >>>>>>>>> >>>>>>>>> #section:compile >>>>>>>>> ----------messages:(3/235)---------- >>>>>>>>> command: compile -XDignore.symbol.file=true >>>>>>>>> /Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test/java/io/BufferedInputStream/ReadAfterClose.java >>>>>>>>> reason: .class file out of date or does not exist >>>>>>>>> elapsed time (seconds): 60.005 >>>>>>>>> result: Error. Cannot get VM for test: >>>>>>>>> java.net.SocketTimeoutException: Accept timed out >>>>>>>>> >>>>>>>>> >>>>>>>>> test result: Error. Cannot get VM for test: >>>>>>>>> java.net.SocketTimeoutException: Accept timed out >>>>>>>>> >> > From xueming.shen at oracle.com Tue Jul 30 21:41:44 2013 From: xueming.shen at oracle.com (xueming.shen at oracle.com) Date: Tue, 30 Jul 2013 21:41:44 +0000 Subject: hg: jdk8/tl/jdk: 8021767: test/java/time/tck/java/time/format/TCKFormatStyle.java failing Message-ID: <20130730214210.B172D48490@hg.openjdk.java.net> Changeset: 8bc1bbd5b659 Author: sherman Date: 2013-07-30 14:43 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/8bc1bbd5b659 8021767: test/java/time/tck/java/time/format/TCKFormatStyle.java failing Summary: Correct to use fixed locale, not locale of test environment Reviewed-by: alanb, okutsu Contributed-by: roger.riggs at oracle.com ! test/java/time/tck/java/time/format/TCKFormatStyle.java From stuart.marks at oracle.com Tue Jul 30 22:03:16 2013 From: stuart.marks at oracle.com (Stuart Marks) Date: Tue, 30 Jul 2013 15:03:16 -0700 Subject: CFR: 8020977: StringJoiner merges with itself not as expected In-Reply-To: <51F8291F.9080308@oracle.com> References: <51F72532.3010101@oracle.com> <51F7286C.9000508@oracle.com> <51F7F146.80704@oracle.com> <51F828E5.8010708@oracle.com> <51F8291F.9080308@oracle.com> Message-ID: <51F83824.1010307@oracle.com> On 7/30/13 1:59 PM, Henry Jen wrote: > On 07/30/2013 01:58 PM, Henry Jen wrote: >> Updated webrev adapting feedback from Stuart. >> >> I need a sponsor to push the fix. Thanks for reviewing. >> > > Sigh, again, the webrev is at > http://cr.openjdk.java.net/~henryjen/tl/8020977/1/webrev/ Looks good, thanks for updating. I'll push it, but only if you add me to the reviewer line. ;-) s'marks From henry.jen at oracle.com Tue Jul 30 22:50:56 2013 From: henry.jen at oracle.com (Henry Jen) Date: Tue, 30 Jul 2013 15:50:56 -0700 Subject: CFR: 8020977: StringJoiner merges with itself not as expected In-Reply-To: <51F83824.1010307@oracle.com> References: <51F72532.3010101@oracle.com> <51F7286C.9000508@oracle.com> <51F7F146.80704@oracle.com> <51F828E5.8010708@oracle.com> <51F8291F.9080308@oracle.com> <51F83824.1010307@oracle.com> Message-ID: <575D6D6C-05BE-43E6-B59F-D64B1EF1E6D1@oracle.com> My bad, you should be on the reviewer list. After all, this update is based on your feedback. Webrev updated with Reviewed-by. Cheers, Henry On Jul 30, 2013, at 3:03 PM, Stuart Marks wrote: > On 7/30/13 1:59 PM, Henry Jen wrote: >> On 07/30/2013 01:58 PM, Henry Jen wrote: >>> Updated webrev adapting feedback from Stuart. >>> >>> I need a sponsor to push the fix. Thanks for reviewing. >>> >> >> Sigh, again, the webrev is at >> http://cr.openjdk.java.net/~henryjen/tl/8020977/1/webrev/ > > Looks good, thanks for updating. > > I'll push it, but only if you add me to the reviewer line. ;-) > > s'marks > From swingler at apple.com Tue Jul 30 22:53:30 2013 From: swingler at apple.com (Mike Swingler) Date: Tue, 30 Jul 2013 15:53:30 -0700 Subject: Java 8 RFR 8011194: Apps launched via double-clicked .jars have file.encoding value of US-ASCII on Mac OS X In-Reply-To: <8CC8FA32-26C3-47D3-B6A3-33AA4BEC7D12@devrx.org> References: <51F2B781.1050104@oracle.com> <51F5FA02.9020909@oracle.com> <51F6C860.4020000@oracle.com> <51F72EAD.7040201@oracle.com> <8CC8FA32-26C3-47D3-B6A3-33AA4BEC7D12@devrx.org> Message-ID: <4DB36382-0D2A-492F-8472-C198D2AB1568@apple.com> Apple is highly unlikely to change the behavior of nl_langinfo(). There is already code in the JDK that calls into JRSCopyPrimaryLanguage(), JRSCopyCanonicalLanguageForPrimaryLanguage(), and JRSSetDefaultLocalization() for exactly this purpose. Please proceed with setting the encoding to UTF-8. It is the de-facto standard for every Cocoa application I have ever seen. US-ASCII is always the wrong choice for a graphical app on OS X. Regards, Mike Swingler Apple Inc. On Jul 30, 2013, at 9:05 AM, Francis Devereux wrote: > I suspect that Apple might be unlikely to change the value that nl_langinfo returns when LANG is unset. > > However, it might be possible to fix this issue without second-guessing the character set reported by the OS by calling [NSLocale currentLocale] (or the CFLocale equivalent) instead of nl_langinfo. I think (although I haven't checked) that that [NSLocale currentLocale] determines the current locale using a mechanism other than environment variables, because LANG is usually be unset for GUI apps on OS X. > > On 30 Jul 2013, at 15:56, Scott Palmer wrote: > >> Then shouldn't you be complaining to Apple that the value returned by >> nl_langinfo needs to be changed? >> David's point seems to be that second guessing the character set reported >> by the OS is likely to cause a different set of problems. >> >> Scott >> >> >> On Tue, Jul 30, 2013 at 10:14 AM, Johannes Schindelin < >> Johannes.Schindelin at gmx.de> wrote: >> >>> Hi, >>> >>> On Tue, 30 Jul 2013, David Holmes wrote: >>> >>>> On 30/07/2013 5:54 AM, Brent Christian wrote: >>>>> On 7/28/13 10:13 PM, David Holmes wrote: >>>>>> On 27/07/2013 3:53 AM, Brent Christian wrote: >>>>>>> Please review my fix for 8011194 : "Apps launched via >>> double-clicked >>>>>>> .jars have file.encoding value of US-ASCII on Mac OS X" >>>>>>> >>>>>>> http://bugs.sun.com/view_bug.do?bug_id=8011194 >>>>>>> >>>>>>> In most cases of launching a Java app on Mac (from the cmdline, or >>>>>>> from a native .app bundle), reading and displaying UTF-8 >>>>>>> characters beyond the standard ASCII range works fine. >>>>>>> >>>>>>> A notable exception is the launching of an app by double-clicking >>>>>>> a .jar file. In this case, file.encoding defaults to US-ASCII, >>>>>>> and characters outside of the ASCII range show up as garbage. >>>>>> >>>>>> Why does this occur? What sets the encoding to US-ASCII? >>>>> >>>>> "US-ASCII" is the answer we get from nl_langinfo(CODESET) because no >>>>> values for LANG/LC* are set in the environment when double-clicking a >>>>> .jar. >>>>> >>>>> We get "UTF-8" when launching from the command line because the >>>>> default Terminal.app setup on Mac will setup LANG for you (to >>>>> "en_US.UTF-8" in the US). >>>> >>>> Sounds like a user environment error to me. This isn't my area but I'm >>>> not convinced we should be second guessing what we think the encoding >>>> should be. >>> >>> Except that that is not the case here, of course. The user did *not* set >>> any environment variable in this case. >>> >>> So we are not talking about "second guessing" or "user environment error" >>> but about a sensible default. >>> >>> As to US-ASCII, sorry to say: the seventies called and want their >>> character set back. >>> >>> There can be no question that UTF-8 is the best default character >>> encoding, or are you even going to question *that*? >>> >>>> What if someone intends for it to be US-ASCII? >>> >>> Then LANG would not be unset, would it. >>> >>> Hth, >>> Johannes >>> >> > From david.dehaven at oracle.com Tue Jul 30 23:06:42 2013 From: david.dehaven at oracle.com (David DeHaven) Date: Tue, 30 Jul 2013 16:06:42 -0700 Subject: Java 8 RFR 8011194: Apps launched via double-clicked .jars have file.encoding value of US-ASCII on Mac OS X In-Reply-To: <4DB36382-0D2A-492F-8472-C198D2AB1568@apple.com> References: <51F2B781.1050104@oracle.com> <51F5FA02.9020909@oracle.com> <51F6C860.4020000@oracle.com> <51F72EAD.7040201@oracle.com> <8CC8FA32-26C3-47D3-B6A3-33AA4BEC7D12@devrx.org> <4DB36382-0D2A-492F-8472-C198D2AB1568@apple.com> Message-ID: I was about to chime in that UTF-8 has been the preferred encoding for (stored) text on Mac OS X as long as I've been hacking on it (think "Rhapsody"), so why is this even an issue? Judging from the docs, nl_langinfo seems like a Unix portability function (something more likely to be happier with ASCII in a terminal), not something to be used by a native Cocoa application. Set it to UTF-8 and forget about it -DrD- > Apple is highly unlikely to change the behavior of nl_langinfo(). > > There is already code in the JDK that calls into JRSCopyPrimaryLanguage(), JRSCopyCanonicalLanguageForPrimaryLanguage(), and JRSSetDefaultLocalization() for exactly this purpose. > > Please proceed with setting the encoding to UTF-8. It is the de-facto standard for every Cocoa application I have ever seen. US-ASCII is always the wrong choice for a graphical app on OS X. > > Regards, > Mike Swingler > Apple Inc. > > On Jul 30, 2013, at 9:05 AM, Francis Devereux wrote: > >> I suspect that Apple might be unlikely to change the value that nl_langinfo returns when LANG is unset. >> >> However, it might be possible to fix this issue without second-guessing the character set reported by the OS by calling [NSLocale currentLocale] (or the CFLocale equivalent) instead of nl_langinfo. I think (although I haven't checked) that that [NSLocale currentLocale] determines the current locale using a mechanism other than environment variables, because LANG is usually be unset for GUI apps on OS X. >> >> On 30 Jul 2013, at 15:56, Scott Palmer wrote: >> >>> Then shouldn't you be complaining to Apple that the value returned by >>> nl_langinfo needs to be changed? >>> David's point seems to be that second guessing the character set reported >>> by the OS is likely to cause a different set of problems. >>> >>> Scott >>> >>> >>> On Tue, Jul 30, 2013 at 10:14 AM, Johannes Schindelin < >>> Johannes.Schindelin at gmx.de> wrote: >>> >>>> Hi, >>>> >>>> On Tue, 30 Jul 2013, David Holmes wrote: >>>> >>>>> On 30/07/2013 5:54 AM, Brent Christian wrote: >>>>>> On 7/28/13 10:13 PM, David Holmes wrote: >>>>>>> On 27/07/2013 3:53 AM, Brent Christian wrote: >>>>>>>> Please review my fix for 8011194 : "Apps launched via >>>> double-clicked >>>>>>>> .jars have file.encoding value of US-ASCII on Mac OS X" >>>>>>>> >>>>>>>> http://bugs.sun.com/view_bug.do?bug_id=8011194 >>>>>>>> >>>>>>>> In most cases of launching a Java app on Mac (from the cmdline, or >>>>>>>> from a native .app bundle), reading and displaying UTF-8 >>>>>>>> characters beyond the standard ASCII range works fine. >>>>>>>> >>>>>>>> A notable exception is the launching of an app by double-clicking >>>>>>>> a .jar file. In this case, file.encoding defaults to US-ASCII, >>>>>>>> and characters outside of the ASCII range show up as garbage. >>>>>>> >>>>>>> Why does this occur? What sets the encoding to US-ASCII? >>>>>> >>>>>> "US-ASCII" is the answer we get from nl_langinfo(CODESET) because no >>>>>> values for LANG/LC* are set in the environment when double-clicking a >>>>>> .jar. >>>>>> >>>>>> We get "UTF-8" when launching from the command line because the >>>>>> default Terminal.app setup on Mac will setup LANG for you (to >>>>>> "en_US.UTF-8" in the US). >>>>> >>>>> Sounds like a user environment error to me. This isn't my area but I'm >>>>> not convinced we should be second guessing what we think the encoding >>>>> should be. >>>> >>>> Except that that is not the case here, of course. The user did *not* set >>>> any environment variable in this case. >>>> >>>> So we are not talking about "second guessing" or "user environment error" >>>> but about a sensible default. >>>> >>>> As to US-ASCII, sorry to say: the seventies called and want their >>>> character set back. >>>> >>>> There can be no question that UTF-8 is the best default character >>>> encoding, or are you even going to question *that*? >>>> >>>>> What if someone intends for it to be US-ASCII? >>>> >>>> Then LANG would not be unset, would it. >>>> >>>> Hth, >>>> Johannes >>>> >>> >> > From nicholas+openjdk at nicholaswilliams.net Tue Jul 30 23:11:20 2013 From: nicholas+openjdk at nicholaswilliams.net (Nick Williams) Date: Tue, 30 Jul 2013 18:11:20 -0500 Subject: Classes on the stack trace (was: getElementClass/StackTraceElement, was: @CallerSensitive public API, was: sun.reflect.Reflection.getCallerClass) In-Reply-To: <51F7DCD0.1030306@gmx.org> References: <51F7AEEE.4040305@gmail.com> <51F7BD75.4030708@gmx.org> <51F7CACD.2070703@gmail.com> <51F7DCD0.1030306@gmx.org> Message-ID: <50B05474-BD3F-47C7-8412-F0F305E0F0FF@nicholaswilliams.net> Quick question for those of you that know anything about @CallerSensitive... After looking at the code and experimenting some, I've discovered that getCallerClass() doesn't actually keep going until it finds the first method without @CallerSensitive. It only returns the caller of the caller. So, for example: Stack 1 @CallerSensitive Reflection.getCallerClass() @CallerSensitive MyClass1.method1(); MyClass2.method2(); In this case, getCallerClass() returns MyClass2.class. BUT: Stack 2 @CallerSensitive Reflection.getCallerClass() @CallerSensitive MyClass1.method1(); @CallerSensitive MyClass2.method2(); MyClass3.method3(); In this case, getCallerClass() STILL returns MyClass2.class. Based on the plain-language meaning of @CallerSensitive, I would expect getCallerClass() to return MyClass3.class in the second case. But, indeed, the JavaDoc for Reflection.getCallerClass() says: "Returns the class of the caller of the method calling this method." So, then, what's the point of @CallerSensitive? Looking at the code: vframeStream vfst(thread); // Cf. LibraryCallKit::inline_native_Reflection_getCallerClass for (int n = 0; !vfst.at_end(); vfst.security_next(), n++) { Method* m = vfst.method(); assert(m != NULL, "sanity"); switch (n) { case 0: // This must only be called from Reflection.getCallerClass if (m->intrinsic_id() != vmIntrinsics::_getCallerClass) { THROW_MSG_NULL(vmSymbols::java_lang_InternalError(), "JVM_GetCallerClass must only be called from Reflection.getCallerClass"); } // fall-through case 1: // Frame 0 and 1 must be caller sensitive. if (!m->caller_sensitive()) { THROW_MSG_NULL(vmSymbols::java_lang_InternalError(), err_msg("CallerSensitive annotation expected at frame %d", n)); } break; default: if (!m->is_ignored_by_security_stack_walk()) { // We have reached the desired frame; return the holder class. return (jclass) JNIHandles::make_local(env, m->method_holder()->java_mirror()); } break; } } It seems to me that @CallerSensitive is completely pointless. This is ALWAYS going to return the first non-reflection frame after frame 1, regardless of @CallerSensitive. If @CallerSensitive were really supposed to have an actual purpose, it would seem to me that the last part should be this: if (!m->is_ignored_by_security_stack_walk() && !m->caller_sensitive()) { // We have reached the desired frame; return the holder class. return (jclass) JNIHandles::make_local(env, m->method_holder()->java_mirror()); } Am I completely missing the point here? I just don't see a reason for @CallerSensitive. The code could do the exact same thing it currently is without @CallerSensitive (except for enforcing that frame 1 is @CallerSensitive, which really isn't necessary if you aren't using it in further frames). Thoughts? Nick On Jul 30, 2013, at 10:33 AM, Jochen Theodorou wrote: > Am 30.07.2013 16:16, schrieb Peter Levart: >> >> On 07/30/2013 03:19 PM, Jochen Theodorou wrote: >>> Am 30.07.2013 14:17, schrieb Peter Levart: >>> [...] >>>> So what would give Groovy or other language runtimes headaches when all >>>> there was was a parameter-less getCallerClass() API? Aren't the >>>> intermediate frames inserted by those runtimes controlled by the >>>> runtimes? Couldn't the "surface" runtime-inserted methods capture the >>>> caller and pass it down? I guess the problem is supporting calling the >>>> caller-sensitive methods like Class.forName(String) and such which don't >>>> have the overloaded variant taking caller Class or ClassLoader as an >>>> argument... >>> Speaking for Groovy... >>> those intermediate frames are runtime controlled, yes, but passing down >>> the caller class is exactly the problem. Imagine I would suggest that >>> each and every method definition in Java automatically gets an >>> additional parameter for the caller class, just to have access to it >>> inside the method. You would not accept that for Java, would you? And so >>> we cannot accept that for Groovy if we want to keep integration with >>> Java... >> >> Are you talking about internal Groovy implementation (the >> runtime-inserted methods) or the publicly visible API? > > that's the problem, it is a mix, some internal, other not. We are going to change that in Groovy 3 > >> One solution for >> internal implementation of Groovy could be (speaking by heart since I >> don't know the internals of Groovy) for the "surface" public API method >> which doesn't have to have the special caller parameter, to capture the >> caller with getCallerClass() parameterless API (possibly enclosed with a >> quick check confirming that it might actually be needed) and bind it to >> a ThreadLocal, then use this ThreadLocal down at the end... > > confirming that it might actually be needed is a problem. In the old fallback path we don't know what we call until after we are deep in runtime code, and there it is too late. In the other paths we could mark those methods in a @CallerSensitive style and do it in that case only. > >>> and the good integration with Java is one of the key points of >>> Groovy. Even if we make something like that @CallerSensitive and add the >>> parameter only in those cases, we break being able to override methods. >> >> I guess I don't know every Groovy need to obtain the caller class. I >> thought the problem was to support calling caller-sensitive methods in >> Java API (like Class.forName(String)) from within Groovy code, where >> there are runtime-inserted frames between the "call-site" and the target >> method. Are there any other needs? > > ok, there is a misunderstanding... > > if we call a Java implemented method from Groovy, which is using getCallerClass() it may or may not work. In general this does not work and our problem is not about that at all. With the change to let getCallerClass() ignore some reflective frames it will work actually better as long as we use our custom callsite caching implementation, it will not work if indy is used or the fallback path. > > To be able to call a method Class#forName(String), we need to "replace" it with an implementation of our own, which we do with an approach similar to extension methods (only that ours can hide existing implementation methods for groovy). And in there we need to get to the caller class > > Our problem though is @Grab which is an annotation to add elements to the classpath while running a script. > >>> Plus, before Groovy3 is not done we have to support several call paths. >>> And the oldest one, which is still a fallback, does not support >>> transporting the caller class through the runtime layers at all. >>> Changing here is a breaking change. >> >> Could you describe those call-paths? Examples of Groovy code and to what >> it gets translated (equivalent Java code at call site) with a brief >> description of what each intermediate layer (between the call-site and >> the target method) does and at which point the caller class is extracted... > > the code generated at the call site depends on several factors actually... The call site code itself is usually not very informative > > I start with Groovy 1.0, since that is basically the fallback path. Here this.foo() translates more or less to > ScriptBytecodeAdapter.invokeMethod0(staticCallerClass, this,"foo") > which basically does this.getMetaClass().invokeMethod(staticCallerClass, this, "foo"). The problem is that the meta class might be user supplied and the code executed in invokeMethod as well. The invocation is then finally done by reflection. That means we have frames from ScriptBytecodeAdapter, from the meta class, as well as maybe frames from a custom meta class and reflection frames. At the level of ScriptBytecodeAdapter there is a means of transporting the caller class, but that is the static one. Once there is a subclass, this information is different from what is needed here and it cannot simply be exchanged. Even if the bytecode adapter is changed, we cannot change the public API for MetaClass#invokeMethod now. And then the information would be lost. > > In later versions of Groovy (since 1.6) we introduced a custom call site caching technique, which uses runtime generated classes to create a helper class per call site and is then used for invocation. At the callsite we basically have something like callsiteArray[i].invoke(..). Here again the staticCallerClass can be found. In this version we are able to "get" the method we want to invoke, before invoking it (bypassing MetaClass#invokeMethod). But to be able to get the method, certain conditions have to be met (like no user supplied meta class). If they are not met, then we do basically the same path as in 1.0, only that we don't use ScriptBytecodeAdapter. Instead We use our CallSite class as entrance point, which then makes the call to the meta class. In the "efficent" case we have now frames from the callsite handling code between the callsite and the target method only. This includes reflection in the first instantiation, later the generated class is used so it reduces to two frames of which one is the Callsite entrance point, the other a frame form the generated method. In the fallback case we have frames from the callsite handling code, plus meta class code, plus reflection of course. Again the fallback case prevents us from transporting the caller information to the target method. If we ignore the fallback case, then we could here maybe use the Threadlocal information. It will require a new callsite interface for the bytecode though, meaning this code will not work for precompiled grovvy of older version, excluding from getting into Groovy 2.1.x, since it would be a breaking change. The earliest version for that would be Groovy 2.2.0, which is almost in RC now. Effectively it would mean we would have to do a 2.3.0 very soon after most probably. > > In Groovy 2 we added an indy implementation, which replaces the callsite caching code. At the callsite we have here basically invokedynamic "foo" with IndyInterface#bootstrap. bootstrap will first introduce a target for IndyInterface#selectMethod, since I need the runtime types instead of the static ones. The static caller class information is here part of the bootstrap method as Lookup object, added by invokedynamic itself. After selectMethod is done we have an initial invocation using invokeExact and later invocations by the handle stored in the callsite. Of course the same conditions as for the callsite caching above have to be met, meaning the fallback path might appear. That makes initially one IndyInterface frame, then invokedynamic and lambda related frames, then optionally the traget method, or in the fallback case the meta class frames plus reflection > > > bye Jochen > > -- > Jochen "blackdrag" Theodorou - Groovy Project Tech Lead > blog: http://blackdragsview.blogspot.com/ > german groovy discussion newsgroup: de.comp.lang.misc > For Groovy programming sources visit http://groovy-lang.org > From naoto.sato at oracle.com Tue Jul 30 23:28:40 2013 From: naoto.sato at oracle.com (Naoto Sato) Date: Tue, 30 Jul 2013 16:28:40 -0700 Subject: Java 8 RFR 8011194: Apps launched via double-clicked .jars have file.encoding value of US-ASCII on Mac OS X In-Reply-To: References: <51F2B781.1050104@oracle.com> <51F5FA02.9020909@oracle.com> <51F6C860.4020000@oracle.com> <51F72EAD.7040201@oracle.com> <8CC8FA32-26C3-47D3-B6A3-33AA4BEC7D12@devrx.org> <4DB36382-0D2A-492F-8472-C198D2AB1568@apple.com> Message-ID: <51F84C28.3050209@oracle.com> On 7/30/13 4:06 PM, David DeHaven wrote: > > I was about to chime in that UTF-8 has been the preferred encoding for (stored) text on Mac OS X as long as I've been hacking on it (think "Rhapsody"), so why is this even an issue? > > Judging from the docs, nl_langinfo seems like a Unix portability function (something more likely to be happier with ASCII in a terminal), not something to be used by a native Cocoa application. > > > > Set it to UTF-8 and forget about it > +1. Yet another reasoning is that UTF-8 is backward compatible with ASCII, i.e., exact same mapping for 0x0000-0x007F code points. Naoto > > -DrD- > >> Apple is highly unlikely to change the behavior of nl_langinfo(). >> >> There is already code in the JDK that calls into JRSCopyPrimaryLanguage(), JRSCopyCanonicalLanguageForPrimaryLanguage(), and JRSSetDefaultLocalization() for exactly this purpose. >> >> Please proceed with setting the encoding to UTF-8. It is the de-facto standard for every Cocoa application I have ever seen. US-ASCII is always the wrong choice for a graphical app on OS X. >> >> Regards, >> Mike Swingler >> Apple Inc. >> >> On Jul 30, 2013, at 9:05 AM, Francis Devereux wrote: >> >>> I suspect that Apple might be unlikely to change the value that nl_langinfo returns when LANG is unset. >>> >>> However, it might be possible to fix this issue without second-guessing the character set reported by the OS by calling [NSLocale currentLocale] (or the CFLocale equivalent) instead of nl_langinfo. I think (although I haven't checked) that that [NSLocale currentLocale] determines the current locale using a mechanism other than environment variables, because LANG is usually be unset for GUI apps on OS X. >>> >>> On 30 Jul 2013, at 15:56, Scott Palmer wrote: >>> >>>> Then shouldn't you be complaining to Apple that the value returned by >>>> nl_langinfo needs to be changed? >>>> David's point seems to be that second guessing the character set reported >>>> by the OS is likely to cause a different set of problems. >>>> >>>> Scott >>>> >>>> >>>> On Tue, Jul 30, 2013 at 10:14 AM, Johannes Schindelin < >>>> Johannes.Schindelin at gmx.de> wrote: >>>> >>>>> Hi, >>>>> >>>>> On Tue, 30 Jul 2013, David Holmes wrote: >>>>> >>>>>> On 30/07/2013 5:54 AM, Brent Christian wrote: >>>>>>> On 7/28/13 10:13 PM, David Holmes wrote: >>>>>>>> On 27/07/2013 3:53 AM, Brent Christian wrote: >>>>>>>>> Please review my fix for 8011194 : "Apps launched via >>>>> double-clicked >>>>>>>>> .jars have file.encoding value of US-ASCII on Mac OS X" >>>>>>>>> >>>>>>>>> http://bugs.sun.com/view_bug.do?bug_id=8011194 >>>>>>>>> >>>>>>>>> In most cases of launching a Java app on Mac (from the cmdline, or >>>>>>>>> from a native .app bundle), reading and displaying UTF-8 >>>>>>>>> characters beyond the standard ASCII range works fine. >>>>>>>>> >>>>>>>>> A notable exception is the launching of an app by double-clicking >>>>>>>>> a .jar file. In this case, file.encoding defaults to US-ASCII, >>>>>>>>> and characters outside of the ASCII range show up as garbage. >>>>>>>> >>>>>>>> Why does this occur? What sets the encoding to US-ASCII? >>>>>>> >>>>>>> "US-ASCII" is the answer we get from nl_langinfo(CODESET) because no >>>>>>> values for LANG/LC* are set in the environment when double-clicking a >>>>>>> .jar. >>>>>>> >>>>>>> We get "UTF-8" when launching from the command line because the >>>>>>> default Terminal.app setup on Mac will setup LANG for you (to >>>>>>> "en_US.UTF-8" in the US). >>>>>> >>>>>> Sounds like a user environment error to me. This isn't my area but I'm >>>>>> not convinced we should be second guessing what we think the encoding >>>>>> should be. >>>>> >>>>> Except that that is not the case here, of course. The user did *not* set >>>>> any environment variable in this case. >>>>> >>>>> So we are not talking about "second guessing" or "user environment error" >>>>> but about a sensible default. >>>>> >>>>> As to US-ASCII, sorry to say: the seventies called and want their >>>>> character set back. >>>>> >>>>> There can be no question that UTF-8 is the best default character >>>>> encoding, or are you even going to question *that*? >>>>> >>>>>> What if someone intends for it to be US-ASCII? >>>>> >>>>> Then LANG would not be unset, would it. >>>>> >>>>> Hth, >>>>> Johannes >>>>> >>>> >>> >> > From stuart.marks at oracle.com Tue Jul 30 23:23:59 2013 From: stuart.marks at oracle.com (stuart.marks at oracle.com) Date: Tue, 30 Jul 2013 23:23:59 +0000 Subject: hg: jdk8/tl/jdk: 8020977: StringJoiner merges with itself not as expected Message-ID: <20130730232423.2F97748491@hg.openjdk.java.net> Changeset: 09a77a1bdbc3 Author: henryjen Date: 2013-07-30 15:47 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/09a77a1bdbc3 8020977: StringJoiner merges with itself not as expected Reviewed-by: psandoz, chegar, mduigou, smarks ! src/share/classes/java/util/StringJoiner.java ! test/java/util/StringJoiner/MergeTest.java From mike.duigou at oracle.com Tue Jul 30 23:57:41 2013 From: mike.duigou at oracle.com (Mike Duigou) Date: Tue, 30 Jul 2013 16:57:41 -0700 Subject: RFR: 8021591 : (s) Additional explicit null checks In-Reply-To: <97903415-01F4-4FE2-B5F8-AFBF54217D32@oracle.com> References: <17DBA593-2AD1-4E42-8DD1-790511B63B3F@oracle.com> <97903415-01F4-4FE2-B5F8-AFBF54217D32@oracle.com> Message-ID: On Jul 29 2013, at 04:20 , Paul Sandoz wrote: > Hi Mike, > > V. quick review below. > > > On Jul 27, 2013, at 12:31 AM, Mike Duigou wrote: > >> Hello all; >> >> This patch adds some missing checks for null that, according to interface contract, should be throwing NPE. It also improves the existing tests to check for these cases. >> >> http://cr.openjdk.java.net/~mduigou/JDK-8021591/0/webrev/ >> >> The changes to src/share/classes/java/util/concurrent/ConcurrentHashMap.java will be synchronized separately with the jsr166 workspace. They are part of this review to avoid test failures. >> > > diff --git a/src/share/classes/java/util/Map.java b/src/share/classes/java/util/Map.java > --- a/src/share/classes/java/util/Map.java > +++ b/src/share/classes/java/util/Map.java > @@ -804,6 +804,10 @@ > * return false; > * } > * > + * @implNote The default implementation does not throw NullPointerException > + * for maps that do not support null values if oldValue is null unless > + * newValue is also null. > > > Is that really more a clarification of the default impl specification? Yes. I will switch to @implSpec tag. > > > - * @throws NullPointerException if a specified key or value is null, > + * @throws NullPointerException if a specified key or newValue is null, > * and this map does not permit null keys or values > + * @throws NullPointerException if oldValue is null and this map does not > + * permit null values > + * (optional) > > > More curious than anything else, is it fine to have two declarations of NPE here? Throwing NPE isn't optional if either key or newValue is null and the map does not permit null values. This restriction has to be softened for oldValue because the default implementation doesn't test whether oldValue could be added to the map and doesn't know if the map allows null values. The multiple @throws approach is used as an alternative to a complicated legalistic description in a single throws declaration. It's used uncommonly elsewhere in the JDK. > +++ b/src/share/classes/java/util/TreeMap.java > @@ -948,6 +948,27 @@ > } > > @Override > + public synchronized boolean replace(K key, V oldValue, V newValue) { > + Entry p = getEntry(key); > + if (p!=null && Objects.equals(oldValue, p.value)) { > + p.value = newValue; > + return true; > + } > + return false; > + } > + > + @Override > + public synchronized V replace(K key, V value) { > > Remove the synchronized? Yes, thanks for catching that. > I might be missing something but i cannot see where ExtendsAbstractCollection is used. It may not be. I will check. Mike From david.holmes at oracle.com Wed Jul 31 03:12:38 2013 From: david.holmes at oracle.com (David Holmes) Date: Wed, 31 Jul 2013 13:12:38 +1000 Subject: Java 8 RFR 8011194: Apps launched via double-clicked .jars have file.encoding value of US-ASCII on Mac OS X In-Reply-To: <4DB36382-0D2A-492F-8472-C198D2AB1568@apple.com> References: <51F2B781.1050104@oracle.com> <51F5FA02.9020909@oracle.com> <51F6C860.4020000@oracle.com> <51F72EAD.7040201@oracle.com> <8CC8FA32-26C3-47D3-B6A3-33AA4BEC7D12@devrx.org> <4DB36382-0D2A-492F-8472-C198D2AB1568@apple.com> Message-ID: <51F880A6.3070207@oracle.com> If Mike endorses this approach then I step aside. My point, as Scott noted, is that we get this info from the OS. So either the OS is at fault or we're asking the wrong question. Based on Mike's response we're asking the wrong question - but if the end result will be UTF-8 regardless then fine. David On 31/07/2013 8:53 AM, Mike Swingler wrote: > Apple is highly unlikely to change the behavior of nl_langinfo(). > > There is already code in the JDK that calls into JRSCopyPrimaryLanguage(), JRSCopyCanonicalLanguageForPrimaryLanguage(), and JRSSetDefaultLocalization() for exactly this purpose. > > Please proceed with setting the encoding to UTF-8. It is the de-facto standard for every Cocoa application I have ever seen. US-ASCII is always the wrong choice for a graphical app on OS X. > > Regards, > Mike Swingler > Apple Inc. > > On Jul 30, 2013, at 9:05 AM, Francis Devereux wrote: > >> I suspect that Apple might be unlikely to change the value that nl_langinfo returns when LANG is unset. >> >> However, it might be possible to fix this issue without second-guessing the character set reported by the OS by calling [NSLocale currentLocale] (or the CFLocale equivalent) instead of nl_langinfo. I think (although I haven't checked) that that [NSLocale currentLocale] determines the current locale using a mechanism other than environment variables, because LANG is usually be unset for GUI apps on OS X. >> >> On 30 Jul 2013, at 15:56, Scott Palmer wrote: >> >>> Then shouldn't you be complaining to Apple that the value returned by >>> nl_langinfo needs to be changed? >>> David's point seems to be that second guessing the character set reported >>> by the OS is likely to cause a different set of problems. >>> >>> Scott >>> >>> >>> On Tue, Jul 30, 2013 at 10:14 AM, Johannes Schindelin < >>> Johannes.Schindelin at gmx.de> wrote: >>> >>>> Hi, >>>> >>>> On Tue, 30 Jul 2013, David Holmes wrote: >>>> >>>>> On 30/07/2013 5:54 AM, Brent Christian wrote: >>>>>> On 7/28/13 10:13 PM, David Holmes wrote: >>>>>>> On 27/07/2013 3:53 AM, Brent Christian wrote: >>>>>>>> Please review my fix for 8011194 : "Apps launched via >>>> double-clicked >>>>>>>> .jars have file.encoding value of US-ASCII on Mac OS X" >>>>>>>> >>>>>>>> http://bugs.sun.com/view_bug.do?bug_id=8011194 >>>>>>>> >>>>>>>> In most cases of launching a Java app on Mac (from the cmdline, or >>>>>>>> from a native .app bundle), reading and displaying UTF-8 >>>>>>>> characters beyond the standard ASCII range works fine. >>>>>>>> >>>>>>>> A notable exception is the launching of an app by double-clicking >>>>>>>> a .jar file. In this case, file.encoding defaults to US-ASCII, >>>>>>>> and characters outside of the ASCII range show up as garbage. >>>>>>> >>>>>>> Why does this occur? What sets the encoding to US-ASCII? >>>>>> >>>>>> "US-ASCII" is the answer we get from nl_langinfo(CODESET) because no >>>>>> values for LANG/LC* are set in the environment when double-clicking a >>>>>> .jar. >>>>>> >>>>>> We get "UTF-8" when launching from the command line because the >>>>>> default Terminal.app setup on Mac will setup LANG for you (to >>>>>> "en_US.UTF-8" in the US). >>>>> >>>>> Sounds like a user environment error to me. This isn't my area but I'm >>>>> not convinced we should be second guessing what we think the encoding >>>>> should be. >>>> >>>> Except that that is not the case here, of course. The user did *not* set >>>> any environment variable in this case. >>>> >>>> So we are not talking about "second guessing" or "user environment error" >>>> but about a sensible default. >>>> >>>> As to US-ASCII, sorry to say: the seventies called and want their >>>> character set back. >>>> >>>> There can be no question that UTF-8 is the best default character >>>> encoding, or are you even going to question *that*? >>>> >>>>> What if someone intends for it to be US-ASCII? >>>> >>>> Then LANG would not be unset, would it. >>>> >>>> Hth, >>>> Johannes >>>> >>> >> > From paul.sandoz at oracle.com Wed Jul 31 06:54:09 2013 From: paul.sandoz at oracle.com (paul.sandoz at oracle.com) Date: Wed, 31 Jul 2013 06:54:09 +0000 Subject: hg: jdk8/tl/jdk: 8021863: Stream.concat incorrectly calculates unsized state Message-ID: <20130731065435.5AA1748499@hg.openjdk.java.net> Changeset: 76d88a752a03 Author: psandoz Date: 2013-07-30 11:32 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/76d88a752a03 8021863: Stream.concat incorrectly calculates unsized state Reviewed-by: chegar ! src/share/classes/java/util/stream/Streams.java ! test/java/util/stream/test/org/openjdk/tests/java/util/stream/ConcatOpTest.java From paul.sandoz at oracle.com Wed Jul 31 07:10:33 2013 From: paul.sandoz at oracle.com (Paul Sandoz) Date: Wed, 31 Jul 2013 08:10:33 +0100 Subject: RFR: 8021591 : (s) Additional explicit null checks In-Reply-To: References: <17DBA593-2AD1-4E42-8DD1-790511B63B3F@oracle.com> <97903415-01F4-4FE2-B5F8-AFBF54217D32@oracle.com> Message-ID: On Jul 31, 2013, at 12:57 AM, Mike Duigou wrote: >> >> >> - * @throws NullPointerException if a specified key or value is null, >> + * @throws NullPointerException if a specified key or newValue is null, >> * and this map does not permit null keys or values >> + * @throws NullPointerException if oldValue is null and this map does not >> + * permit null values >> + * (optional) >> >> >> More curious than anything else, is it fine to have two declarations of NPE here? > > > Throwing NPE isn't optional if either key or newValue is null and the map does not permit null values. > > This restriction has to be softened for oldValue because the default implementation doesn't test whether oldValue could be added to the map and doesn't know if the map allows null values. > Since that restriction is softened by @implSpec does it need to be propagated to the exception? the implication is that overriding implementations could do the same? > The multiple @throws approach is used as an alternative to a complicated legalistic description in a single throws declaration. It's used uncommonly elsewhere in the JDK. OK. Paul. From paul.sandoz at oracle.com Wed Jul 31 07:14:52 2013 From: paul.sandoz at oracle.com (paul.sandoz at oracle.com) Date: Wed, 31 Jul 2013 07:14:52 +0000 Subject: hg: jdk8/tl/jdk: 8021883: j.u.Random/RandomStream.java test needs more robust timeout duration Message-ID: <20130731071533.EF3144849A@hg.openjdk.java.net> Changeset: d30f357c6050 Author: psandoz Date: 2013-07-30 14:03 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/d30f357c6050 8021883: j.u.Random/RandomStream.java test needs more robust timeout duration Reviewed-by: chegar ! test/java/util/Random/RandomStreamTest.java From peter.levart at gmail.com Wed Jul 31 07:36:32 2013 From: peter.levart at gmail.com (Peter Levart) Date: Wed, 31 Jul 2013 09:36:32 +0200 Subject: Classes on the stack trace In-Reply-To: <50B05474-BD3F-47C7-8412-F0F305E0F0FF@nicholaswilliams.net> References: <51F7AEEE.4040305@gmail.com> <51F7BD75.4030708@gmx.org> <51F7CACD.2070703@gmail.com> <51F7DCD0.1030306@gmx.org> <50B05474-BD3F-47C7-8412-F0F305E0F0FF@nicholaswilliams.net> Message-ID: <51F8BE80.1040005@gmail.com> Hi Nick, The @CallerSensitive annotation is an annotation that prevents some other infrastructure, namely the MethodHandles, to "spoof" caller classes. Try this: MethodHandles.Lookup lookup = MethodHandles.lookup().in(Object.class); MethodHandle mh = lookup.findStatic(Class.class, "forName", MethodType.methodType(Class.class, String.class)); ...you won't be able to pretend that you are the j.l.Object that is calling method Class.forName(String)... The annotation might have (or will have?) other effects like making sure some infrastructure-inserted frames are hidden-away just for @CallerSensitive methods which might be less optimal and not needed for normal methods. Regards, Peter On 07/31/2013 01:11 AM, Nick Williams wrote: > Quick question for those of you that know anything about @CallerSensitive... > > After looking at the code and experimenting some, I've discovered that getCallerClass() doesn't actually keep going until it finds the first method without @CallerSensitive. It only returns the caller of the caller. So, for example: > > Stack 1 > @CallerSensitive Reflection.getCallerClass() > @CallerSensitive MyClass1.method1(); > MyClass2.method2(); > > In this case, getCallerClass() returns MyClass2.class. BUT: > > Stack 2 > @CallerSensitive Reflection.getCallerClass() > @CallerSensitive MyClass1.method1(); > @CallerSensitive MyClass2.method2(); > MyClass3.method3(); > > In this case, getCallerClass() STILL returns MyClass2.class. Based on the plain-language meaning of @CallerSensitive, I would expect getCallerClass() to return MyClass3.class in the second case. But, indeed, the JavaDoc for Reflection.getCallerClass() says: "Returns the class of the caller of the method calling this method." So, then, what's the point of @CallerSensitive? Looking at the code: > > vframeStream vfst(thread); > // Cf. LibraryCallKit::inline_native_Reflection_getCallerClass > for (int n = 0; !vfst.at_end(); vfst.security_next(), n++) { > Method* m = vfst.method(); > assert(m != NULL, "sanity"); > switch (n) { > case 0: > // This must only be called from Reflection.getCallerClass > if (m->intrinsic_id() != vmIntrinsics::_getCallerClass) { > THROW_MSG_NULL(vmSymbols::java_lang_InternalError(), "JVM_GetCallerClass must only be called from Reflection.getCallerClass"); > } > // fall-through > case 1: > // Frame 0 and 1 must be caller sensitive. > if (!m->caller_sensitive()) { > THROW_MSG_NULL(vmSymbols::java_lang_InternalError(), err_msg("CallerSensitive annotation expected at frame %d", n)); > } > break; > default: > if (!m->is_ignored_by_security_stack_walk()) { > // We have reached the desired frame; return the holder class. > return (jclass) JNIHandles::make_local(env, m->method_holder()->java_mirror()); > } > break; > } > } > > It seems to me that @CallerSensitive is completely pointless. This is ALWAYS going to return the first non-reflection frame after frame 1, regardless of @CallerSensitive. If @CallerSensitive were really supposed to have an actual purpose, it would seem to me that the last part should be this: > > if (!m->is_ignored_by_security_stack_walk() && !m->caller_sensitive()) { > // We have reached the desired frame; return the holder class. > return (jclass) JNIHandles::make_local(env, m->method_holder()->java_mirror()); > } > > Am I completely missing the point here? I just don't see a reason for @CallerSensitive. The code could do the exact same thing it currently is without @CallerSensitive (except for enforcing that frame 1 is @CallerSensitive, which really isn't necessary if you aren't using it in further frames). > > Thoughts? > > Nick > > On Jul 30, 2013, at 10:33 AM, Jochen Theodorou wrote: > >> Am 30.07.2013 16:16, schrieb Peter Levart: >>> On 07/30/2013 03:19 PM, Jochen Theodorou wrote: >>>> Am 30.07.2013 14:17, schrieb Peter Levart: >>>> [...] >>>>> So what would give Groovy or other language runtimes headaches when all >>>>> there was was a parameter-less getCallerClass() API? Aren't the >>>>> intermediate frames inserted by those runtimes controlled by the >>>>> runtimes? Couldn't the "surface" runtime-inserted methods capture the >>>>> caller and pass it down? I guess the problem is supporting calling the >>>>> caller-sensitive methods like Class.forName(String) and such which don't >>>>> have the overloaded variant taking caller Class or ClassLoader as an >>>>> argument... >>>> Speaking for Groovy... >>>> those intermediate frames are runtime controlled, yes, but passing down >>>> the caller class is exactly the problem. Imagine I would suggest that >>>> each and every method definition in Java automatically gets an >>>> additional parameter for the caller class, just to have access to it >>>> inside the method. You would not accept that for Java, would you? And so >>>> we cannot accept that for Groovy if we want to keep integration with >>>> Java... >>> Are you talking about internal Groovy implementation (the >>> runtime-inserted methods) or the publicly visible API? >> that's the problem, it is a mix, some internal, other not. We are going to change that in Groovy 3 >> >>> One solution for >>> internal implementation of Groovy could be (speaking by heart since I >>> don't know the internals of Groovy) for the "surface" public API method >>> which doesn't have to have the special caller parameter, to capture the >>> caller with getCallerClass() parameterless API (possibly enclosed with a >>> quick check confirming that it might actually be needed) and bind it to >>> a ThreadLocal, then use this ThreadLocal down at the end... >> confirming that it might actually be needed is a problem. In the old fallback path we don't know what we call until after we are deep in runtime code, and there it is too late. In the other paths we could mark those methods in a @CallerSensitive style and do it in that case only. >> >>>> and the good integration with Java is one of the key points of >>>> Groovy. Even if we make something like that @CallerSensitive and add the >>>> parameter only in those cases, we break being able to override methods. >>> I guess I don't know every Groovy need to obtain the caller class. I >>> thought the problem was to support calling caller-sensitive methods in >>> Java API (like Class.forName(String)) from within Groovy code, where >>> there are runtime-inserted frames between the "call-site" and the target >>> method. Are there any other needs? >> ok, there is a misunderstanding... >> >> if we call a Java implemented method from Groovy, which is using getCallerClass() it may or may not work. In general this does not work and our problem is not about that at all. With the change to let getCallerClass() ignore some reflective frames it will work actually better as long as we use our custom callsite caching implementation, it will not work if indy is used or the fallback path. >> >> To be able to call a method Class#forName(String), we need to "replace" it with an implementation of our own, which we do with an approach similar to extension methods (only that ours can hide existing implementation methods for groovy). And in there we need to get to the caller class >> >> Our problem though is @Grab which is an annotation to add elements to the classpath while running a script. >> >>>> Plus, before Groovy3 is not done we have to support several call paths. >>>> And the oldest one, which is still a fallback, does not support >>>> transporting the caller class through the runtime layers at all. >>>> Changing here is a breaking change. >>> Could you describe those call-paths? Examples of Groovy code and to what >>> it gets translated (equivalent Java code at call site) with a brief >>> description of what each intermediate layer (between the call-site and >>> the target method) does and at which point the caller class is extracted... >> the code generated at the call site depends on several factors actually... The call site code itself is usually not very informative >> >> I start with Groovy 1.0, since that is basically the fallback path. Here this.foo() translates more or less to >> ScriptBytecodeAdapter.invokeMethod0(staticCallerClass, this,"foo") >> which basically does this.getMetaClass().invokeMethod(staticCallerClass, this, "foo"). The problem is that the meta class might be user supplied and the code executed in invokeMethod as well. The invocation is then finally done by reflection. That means we have frames from ScriptBytecodeAdapter, from the meta class, as well as maybe frames from a custom meta class and reflection frames. At the level of ScriptBytecodeAdapter there is a means of transporting the caller class, but that is the static one. Once there is a subclass, this information is different from what is needed here and it cannot simply be exchanged. Even if the bytecode adapter is changed, we cannot change the public API for MetaClass#invokeMethod now. And then the information would be lost. >> >> In later versions of Groovy (since 1.6) we introduced a custom call site caching technique, which uses runtime generated classes to create a helper class per call site and is then used for invocation. At the callsite we basically have something like callsiteArray[i].invoke(..). Here again the staticCallerClass can be found. In this version we are able to "get" the method we want to invoke, before invoking it (bypassing MetaClass#invokeMethod). But to be able to get the method, certain conditions have to be met (like no user supplied meta class). If they are not met, then we do basically the same path as in 1.0, only that we don't use ScriptBytecodeAdapter. Instead We use our CallSite class as entrance point, which then makes the call to the meta class. In the "efficent" case we have now frames from the callsite handling code between the callsite and the target method only. This includes reflection in the first instantiation, later the generated class is used so it reduces to two frames of which one is the Callsite entrance point, the other a frame form the generated method. In the fallback case we have frames from the callsite handling code, plus meta class code, plus reflection of course. Again the fallback case prevents us from transporting the caller information to the target method. If we ignore the fallback case, then we could here maybe use the Threadlocal information. It will require a new callsite interface for the bytecode though, meaning this code will not work for precompiled grovvy of older version, excluding from getting into Groovy 2.1.x, since it would be a breaking change. The earliest version for that would be Groovy 2.2.0, which is almost in RC now. Effectively it would mean we would have to do a 2.3.0 very soon after most probably. >> >> In Groovy 2 we added an indy implementation, which replaces the callsite caching code. At the callsite we have here basically invokedynamic "foo" with IndyInterface#bootstrap. bootstrap will first introduce a target for IndyInterface#selectMethod, since I need the runtime types instead of the static ones. The static caller class information is here part of the bootstrap method as Lookup object, added by invokedynamic itself. After selectMethod is done we have an initial invocation using invokeExact and later invocations by the handle stored in the callsite. Of course the same conditions as for the callsite caching above have to be met, meaning the fallback path might appear. That makes initially one IndyInterface frame, then invokedynamic and lambda related frames, then optionally the traget method, or in the fallback case the meta class frames plus reflection >> >> >> bye Jochen >> >> -- >> Jochen "blackdrag" Theodorou - Groovy Project Tech Lead >> blog: http://blackdragsview.blogspot.com/ >> german groovy discussion newsgroup: de.comp.lang.misc >> For Groovy programming sources visit http://groovy-lang.org >> From vicente.romero at oracle.com Wed Jul 31 09:53:34 2013 From: vicente.romero at oracle.com (vicente.romero at oracle.com) Date: Wed, 31 Jul 2013 09:53:34 +0000 Subject: hg: jdk8/tl/langtools: 8013179: assertion failure in javac when compiling with -source 1.6 -target 1.6 Message-ID: <20130731095340.41BED484A2@hg.openjdk.java.net> Changeset: 7696282873f6 Author: vromero Date: 2013-07-31 10:52 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/7696282873f6 8013179: assertion failure in javac when compiling with -source 1.6 -target 1.6 Reviewed-by: jjg ! src/share/classes/com/sun/tools/javac/comp/TransTypes.java ! src/share/classes/com/sun/tools/javac/resources/compiler.properties + test/tools/javac/diags/examples/MethodInvokedWithWrongNumberOfArgs.java From aleksej.efimov at oracle.com Wed Jul 31 12:15:51 2013 From: aleksej.efimov at oracle.com (Aleksej Efimov) Date: Wed, 31 Jul 2013 16:15:51 +0400 Subject: RFR 8015987: The corba repo contains unneeded .sjava files Message-ID: <51F8FFF7.7030908@oracle.com> Hi, There are unused .sjava files in corba repository which can be deleted. The webrev: http://cr.openjdk.java.net/~aefimov/8015987/webrev.00/ BUG: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8015987 After execution of tests from CORBA SQE test suite - no issues were discovered. This confirms that we can safely delete them. -Aleksej From aleksej.efimov at oracle.com Wed Jul 31 12:18:05 2013 From: aleksej.efimov at oracle.com (Aleksej Efimov) Date: Wed, 31 Jul 2013 16:18:05 +0400 Subject: RFR 8021820: Number of opened files used in select() is limited to 1024 [macosx] Message-ID: <51F9007D.8090801@oracle.com> Hi, Can I have a review for the following problem: The MACOSX JDK (more precisely - the java.net classes) uses the select() system call to wait for different events on sockets fds. And the default behaviour for select() on Darwin is to fail when fdset contains the fd with id greater than FDSET_SIZE(=1024). Test case in webrev illustrates this behavior. There is at least one solution for it: use -D_DARWIN_UNLIMITED_SELECT compilation flag for all macosx sources: this won't affect other parts of JDK because they are not using select(). Currently, I have added this compilation flag to common/autoconf/generated-configure.sh and common/autoconf/generated-configure.sh. I wonder, if there is a better place where I can put this flag? The webrev: http://cr.openjdk.java.net/~aefimov/8021820/webrev.00/ BUG: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8021820 Thanks, -Aleksej From chris.hegarty at oracle.com Wed Jul 31 12:53:59 2013 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Wed, 31 Jul 2013 13:53:59 +0100 Subject: Try to run core libs tests -- All IO tests failing In-Reply-To: <51F82A83.8020903@oracle.com> References: <68C504A0-F6DE-4A4D-B09C-0EC8FF1137AE@nicholaswilliams.net> <51F80198.4050209@oracle.com> <51F8262A.3060809@oracle.com> <77FAF780-7A65-4516-B47E-69FB9EADD426@nicholaswilliams.net> <51F827DD.6060505@oracle.com> <2C77DEF7-8588-41D9-8A5B-CBBE73201440@nicholaswilliams.net> <51F82A83.8020903@oracle.com> Message-ID: <51F908E7.20008@oracle.com> On 30/07/2013 22:05, Jonathan Gibbons wrote: > Bumped the isue to P2, marked it "Affect 8" and added a link to this > thread. Thanks for bringing this back to our attention Jon. I will follow up with the Apple folks to see what system call they are using in their Java6 implementation. I suspect they are using getsockname to determine the local IP address. It may be appropriate for OpenJDK to do the same. >Regarding the hostname, jtreg is executing the following code for all >tests, not just java.io tests > > String hostname; > try { > hostname = >InetAddress.getLocalHost().getCanonicalHostName(); > } catch (UnknownHostException e) { > hostname = "unknown"; > } To be more graceful you could return "localhost" or "127.0.0.1". -Chris. > > -- Jon > > On 07/30/2013 01:57 PM, Nick Williams wrote: >> Ahhh. I know what's going on. >> >> http://blog.leon-rosenberg.net/2012/08/oracle-kills-getlocalhost-on-macos-x-in.html >> >> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7180557 >> >> Maybe someone can fix this year-old Java 7 bug that makes >> getLocalHost() not work sometimes on Mac OS X? :-) >> >> N >> >> On Jul 30, 2013, at 3:53 PM, Jonathan Gibbons wrote: >> >>> Regarding the hostname, jtreg is executing the following code for all >>> tests, not just java.io tests >>> >>> String hostname; >>> try { >>> hostname = InetAddress.getLocalHost().getCanonicalHostName(); >>> } catch (UnknownHostException e) { >>> hostname = "unknown"; >>> } >>> >>> >>> >>> On 07/30/2013 01:50 PM, Nick Williams wrote: >>>> Gotchya. >>>> >>>> I commented out the java.io tests locally for now. >>>> >>>> By the way, I noticed something. Before, when the java.io tests were >>>> failing, the output said "hostname=unknown." However, now that I'm >>>> connected to the VPN and they're passing, the output says >>>> "hostname=10.211.55.2." When I unplug from the ethernet altogether, >>>> the output says "hostname=127.0.0.1." >>>> >>>> Sounds like that has something to do with this weird failure of all >>>> java.io tests. >>>> >>>> N >>>> >>>> On Jul 30, 2013, at 3:46 PM, Jonathan Gibbons wrote: >>>> >>>>> jtreg itself does not "stop on error". If you're driving the tests >>>>> through the makefiles, the makefiles may partition the work into >>>>> separate jtreg runs on separate parts of the test suite. >>>>> >>>>> -- Jon >>>>> >>>>> >>>>> On 07/30/2013 01:13 PM, Nick Williams wrote: >>>>>> Okay, this is indeed very interesting. After two hours it was only >>>>>> about half-way through the java.io tests and all of them had >>>>>> failed so far. On a sheer hunch and nothing more, I unplugged my >>>>>> ethernet cable, thus disconnecting me from any/all networks and >>>>>> the Internet. BOOM. The rest of the java.io tests finished (and >>>>>> passed) in a few seconds, leaving 137 that had failed. I then >>>>>> re-ran the tests while still disconnected from the Internet and >>>>>> 312 of the java.io tests passed this time, leaving only 1 failure >>>>>> (java/io/BufferedReader/Lines.java, output below). >>>>>> >>>>>> I plugged my Ethernet back in and ran the tests again and java.io >>>>>> started failing every test again, timing out after 60 seconds >>>>>> each. Curiously extending my hunch I remained connected over >>>>>> Ethernet and connected to a remote network via OpenVPN. Now all of >>>>>> the java.io test pass again (except that same one, with the same >>>>>> output). >>>>>> >>>>>> What on Earth??? (If it helps, I'm on Mac OS X 10.7.5.) >>>>>> >>>>>> Unfortunately, the one failed java.io test prevents jtreg from >>>>>> continuing on to the next set of tests (java.lang). Anyone know >>>>>> how to tell jtreg to continue running on error? >>>>>> >>>>>> Nick >>>>>> >>>>>> #Test Results (version 2) >>>>>> #Tue Jul 30 14:53:42 CDT 2013 >>>>>> #-----testdescription----- >>>>>> $file=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test/java/io/BufferedReader/Lines.java >>>>>> >>>>>> $root=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test >>>>>> keywords=bug8003258 >>>>>> run=USER_SPECIFIED testng Lines\n >>>>>> source=Lines.java >>>>>> title=\ >>>>>> >>>>>> #-----environment----- >>>>>> >>>>>> #-----testresult----- >>>>>> end=Tue Jul 30 14\:53\:42 CDT 2013 >>>>>> execStatus=Error. Unexpected exception caught from test >>>>>> java/io/BufferedReader/Lines.java\: java.lang.NullPointerException >>>>>> sections=script_messages Details >>>>>> >>>>>> #section:script_messages >>>>>> ----------messages:(0/0)---------- >>>>>> >>>>>> #section:Details >>>>>> ----------messages:(0/0)---------- >>>>>> ----------Stack trace:(10/672)---------- >>>>>> java.lang.NullPointerException >>>>>> at >>>>>> com.sun.javatest.regtest.TestNGReporter.getMatcher(TestNGReporter.java:97) >>>>>> >>>>>> at >>>>>> com.sun.javatest.regtest.TestNGReporter.add(TestNGReporter.java:80) >>>>>> at >>>>>> com.sun.javatest.regtest.TestNGAction.endAction(TestNGAction.java:131) >>>>>> >>>>>> at com.sun.javatest.regtest.MainAction.run(MainAction.java:260) >>>>>> at >>>>>> com.sun.javatest.regtest.RegressionScript.run(RegressionScript.java:149) >>>>>> >>>>>> at com.sun.javatest.Script.run(Script.java:228) >>>>>> at >>>>>> com.sun.javatest.DefaultTestRunner.runTest(DefaultTestRunner.java:174) >>>>>> >>>>>> at >>>>>> com.sun.javatest.DefaultTestRunner.access$100(DefaultTestRunner.java:43) >>>>>> >>>>>> at >>>>>> com.sun.javatest.DefaultTestRunner$1.run(DefaultTestRunner.java:66) >>>>>> result: Not run. Test running... >>>>>> >>>>>> >>>>>> test result: Error. Unexpected exception caught from test >>>>>> java/io/BufferedReader/Lines.java: java.lang.NullPointerException >>>>>> >>>>>> >>>>>> On Jul 30, 2013, at 1:39 PM, Nick Williams wrote: >>>>>> >>>>>>> On Jul 30, 2013, at 1:16 PM, Nick Williams wrote: >>>>>>> >>>>>>>> On Jul 30, 2013, at 1:10 PM, Alan Bateman wrote: >>>>>>>> >>>>>>>>> On 30/07/2013 11:02, Nick Williams wrote: >>>>>>>>>> I'm running the core libs tests locally (for the first time), >>>>>>>>>> and every java.io test is failing. They're all failing for the >>>>>>>>>> same reason (output below), and I suspect it's something local >>>>>>>>>> and not an actual problem. But the test output is not very >>>>>>>>>> helpful. Note that all of the java.beans tests passed with >>>>>>>>>> flying colors. Once it got to java.io, everything started >>>>>>>>>> failing. Worse, each test is taking 60 seconds to fail. I >>>>>>>>>> could be here a while... >>>>>>>>>> >>>>>>>>>> Thoughts? >>>>>>>>> What command are you using? From the output it suggests that >>>>>>>>> the connection between jtreg and the agent VM cannot be >>>>>>>>> established. >>>>>>>>> >>>>>>>>> -Alan. >>>>>>>> Command, just like README-builds.html#testing says: >>>>>>>> >>>>>>>> cd test && make >>>>>>>> PRODUCT_HOME=`pwd`/../build/macosx-x86_64-normal-server-release/images/j2sdk-image/ >>>>>>>> all >>>>>>>> >>>>>>>> I assume this is specifically an java.io-related problem because >>>>>>>> all the java.beans tests passed without exception and so far >>>>>>>> every java.io test through java.io.Externalizable (that's as far >>>>>>>> as it has gotten) has failed without exception. Wouldn't a >>>>>>>> problem with jtreg communicating with the agent VM have shown up >>>>>>>> in java.beans as well? I could be wrong of course. >>>>>>> I see now that java.beans tests run in "othervm mode" while >>>>>>> java.io tests run in "agentvm mode." Didn't realize they were >>>>>>> being run differently. Your explanation makes much more sense >>>>>>> now, but I still don't know what's wrong... >>>>>>> >>>>>>>>>> Here's the output from one of the tests. It looks like all the >>>>>>>>>> other test outputs: >>>>>>>>>> >>>>>>>>>> #Test Results (version 2) >>>>>>>>>> #Tue Jul 30 12:38:15 CDT 2013 >>>>>>>>>> #-----testdescription----- >>>>>>>>>> $file=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test/java/io/BufferedInputStream/ReadAfterClose.java >>>>>>>>>> >>>>>>>>>> $root=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test >>>>>>>>>> >>>>>>>>>> keywords=bug4143651 >>>>>>>>>> run=ASSUMED_ACTION main ReadAfterClose\n >>>>>>>>>> source=ReadAfterClose.java >>>>>>>>>> title=Test if I/O methods will check if the stream has been >>>>>>>>>> closed. >>>>>>>>>> >>>>>>>>>> #-----environment----- >>>>>>>>>> >>>>>>>>>> #-----testresult----- >>>>>>>>>> description=file\:/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test/java/io/BufferedInputStream/ReadAfterClose.java >>>>>>>>>> >>>>>>>>>> elapsed=60007 0\:01\:00.007 >>>>>>>>>> end=Tue Jul 30 12\:38\:15 CDT 2013 >>>>>>>>>> environment=regtest >>>>>>>>>> execStatus=Error. Cannot get VM for test\: >>>>>>>>>> java.net.SocketTimeoutException\: Accept timed out >>>>>>>>>> hostname=unknown >>>>>>>>>> javatestOS=Mac OS X 10.7.5 (x86_64) >>>>>>>>>> javatestVersion=4.4.1 >>>>>>>>>> jtregVersion=jtreg 4.1 dev b00 >>>>>>>>>> script=com.sun.javatest.regtest.RegressionScript >>>>>>>>>> sections=script_messages build compile >>>>>>>>>> start=Tue Jul 30 12\:37\:15 CDT 2013 >>>>>>>>>> test=java/io/BufferedInputStream/ReadAfterClose.java >>>>>>>>>> user.name=Nicholas >>>>>>>>>> work=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/build/macosx-amd64/testoutput/jdk_io/JTwork/java/io/BufferedInputStream >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> #section:script_messages >>>>>>>>>> ----------messages:(5/308)---------- >>>>>>>>>> JDK under test: >>>>>>>>>> (/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/test/../build/macosx-x86_64-normal-server-release/images/j2sdk-image) >>>>>>>>>> >>>>>>>>>> openjdk version "1.8.0-internal" >>>>>>>>>> OpenJDK Runtime Environment (build >>>>>>>>>> 1.8.0-internal-icholas_2013_07_29_21_14-b00) >>>>>>>>>> OpenJDK 64-Bit Server VM (build 25.0-b42, mixed mode) >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> #section:build >>>>>>>>>> ----------messages:(3/100)---------- >>>>>>>>>> command: build ReadAfterClose >>>>>>>>>> reason: Named class compiled on demand >>>>>>>>>> elapsed time (seconds): 60.005 >>>>>>>>>> result: Error. Cannot get VM for test: >>>>>>>>>> java.net.SocketTimeoutException: Accept timed out >>>>>>>>>> >>>>>>>>>> #section:compile >>>>>>>>>> ----------messages:(3/235)---------- >>>>>>>>>> command: compile -XDignore.symbol.file=true >>>>>>>>>> /Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test/java/io/BufferedInputStream/ReadAfterClose.java >>>>>>>>>> >>>>>>>>>> reason: .class file out of date or does not exist >>>>>>>>>> elapsed time (seconds): 60.005 >>>>>>>>>> result: Error. Cannot get VM for test: >>>>>>>>>> java.net.SocketTimeoutException: Accept timed out >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> test result: Error. Cannot get VM for test: >>>>>>>>>> java.net.SocketTimeoutException: Accept timed out >>>>>>>>>> >>> >> > From alexey.utkin at oracle.com Wed Jul 31 12:53:30 2013 From: alexey.utkin at oracle.com (Alexey Utkin) Date: Wed, 31 Jul 2013 16:53:30 +0400 Subject: Review request: JDK-8020191 System.getProperty( " os.name " ) returns " Windows NT (unknown) " on Windows 8.1 Message-ID: <51F908CA.1070502@oracle.com> Bug description: https://jbs.oracle.com/bugs/browse/JDK-8020191 http://bugs.sun.com/view_bug.do?bug_id=8020191 Here is the suggested fix: http://cr.openjdk.java.net/~uta/openjdk-webrevs/JDK-8020191/webrev.00/ Summary: We need to be consistent with the rest of OS, so I extend the case for 6.3 internal version number by values "Windows 8.1" for workstation OS, and "Windows Server 2012 R2" for server OS. (http://msdn.microsoft.com/en-us/library/windows/desktop/dn302074.aspx) But we get a chance to have a wrong OS name due to MS compatibility problems. Here is the problem description: http://social.msdn.microsoft.com/forums/windowsazure/zh-tw/c471de52-611f-435d-ab44-56064e5fd7d5/windows-81-preview-getversionex-reports-629200 and MS respond: http://msdn.microsoft.com/en-us/library/windows/desktop/dn302074.aspx Quotations: "In Windows 8.1 Preview, we have introduced a new API, Versionhelpers API, that deprecates the need for using GetVersion(Ex) APIs. This addresses difficulties in interpreting the numerical value returned by the GetVersion(Ex) APIs." "The internal version number for Windows 8.1 Preview and Windows Server 2012 R2 Preview is 6.3. Only apps that are targeting Windows 8.1 will receive a return value of 6.3. Those apps that are not targeted for Windows 8.1 will receive a return value of 6.2 unless previously shimmed as discussed below." Regards, -uta From nicholas+openjdk at nicholaswilliams.net Wed Jul 31 13:18:07 2013 From: nicholas+openjdk at nicholaswilliams.net (Nick Williams) Date: Wed, 31 Jul 2013 08:18:07 -0500 Subject: Classes on the stack trace In-Reply-To: <51F8BE80.1040005@gmail.com> References: <51F7AEEE.4040305@gmail.com> <51F7BD75.4030708@gmx.org> <51F7CACD.2070703@gmail.com> <51F7DCD0.1030306@gmx.org> <50B05474-BD3F-47C7-8412-F0F305E0F0FF@nicholaswilliams.net> <51F8BE80.1040005@gmail.com> Message-ID: Okay, but I don't think @CallerSensitive is necessary to prevent MethodHandles from spoofing caller classes. I'll admit I don't know very much about MethodHandle, what it does, or how its invocation methods are different from Method.invoke(). In the code that I copied into this email from jvm.cpp last night, the third frame (frame #2) will always be returned unless it is one ignored by the security stack walk. @CallerSensitive doesn't come in to play here. Nick On Jul 31, 2013, at 2:36 AM, Peter Levart wrote: > Hi Nick, > > The @CallerSensitive annotation is an annotation that prevents some other infrastructure, namely the MethodHandles, to "spoof" caller classes. > > Try this: > > MethodHandles.Lookup lookup = MethodHandles.lookup().in(Object.class); > MethodHandle mh = lookup.findStatic(Class.class, "forName", MethodType.methodType(Class.class, String.class)); > > ...you won't be able to pretend that you are the j.l.Object that is calling method Class.forName(String)... > > The annotation might have (or will have?) other effects like making sure some infrastructure-inserted frames are hidden-away just for @CallerSensitive methods which might be less optimal and not needed for normal methods. > > > Regards, Peter > > On 07/31/2013 01:11 AM, Nick Williams wrote: >> Quick question for those of you that know anything about @CallerSensitive... >> >> After looking at the code and experimenting some, I've discovered that getCallerClass() doesn't actually keep going until it finds the first method without @CallerSensitive. It only returns the caller of the caller. So, for example: >> >> Stack 1 >> @CallerSensitive Reflection.getCallerClass() >> @CallerSensitive MyClass1.method1(); >> MyClass2.method2(); >> >> In this case, getCallerClass() returns MyClass2.class. BUT: >> >> Stack 2 >> @CallerSensitive Reflection.getCallerClass() >> @CallerSensitive MyClass1.method1(); >> @CallerSensitive MyClass2.method2(); >> MyClass3.method3(); >> >> In this case, getCallerClass() STILL returns MyClass2.class. Based on the plain-language meaning of @CallerSensitive, I would expect getCallerClass() to return MyClass3.class in the second case. But, indeed, the JavaDoc for Reflection.getCallerClass() says: "Returns the class of the caller of the method calling this method." So, then, what's the point of @CallerSensitive? Looking at the code: >> >> vframeStream vfst(thread); >> // Cf. LibraryCallKit::inline_native_Reflection_getCallerClass >> for (int n = 0; !vfst.at_end(); vfst.security_next(), n++) { >> Method* m = vfst.method(); >> assert(m != NULL, "sanity"); >> switch (n) { >> case 0: >> // This must only be called from Reflection.getCallerClass >> if (m->intrinsic_id() != vmIntrinsics::_getCallerClass) { >> THROW_MSG_NULL(vmSymbols::java_lang_InternalError(), "JVM_GetCallerClass must only be called from Reflection.getCallerClass"); >> } >> // fall-through >> case 1: >> // Frame 0 and 1 must be caller sensitive. >> if (!m->caller_sensitive()) { >> THROW_MSG_NULL(vmSymbols::java_lang_InternalError(), err_msg("CallerSensitive annotation expected at frame %d", n)); >> } >> break; >> default: >> if (!m->is_ignored_by_security_stack_walk()) { >> // We have reached the desired frame; return the holder class. >> return (jclass) JNIHandles::make_local(env, m->method_holder()->java_mirror()); >> } >> break; >> } >> } >> >> It seems to me that @CallerSensitive is completely pointless. This is ALWAYS going to return the first non-reflection frame after frame 1, regardless of @CallerSensitive. If @CallerSensitive were really supposed to have an actual purpose, it would seem to me that the last part should be this: >> >> if (!m->is_ignored_by_security_stack_walk() && !m->caller_sensitive()) { >> // We have reached the desired frame; return the holder class. >> return (jclass) JNIHandles::make_local(env, m->method_holder()->java_mirror()); >> } >> >> Am I completely missing the point here? I just don't see a reason for @CallerSensitive. The code could do the exact same thing it currently is without @CallerSensitive (except for enforcing that frame 1 is @CallerSensitive, which really isn't necessary if you aren't using it in further frames). >> >> Thoughts? >> >> Nick >> >> On Jul 30, 2013, at 10:33 AM, Jochen Theodorou wrote: >> >>> Am 30.07.2013 16:16, schrieb Peter Levart: >>>> On 07/30/2013 03:19 PM, Jochen Theodorou wrote: >>>>> Am 30.07.2013 14:17, schrieb Peter Levart: >>>>> [...] >>>>>> So what would give Groovy or other language runtimes headaches when all >>>>>> there was was a parameter-less getCallerClass() API? Aren't the >>>>>> intermediate frames inserted by those runtimes controlled by the >>>>>> runtimes? Couldn't the "surface" runtime-inserted methods capture the >>>>>> caller and pass it down? I guess the problem is supporting calling the >>>>>> caller-sensitive methods like Class.forName(String) and such which don't >>>>>> have the overloaded variant taking caller Class or ClassLoader as an >>>>>> argument... >>>>> Speaking for Groovy... >>>>> those intermediate frames are runtime controlled, yes, but passing down >>>>> the caller class is exactly the problem. Imagine I would suggest that >>>>> each and every method definition in Java automatically gets an >>>>> additional parameter for the caller class, just to have access to it >>>>> inside the method. You would not accept that for Java, would you? And so >>>>> we cannot accept that for Groovy if we want to keep integration with >>>>> Java... >>>> Are you talking about internal Groovy implementation (the >>>> runtime-inserted methods) or the publicly visible API? >>> that's the problem, it is a mix, some internal, other not. We are going to change that in Groovy 3 >>> >>>> One solution for >>>> internal implementation of Groovy could be (speaking by heart since I >>>> don't know the internals of Groovy) for the "surface" public API method >>>> which doesn't have to have the special caller parameter, to capture the >>>> caller with getCallerClass() parameterless API (possibly enclosed with a >>>> quick check confirming that it might actually be needed) and bind it to >>>> a ThreadLocal, then use this ThreadLocal down at the end... >>> confirming that it might actually be needed is a problem. In the old fallback path we don't know what we call until after we are deep in runtime code, and there it is too late. In the other paths we could mark those methods in a @CallerSensitive style and do it in that case only. >>> >>>>> and the good integration with Java is one of the key points of >>>>> Groovy. Even if we make something like that @CallerSensitive and add the >>>>> parameter only in those cases, we break being able to override methods. >>>> I guess I don't know every Groovy need to obtain the caller class. I >>>> thought the problem was to support calling caller-sensitive methods in >>>> Java API (like Class.forName(String)) from within Groovy code, where >>>> there are runtime-inserted frames between the "call-site" and the target >>>> method. Are there any other needs? >>> ok, there is a misunderstanding... >>> >>> if we call a Java implemented method from Groovy, which is using getCallerClass() it may or may not work. In general this does not work and our problem is not about that at all. With the change to let getCallerClass() ignore some reflective frames it will work actually better as long as we use our custom callsite caching implementation, it will not work if indy is used or the fallback path. >>> >>> To be able to call a method Class#forName(String), we need to "replace" it with an implementation of our own, which we do with an approach similar to extension methods (only that ours can hide existing implementation methods for groovy). And in there we need to get to the caller class >>> >>> Our problem though is @Grab which is an annotation to add elements to the classpath while running a script. >>> >>>>> Plus, before Groovy3 is not done we have to support several call paths. >>>>> And the oldest one, which is still a fallback, does not support >>>>> transporting the caller class through the runtime layers at all. >>>>> Changing here is a breaking change. >>>> Could you describe those call-paths? Examples of Groovy code and to what >>>> it gets translated (equivalent Java code at call site) with a brief >>>> description of what each intermediate layer (between the call-site and >>>> the target method) does and at which point the caller class is extracted... >>> the code generated at the call site depends on several factors actually... The call site code itself is usually not very informative >>> >>> I start with Groovy 1.0, since that is basically the fallback path. Here this.foo() translates more or less to >>> ScriptBytecodeAdapter.invokeMethod0(staticCallerClass, this,"foo") >>> which basically does this.getMetaClass().invokeMethod(staticCallerClass, this, "foo"). The problem is that the meta class might be user supplied and the code executed in invokeMethod as well. The invocation is then finally done by reflection. That means we have frames from ScriptBytecodeAdapter, from the meta class, as well as maybe frames from a custom meta class and reflection frames. At the level of ScriptBytecodeAdapter there is a means of transporting the caller class, but that is the static one. Once there is a subclass, this information is different from what is needed here and it cannot simply be exchanged. Even if the bytecode adapter is changed, we cannot change the public API for MetaClass#invokeMethod now. And then the information would be lost. >>> >>> In later versions of Groovy (since 1.6) we introduced a custom call site caching technique, which uses runtime generated classes to create a helper class per call site and is then used for invocation. At the callsite we basically have something like callsiteArray[i].invoke(..). Here again the staticCallerClass can be found. In this version we are able to "get" the method we want to invoke, before invoking it (bypassing MetaClass#invokeMethod). But to be able to get the method, certain conditions have to be met (like no user supplied meta class). If they are not met, then we do basically the same path as in 1.0, only that we don't use ScriptBytecodeAdapter. Instead We use our CallSite class as entrance point, which then makes the call to the meta class. In the "efficent" case we have now frames from the callsite handling code between the callsite and the target method only. This includes reflection in the first instantiation, later the generated class is used so it reduces to two frame >>> s of which one is the Callsite entrance point, the other a frame form the generated method. In the fallback case we have frames from the callsite handling code, plus meta class code, plus reflection of course. Again the fallback case prevents us from transporting the caller information to the target method. If we ignore the fallback case, then we could here maybe use the Threadlocal information. It will require a new callsite interface for the bytecode though, meaning this code will not work for precompiled grovvy of older version, excluding from getting into Groovy 2.1.x, since it would be a breaking change. The earliest version for that would be Groovy 2.2.0, which is almost in RC now. Effectively it would mean we would have to do a 2.3.0 very soon after most probably. >>> >>> In Groovy 2 we added an indy implementation, which replaces the callsite caching code. At the callsite we have here basically invokedynamic "foo" with IndyInterface#bootstrap. bootstrap will first introduce a target for IndyInterface#selectMethod, since I need the runtime types instead of the static ones. The static caller class information is here part of the bootstrap method as Lookup object, added by invokedynamic itself. After selectMethod is done we have an initial invocation using invokeExact and later invocations by the handle stored in the callsite. Of course the same conditions as for the callsite caching above have to be met, meaning the fallback path might appear. That makes initially one IndyInterface frame, then invokedynamic and lambda related frames, then optionally the traget method, or in the fallback case the meta class frames plus reflection >>> >>> >>> bye Jochen >>> >>> -- >>> Jochen "blackdrag" Theodorou - Groovy Project Tech Lead >>> blog: http://blackdragsview.blogspot.com/ >>> german groovy discussion newsgroup: de.comp.lang.misc >>> For Groovy programming sources visit http://groovy-lang.org >>> > From Alan.Bateman at oracle.com Wed Jul 31 13:45:47 2013 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Wed, 31 Jul 2013 06:45:47 -0700 Subject: RFR 8021820: Number of opened files used in select() is limited to 1024 [macosx] In-Reply-To: <51F9007D.8090801@oracle.com> References: <51F9007D.8090801@oracle.com> Message-ID: <51F9150B.4000008@oracle.com> On 31/07/2013 05:18, Aleksej Efimov wrote: > Hi, > Can I have a review for the following problem: > The MACOSX JDK (more precisely - the java.net classes) uses the > select() system call to wait for different events on sockets fds. And > the default behaviour for select() on Darwin is to fail when fdset > contains the fd with id greater than FDSET_SIZE(=1024). Test case in > webrev illustrates this behavior. > There is at least one solution for it: use -D_DARWIN_UNLIMITED_SELECT > compilation flag for all macosx sources: this won't affect other parts > of JDK because they are not using select(). > Currently, I have added this compilation flag to > common/autoconf/generated-configure.sh and > common/autoconf/generated-configure.sh. I wonder, if there is a better > place where I can put this flag? > > The webrev: http://cr.openjdk.java.net/~aefimov/8021820/webrev.00/ > BUG: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8021820 Thanks for looking into this one. The build changes look okay to me but it's probably best that someone on build-dev agree to those. Michael McMahon can probably explain why the net code is using select for timed read/accept (I have a vague recollection of there being an issue with poll due to the way that it is implemented on kqueue with the result that it had to be changed to use select). I think the test needs re-work. It looks to me that the it attempts to connect to an Oracle internal site so that's not going to work everywhere. In general we don't want the tests to be dependent on hosts that may or may not exist (we had tests that used to this in the past but they caused a lot of grief). It also looks like the test doesn't close the 1023 files that it opens at the start and so I assume this test will always fail on Windows when jtreg tries to clean-up. -Alan. From Alan.Bateman at oracle.com Wed Jul 31 14:15:03 2013 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Wed, 31 Jul 2013 07:15:03 -0700 Subject: Review request: JDK-8020191 System.getProperty( " os.name " ) returns " Windows NT (unknown) " on Windows 8.1 In-Reply-To: <51F908CA.1070502@oracle.com> References: <51F908CA.1070502@oracle.com> Message-ID: <51F91BE7.70403@oracle.com> The changes in the webrev look okay to me but the reference to the "app compatibility shim" in the MS article is a bit confusing and not clear to me (with checking into it more) whether this might consider java.exe as something that isn't targeted to Windows 8.1. So can you verify that you have checked it on the latest 8.1 preview? As regards the helper library then this could be useful in the future (for now then it probably complicates things because the JDK still has to run on older versions of Windows). -Alan. On 31/07/2013 05:53, Alexey Utkin wrote: > Bug description: > https://jbs.oracle.com/bugs/browse/JDK-8020191 > http://bugs.sun.com/view_bug.do?bug_id=8020191 > > Here is the suggested fix: > http://cr.openjdk.java.net/~uta/openjdk-webrevs/JDK-8020191/webrev.00/ > > Summary: > We need to be consistent with the rest of OS, so I extend the case for > 6.3 internal version number by values "Windows 8.1" for workstation > OS, and "Windows Server 2012 R2" for server OS. > (http://msdn.microsoft.com/en-us/library/windows/desktop/dn302074.aspx) > > But we get a chance to have a wrong OS name due to MS compatibility > problems. > > Here is the problem description: > > http://social.msdn.microsoft.com/forums/windowsazure/zh-tw/c471de52-611f-435d-ab44-56064e5fd7d5/windows-81-preview-getversionex-reports-629200 > > > and MS respond: > http://msdn.microsoft.com/en-us/library/windows/desktop/dn302074.aspx > > Quotations: > "In Windows 8.1 Preview, we have introduced a new API, Versionhelpers > API, that deprecates the need for using GetVersion(Ex) APIs. This > addresses difficulties in interpreting the numerical value returned by > the GetVersion(Ex) APIs." > > "The internal version number for Windows 8.1 Preview and Windows > Server 2012 R2 Preview is 6.3. Only apps that are targeting Windows > 8.1 will receive a return value of 6.3. Those apps that are not > targeted for Windows 8.1 will receive a return value of 6.2 unless > previously shimmed as discussed below." > > > Regards, > -uta From Alan.Bateman at oracle.com Wed Jul 31 14:18:19 2013 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Wed, 31 Jul 2013 07:18:19 -0700 Subject: Try to run core libs tests -- All IO tests failing In-Reply-To: <51F908E7.20008@oracle.com> References: <68C504A0-F6DE-4A4D-B09C-0EC8FF1137AE@nicholaswilliams.net> <51F80198.4050209@oracle.com> <51F8262A.3060809@oracle.com> <77FAF780-7A65-4516-B47E-69FB9EADD426@nicholaswilliams.net> <51F827DD.6060505@oracle.com> <2C77DEF7-8588-41D9-8A5B-CBBE73201440@nicholaswilliams.net> <51F82A83.8020903@oracle.com> <51F908E7.20008@oracle.com> Message-ID: <51F91CAB.1030609@oracle.com> On 31/07/2013 05:53, Chris Hegarty wrote: > > Thanks for bringing this back to our attention Jon. I will follow up > with the Apple folks to see what system call they are using in their > Java6 implementation. I suspect they are using getsockname to > determine the local IP address. It may be appropriate for OpenJDK to > do the same. You might want to check with Rob McKenna on this. There were one or two reports previously that he looked into and I think (need to find the mails) that there weren't actually JDK issues but more likely transient or configuration issues. There were a couple of issues related to problems introduced by the Mac port (like changing other platforms to use getaddrinfo) but I thought we were will past all of those at this point. > > >Regarding the hostname, jtreg is executing the following code for all > >tests, not just java.io tests > > > > String hostname; > > try { > > hostname = > >InetAddress.getLocalHost().getCanonicalHostName(); > > } catch (UnknownHostException e) { > > hostname = "unknown"; > > } > > To be more graceful you could return "localhost" or "127.0.0.1". I agree, there are slew of reasons why it may not be possible to get the canonical host name so a fallback to use the loopback would be much better. -Alan. From chris.hegarty at oracle.com Wed Jul 31 14:25:35 2013 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Wed, 31 Jul 2013 15:25:35 +0100 Subject: RFR 8021820: Number of opened files used in select() is limited to 1024 [macosx] In-Reply-To: <51F9150B.4000008@oracle.com> References: <51F9007D.8090801@oracle.com> <51F9150B.4000008@oracle.com> Message-ID: <51F91E5F.2080805@oracle.com> On 31/07/2013 14:45, Alan Bateman wrote: > On 31/07/2013 05:18, Aleksej Efimov wrote: >> Hi, >> Can I have a review for the following problem: >> The MACOSX JDK (more precisely - the java.net classes) uses the >> select() system call to wait for different events on sockets fds. And >> the default behaviour for select() on Darwin is to fail when fdset >> contains the fd with id greater than FDSET_SIZE(=1024). Test case in >> webrev illustrates this behavior. >> There is at least one solution for it: use -D_DARWIN_UNLIMITED_SELECT >> compilation flag for all macosx sources: this won't affect other parts >> of JDK because they are not using select(). >> Currently, I have added this compilation flag to >> common/autoconf/generated-configure.sh and >> common/autoconf/generated-configure.sh. I wonder, if there is a better >> place where I can put this flag? >> >> The webrev: http://cr.openjdk.java.net/~aefimov/8021820/webrev.00/ >> BUG: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8021820 > > Thanks for looking into this one. The build changes look okay to me but Agreed. > it's probably best that someone on build-dev agree to those. Michael > McMahon can probably explain why the net code is using select for timed > read/accept (I have a vague recollection of there being an issue with > poll due to the way that it is implemented on kqueue with the result > that it had to be changed to use select). I don't remember the the specifics either, but that sounds familiar. -Chris. > I think the test needs re-work. It looks to me that the it attempts to > connect to an Oracle internal site so that's not going to work > everywhere. In general we don't want the tests to be dependent on hosts > that may or may not exist (we had tests that used to this in the past > but they caused a lot of grief). It also looks like the test doesn't > close the 1023 files that it opens at the start and so I assume this > test will always fail on Windows when jtreg tries to clean-up. > > -Alan. From chris.hegarty at oracle.com Wed Jul 31 14:44:34 2013 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Wed, 31 Jul 2013 15:44:34 +0100 Subject: Try to run core libs tests -- All IO tests failing In-Reply-To: <51F8262A.3060809@oracle.com> References: <68C504A0-F6DE-4A4D-B09C-0EC8FF1137AE@nicholaswilliams.net> <51F80198.4050209@oracle.com> <51F8262A.3060809@oracle.com> Message-ID: <51F922D2.4030305@oracle.com> I believe if you run the tests from the top-level test/Makefile, not jdk/test/Makefile, all individual test batches ( invocations of jtreg ) get run. -Chris. On 30/07/2013 21:46, Jonathan Gibbons wrote: > > jtreg itself does not "stop on error". If you're driving the tests > through the makefiles, the makefiles may partition the work into > separate jtreg runs on separate parts of the test suite. > > -- Jon > > > On 07/30/2013 01:13 PM, Nick Williams wrote: >> Okay, this is indeed very interesting. After two hours it was only >> about half-way through the java.io tests and all of them had failed so >> far. On a sheer hunch and nothing more, I unplugged my ethernet cable, >> thus disconnecting me from any/all networks and the Internet. BOOM. >> The rest of the java.io tests finished (and passed) in a few seconds, >> leaving 137 that had failed. I then re-ran the tests while still >> disconnected from the Internet and 312 of the java.io tests passed >> this time, leaving only 1 failure (java/io/BufferedReader/Lines.java, >> output below). >> >> I plugged my Ethernet back in and ran the tests again and java.io >> started failing every test again, timing out after 60 seconds each. >> Curiously extending my hunch I remained connected over Ethernet and >> connected to a remote network via OpenVPN. Now all of the java.io test >> pass again (except that same one, with the same output). >> >> What on Earth??? (If it helps, I'm on Mac OS X 10.7.5.) >> >> Unfortunately, the one failed java.io test prevents jtreg from >> continuing on to the next set of tests (java.lang). Anyone know how to >> tell jtreg to continue running on error? >> >> Nick >> >> #Test Results (version 2) >> #Tue Jul 30 14:53:42 CDT 2013 >> #-----testdescription----- >> $file=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test/java/io/BufferedReader/Lines.java >> >> $root=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test >> keywords=bug8003258 >> run=USER_SPECIFIED testng Lines\n >> source=Lines.java >> title=\ >> >> #-----environment----- >> >> #-----testresult----- >> end=Tue Jul 30 14\:53\:42 CDT 2013 >> execStatus=Error. Unexpected exception caught from test >> java/io/BufferedReader/Lines.java\: java.lang.NullPointerException >> sections=script_messages Details >> >> #section:script_messages >> ----------messages:(0/0)---------- >> >> #section:Details >> ----------messages:(0/0)---------- >> ----------Stack trace:(10/672)---------- >> java.lang.NullPointerException >> at >> com.sun.javatest.regtest.TestNGReporter.getMatcher(TestNGReporter.java:97) >> >> at com.sun.javatest.regtest.TestNGReporter.add(TestNGReporter.java:80) >> at com.sun.javatest.regtest.TestNGAction.endAction(TestNGAction.java:131) >> at com.sun.javatest.regtest.MainAction.run(MainAction.java:260) >> at >> com.sun.javatest.regtest.RegressionScript.run(RegressionScript.java:149) >> at com.sun.javatest.Script.run(Script.java:228) >> at com.sun.javatest.DefaultTestRunner.runTest(DefaultTestRunner.java:174) >> at >> com.sun.javatest.DefaultTestRunner.access$100(DefaultTestRunner.java:43) >> at com.sun.javatest.DefaultTestRunner$1.run(DefaultTestRunner.java:66) >> result: Not run. Test running... >> >> >> test result: Error. Unexpected exception caught from test >> java/io/BufferedReader/Lines.java: java.lang.NullPointerException >> >> >> On Jul 30, 2013, at 1:39 PM, Nick Williams wrote: >> >>> On Jul 30, 2013, at 1:16 PM, Nick Williams wrote: >>> >>>> On Jul 30, 2013, at 1:10 PM, Alan Bateman wrote: >>>> >>>>> On 30/07/2013 11:02, Nick Williams wrote: >>>>>> I'm running the core libs tests locally (for the first time), and >>>>>> every java.io test is failing. They're all failing for the same >>>>>> reason (output below), and I suspect it's something local and not >>>>>> an actual problem. But the test output is not very helpful. Note >>>>>> that all of the java.beans tests passed with flying colors. Once >>>>>> it got to java.io, everything started failing. Worse, each test is >>>>>> taking 60 seconds to fail. I could be here a while... >>>>>> >>>>>> Thoughts? >>>>> What command are you using? From the output it suggests that the >>>>> connection between jtreg and the agent VM cannot be established. >>>>> >>>>> -Alan. >>>> Command, just like README-builds.html#testing says: >>>> >>>> cd test && make >>>> PRODUCT_HOME=`pwd`/../build/macosx-x86_64-normal-server-release/images/j2sdk-image/ >>>> all >>>> >>>> I assume this is specifically an java.io-related problem because all >>>> the java.beans tests passed without exception and so far every >>>> java.io test through java.io.Externalizable (that's as far as it has >>>> gotten) has failed without exception. Wouldn't a problem with jtreg >>>> communicating with the agent VM have shown up in java.beans as well? >>>> I could be wrong of course. >>> I see now that java.beans tests run in "othervm mode" while java.io >>> tests run in "agentvm mode." Didn't realize they were being run >>> differently. Your explanation makes much more sense now, but I still >>> don't know what's wrong... >>> >>>>> >>>>>> Here's the output from one of the tests. It looks like all the >>>>>> other test outputs: >>>>>> >>>>>> #Test Results (version 2) >>>>>> #Tue Jul 30 12:38:15 CDT 2013 >>>>>> #-----testdescription----- >>>>>> $file=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test/java/io/BufferedInputStream/ReadAfterClose.java >>>>>> >>>>>> $root=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test >>>>>> keywords=bug4143651 >>>>>> run=ASSUMED_ACTION main ReadAfterClose\n >>>>>> source=ReadAfterClose.java >>>>>> title=Test if I/O methods will check if the stream has been closed. >>>>>> >>>>>> #-----environment----- >>>>>> >>>>>> #-----testresult----- >>>>>> description=file\:/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test/java/io/BufferedInputStream/ReadAfterClose.java >>>>>> >>>>>> elapsed=60007 0\:01\:00.007 >>>>>> end=Tue Jul 30 12\:38\:15 CDT 2013 >>>>>> environment=regtest >>>>>> execStatus=Error. Cannot get VM for test\: >>>>>> java.net.SocketTimeoutException\: Accept timed out >>>>>> hostname=unknown >>>>>> javatestOS=Mac OS X 10.7.5 (x86_64) >>>>>> javatestVersion=4.4.1 >>>>>> jtregVersion=jtreg 4.1 dev b00 >>>>>> script=com.sun.javatest.regtest.RegressionScript >>>>>> sections=script_messages build compile >>>>>> start=Tue Jul 30 12\:37\:15 CDT 2013 >>>>>> test=java/io/BufferedInputStream/ReadAfterClose.java >>>>>> user.name=Nicholas >>>>>> work=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/build/macosx-amd64/testoutput/jdk_io/JTwork/java/io/BufferedInputStream >>>>>> >>>>>> >>>>>> #section:script_messages >>>>>> ----------messages:(5/308)---------- >>>>>> JDK under test: >>>>>> (/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/test/../build/macosx-x86_64-normal-server-release/images/j2sdk-image) >>>>>> >>>>>> openjdk version "1.8.0-internal" >>>>>> OpenJDK Runtime Environment (build >>>>>> 1.8.0-internal-icholas_2013_07_29_21_14-b00) >>>>>> OpenJDK 64-Bit Server VM (build 25.0-b42, mixed mode) >>>>>> >>>>>> >>>>>> #section:build >>>>>> ----------messages:(3/100)---------- >>>>>> command: build ReadAfterClose >>>>>> reason: Named class compiled on demand >>>>>> elapsed time (seconds): 60.005 >>>>>> result: Error. Cannot get VM for test: >>>>>> java.net.SocketTimeoutException: Accept timed out >>>>>> >>>>>> #section:compile >>>>>> ----------messages:(3/235)---------- >>>>>> command: compile -XDignore.symbol.file=true >>>>>> /Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test/java/io/BufferedInputStream/ReadAfterClose.java >>>>>> >>>>>> reason: .class file out of date or does not exist >>>>>> elapsed time (seconds): 60.005 >>>>>> result: Error. Cannot get VM for test: >>>>>> java.net.SocketTimeoutException: Accept timed out >>>>>> >>>>>> >>>>>> test result: Error. Cannot get VM for test: >>>>>> java.net.SocketTimeoutException: Accept timed out >>>>>> > From chris.hegarty at oracle.com Wed Jul 31 14:46:02 2013 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Wed, 31 Jul 2013 15:46:02 +0100 Subject: RFR 8015987: The corba repo contains unneeded .sjava files In-Reply-To: <51F8FFF7.7030908@oracle.com> References: <51F8FFF7.7030908@oracle.com> Message-ID: <51F9232A.2020100@oracle.com> OK for me. -Chris. On 31/07/2013 13:15, Aleksej Efimov wrote: > Hi, > > There are unused .sjava files in corba repository which can be deleted. > The webrev: http://cr.openjdk.java.net/~aefimov/8015987/webrev.00/ > > BUG: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8015987 > > After execution of tests from CORBA SQE test suite - no issues were > discovered. This confirms that we can safely delete them. > > -Aleksej From nicholas+openjdk at nicholaswilliams.net Wed Jul 31 14:49:02 2013 From: nicholas+openjdk at nicholaswilliams.net (Nick Williams) Date: Wed, 31 Jul 2013 09:49:02 -0500 Subject: Try to run core libs tests -- All IO tests failing In-Reply-To: <51F922D2.4030305@oracle.com> References: <68C504A0-F6DE-4A4D-B09C-0EC8FF1137AE@nicholaswilliams.net> <51F80198.4050209@oracle.com> <51F8262A.3060809@oracle.com> <51F922D2.4030305@oracle.com> Message-ID: That's how I'm running it. $ pwd /foo/bar/jdk8/jdk8 $ cd test $ make PRODUCT_HOME=`pwd`/../build/macosx-x86_64-normal-server-release/images/j2sdk-image/ all If one test fails in a batch, none of the following batches run. So if one test fails in java.io, java.lang won't run. Makes it difficult to run all of the tests, especial since there are two tests in java.lang (ThreadLocalSupplierTests due to java.lang.VerifyError: Bad local variable type, and DefaultMethodModeling due to java.lang.NullPointerException at java.util.Objects.requireNonNull when checking class B) that fail consistently (on Mac OS X at least) that I haven't been able to solve by identifying issues with the testing environment. Nick On Jul 31, 2013, at 9:44 AM, Chris Hegarty wrote: > I believe if you run the tests from the top-level test/Makefile, not jdk/test/Makefile, all individual test batches ( invocations of jtreg ) get run. > > -Chris. > > On 30/07/2013 21:46, Jonathan Gibbons wrote: >> >> jtreg itself does not "stop on error". If you're driving the tests >> through the makefiles, the makefiles may partition the work into >> separate jtreg runs on separate parts of the test suite. >> >> -- Jon >> >> >> On 07/30/2013 01:13 PM, Nick Williams wrote: >>> Okay, this is indeed very interesting. After two hours it was only >>> about half-way through the java.io tests and all of them had failed so >>> far. On a sheer hunch and nothing more, I unplugged my ethernet cable, >>> thus disconnecting me from any/all networks and the Internet. BOOM. >>> The rest of the java.io tests finished (and passed) in a few seconds, >>> leaving 137 that had failed. I then re-ran the tests while still >>> disconnected from the Internet and 312 of the java.io tests passed >>> this time, leaving only 1 failure (java/io/BufferedReader/Lines.java, >>> output below). >>> >>> I plugged my Ethernet back in and ran the tests again and java.io >>> started failing every test again, timing out after 60 seconds each. >>> Curiously extending my hunch I remained connected over Ethernet and >>> connected to a remote network via OpenVPN. Now all of the java.io test >>> pass again (except that same one, with the same output). >>> >>> What on Earth??? (If it helps, I'm on Mac OS X 10.7.5.) >>> >>> Unfortunately, the one failed java.io test prevents jtreg from >>> continuing on to the next set of tests (java.lang). Anyone know how to >>> tell jtreg to continue running on error? >>> >>> Nick >>> >>> #Test Results (version 2) >>> #Tue Jul 30 14:53:42 CDT 2013 >>> #-----testdescription----- >>> $file=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test/java/io/BufferedReader/Lines.java >>> >>> $root=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test >>> keywords=bug8003258 >>> run=USER_SPECIFIED testng Lines\n >>> source=Lines.java >>> title=\ >>> >>> #-----environment----- >>> >>> #-----testresult----- >>> end=Tue Jul 30 14\:53\:42 CDT 2013 >>> execStatus=Error. Unexpected exception caught from test >>> java/io/BufferedReader/Lines.java\: java.lang.NullPointerException >>> sections=script_messages Details >>> >>> #section:script_messages >>> ----------messages:(0/0)---------- >>> >>> #section:Details >>> ----------messages:(0/0)---------- >>> ----------Stack trace:(10/672)---------- >>> java.lang.NullPointerException >>> at >>> com.sun.javatest.regtest.TestNGReporter.getMatcher(TestNGReporter.java:97) >>> >>> at com.sun.javatest.regtest.TestNGReporter.add(TestNGReporter.java:80) >>> at com.sun.javatest.regtest.TestNGAction.endAction(TestNGAction.java:131) >>> at com.sun.javatest.regtest.MainAction.run(MainAction.java:260) >>> at >>> com.sun.javatest.regtest.RegressionScript.run(RegressionScript.java:149) >>> at com.sun.javatest.Script.run(Script.java:228) >>> at com.sun.javatest.DefaultTestRunner.runTest(DefaultTestRunner.java:174) >>> at >>> com.sun.javatest.DefaultTestRunner.access$100(DefaultTestRunner.java:43) >>> at com.sun.javatest.DefaultTestRunner$1.run(DefaultTestRunner.java:66) >>> result: Not run. Test running... >>> >>> >>> test result: Error. Unexpected exception caught from test >>> java/io/BufferedReader/Lines.java: java.lang.NullPointerException >>> >>> >>> On Jul 30, 2013, at 1:39 PM, Nick Williams wrote: >>> >>>> On Jul 30, 2013, at 1:16 PM, Nick Williams wrote: >>>> >>>>> On Jul 30, 2013, at 1:10 PM, Alan Bateman wrote: >>>>> >>>>>> On 30/07/2013 11:02, Nick Williams wrote: >>>>>>> I'm running the core libs tests locally (for the first time), and >>>>>>> every java.io test is failing. They're all failing for the same >>>>>>> reason (output below), and I suspect it's something local and not >>>>>>> an actual problem. But the test output is not very helpful. Note >>>>>>> that all of the java.beans tests passed with flying colors. Once >>>>>>> it got to java.io, everything started failing. Worse, each test is >>>>>>> taking 60 seconds to fail. I could be here a while... >>>>>>> >>>>>>> Thoughts? >>>>>> What command are you using? From the output it suggests that the >>>>>> connection between jtreg and the agent VM cannot be established. >>>>>> >>>>>> -Alan. >>>>> Command, just like README-builds.html#testing says: >>>>> >>>>> cd test && make >>>>> PRODUCT_HOME=`pwd`/../build/macosx-x86_64-normal-server-release/images/j2sdk-image/ >>>>> all >>>>> >>>>> I assume this is specifically an java.io-related problem because all >>>>> the java.beans tests passed without exception and so far every >>>>> java.io test through java.io.Externalizable (that's as far as it has >>>>> gotten) has failed without exception. Wouldn't a problem with jtreg >>>>> communicating with the agent VM have shown up in java.beans as well? >>>>> I could be wrong of course. >>>> I see now that java.beans tests run in "othervm mode" while java.io >>>> tests run in "agentvm mode." Didn't realize they were being run >>>> differently. Your explanation makes much more sense now, but I still >>>> don't know what's wrong... >>>> >>>>>> >>>>>>> Here's the output from one of the tests. It looks like all the >>>>>>> other test outputs: >>>>>>> >>>>>>> #Test Results (version 2) >>>>>>> #Tue Jul 30 12:38:15 CDT 2013 >>>>>>> #-----testdescription----- >>>>>>> $file=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test/java/io/BufferedInputStream/ReadAfterClose.java >>>>>>> >>>>>>> $root=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test >>>>>>> keywords=bug4143651 >>>>>>> run=ASSUMED_ACTION main ReadAfterClose\n >>>>>>> source=ReadAfterClose.java >>>>>>> title=Test if I/O methods will check if the stream has been closed. >>>>>>> >>>>>>> #-----environment----- >>>>>>> >>>>>>> #-----testresult----- >>>>>>> description=file\:/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test/java/io/BufferedInputStream/ReadAfterClose.java >>>>>>> >>>>>>> elapsed=60007 0\:01\:00.007 >>>>>>> end=Tue Jul 30 12\:38\:15 CDT 2013 >>>>>>> environment=regtest >>>>>>> execStatus=Error. Cannot get VM for test\: >>>>>>> java.net.SocketTimeoutException\: Accept timed out >>>>>>> hostname=unknown >>>>>>> javatestOS=Mac OS X 10.7.5 (x86_64) >>>>>>> javatestVersion=4.4.1 >>>>>>> jtregVersion=jtreg 4.1 dev b00 >>>>>>> script=com.sun.javatest.regtest.RegressionScript >>>>>>> sections=script_messages build compile >>>>>>> start=Tue Jul 30 12\:37\:15 CDT 2013 >>>>>>> test=java/io/BufferedInputStream/ReadAfterClose.java >>>>>>> user.name=Nicholas >>>>>>> work=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/build/macosx-amd64/testoutput/jdk_io/JTwork/java/io/BufferedInputStream >>>>>>> >>>>>>> >>>>>>> #section:script_messages >>>>>>> ----------messages:(5/308)---------- >>>>>>> JDK under test: >>>>>>> (/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/test/../build/macosx-x86_64-normal-server-release/images/j2sdk-image) >>>>>>> >>>>>>> openjdk version "1.8.0-internal" >>>>>>> OpenJDK Runtime Environment (build >>>>>>> 1.8.0-internal-icholas_2013_07_29_21_14-b00) >>>>>>> OpenJDK 64-Bit Server VM (build 25.0-b42, mixed mode) >>>>>>> >>>>>>> >>>>>>> #section:build >>>>>>> ----------messages:(3/100)---------- >>>>>>> command: build ReadAfterClose >>>>>>> reason: Named class compiled on demand >>>>>>> elapsed time (seconds): 60.005 >>>>>>> result: Error. Cannot get VM for test: >>>>>>> java.net.SocketTimeoutException: Accept timed out >>>>>>> >>>>>>> #section:compile >>>>>>> ----------messages:(3/235)---------- >>>>>>> command: compile -XDignore.symbol.file=true >>>>>>> /Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test/java/io/BufferedInputStream/ReadAfterClose.java >>>>>>> >>>>>>> reason: .class file out of date or does not exist >>>>>>> elapsed time (seconds): 60.005 >>>>>>> result: Error. Cannot get VM for test: >>>>>>> java.net.SocketTimeoutException: Accept timed out >>>>>>> >>>>>>> >>>>>>> test result: Error. Cannot get VM for test: >>>>>>> java.net.SocketTimeoutException: Accept timed out >>>>>>> >> From jonathan.gibbons at oracle.com Wed Jul 31 14:56:03 2013 From: jonathan.gibbons at oracle.com (Jonathan Gibbons) Date: Wed, 31 Jul 2013 07:56:03 -0700 Subject: Try to run core libs tests -- All IO tests failing In-Reply-To: References: <68C504A0-F6DE-4A4D-B09C-0EC8FF1137AE@nicholaswilliams.net> <51F80198.4050209@oracle.com> <51F8262A.3060809@oracle.com> <51F922D2.4030305@oracle.com> Message-ID: <51F92583.2080706@oracle.com> Nick, A *workaround* for this problem would be to locally edit the names of the problem tests into jdk/test/ProblemList.txt so that they are not run. There is general work underway to improve/simplify the Makefile support for jtreg, that should address this problem. -- Jon On 07/31/2013 07:49 AM, Nick Williams wrote: > That's how I'm running it. > > $ pwd > /foo/bar/jdk8/jdk8 > $ cd test > $ make PRODUCT_HOME=`pwd`/../build/macosx-x86_64-normal-server-release/images/j2sdk-image/ all > > If one test fails in a batch, none of the following batches run. So if one test fails in java.io, java.lang won't run. Makes it difficult to run all of the tests, especial since there are two tests in java.lang (ThreadLocalSupplierTests due to java.lang.VerifyError: Bad local variable type, and DefaultMethodModeling due to java.lang.NullPointerException at java.util.Objects.requireNonNull when checking class B) that fail consistently (on Mac OS X at least) that I haven't been able to solve by identifying issues with the testing environment. > > Nick > > On Jul 31, 2013, at 9:44 AM, Chris Hegarty wrote: > >> I believe if you run the tests from the top-level test/Makefile, not jdk/test/Makefile, all individual test batches ( invocations of jtreg ) get run. >> >> -Chris. >> >> On 30/07/2013 21:46, Jonathan Gibbons wrote: >>> jtreg itself does not "stop on error". If you're driving the tests >>> through the makefiles, the makefiles may partition the work into >>> separate jtreg runs on separate parts of the test suite. >>> >>> -- Jon >>> >>> >>> On 07/30/2013 01:13 PM, Nick Williams wrote: >>>> Okay, this is indeed very interesting. After two hours it was only >>>> about half-way through the java.io tests and all of them had failed so >>>> far. On a sheer hunch and nothing more, I unplugged my ethernet cable, >>>> thus disconnecting me from any/all networks and the Internet. BOOM. >>>> The rest of the java.io tests finished (and passed) in a few seconds, >>>> leaving 137 that had failed. I then re-ran the tests while still >>>> disconnected from the Internet and 312 of the java.io tests passed >>>> this time, leaving only 1 failure (java/io/BufferedReader/Lines.java, >>>> output below). >>>> >>>> I plugged my Ethernet back in and ran the tests again and java.io >>>> started failing every test again, timing out after 60 seconds each. >>>> Curiously extending my hunch I remained connected over Ethernet and >>>> connected to a remote network via OpenVPN. Now all of the java.io test >>>> pass again (except that same one, with the same output). >>>> >>>> What on Earth??? (If it helps, I'm on Mac OS X 10.7.5.) >>>> >>>> Unfortunately, the one failed java.io test prevents jtreg from >>>> continuing on to the next set of tests (java.lang). Anyone know how to >>>> tell jtreg to continue running on error? >>>> >>>> Nick >>>> >>>> #Test Results (version 2) >>>> #Tue Jul 30 14:53:42 CDT 2013 >>>> #-----testdescription----- >>>> $file=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test/java/io/BufferedReader/Lines.java >>>> >>>> $root=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test >>>> keywords=bug8003258 >>>> run=USER_SPECIFIED testng Lines\n >>>> source=Lines.java >>>> title=\ >>>> >>>> #-----environment----- >>>> >>>> #-----testresult----- >>>> end=Tue Jul 30 14\:53\:42 CDT 2013 >>>> execStatus=Error. Unexpected exception caught from test >>>> java/io/BufferedReader/Lines.java\: java.lang.NullPointerException >>>> sections=script_messages Details >>>> >>>> #section:script_messages >>>> ----------messages:(0/0)---------- >>>> >>>> #section:Details >>>> ----------messages:(0/0)---------- >>>> ----------Stack trace:(10/672)---------- >>>> java.lang.NullPointerException >>>> at >>>> com.sun.javatest.regtest.TestNGReporter.getMatcher(TestNGReporter.java:97) >>>> >>>> at com.sun.javatest.regtest.TestNGReporter.add(TestNGReporter.java:80) >>>> at com.sun.javatest.regtest.TestNGAction.endAction(TestNGAction.java:131) >>>> at com.sun.javatest.regtest.MainAction.run(MainAction.java:260) >>>> at >>>> com.sun.javatest.regtest.RegressionScript.run(RegressionScript.java:149) >>>> at com.sun.javatest.Script.run(Script.java:228) >>>> at com.sun.javatest.DefaultTestRunner.runTest(DefaultTestRunner.java:174) >>>> at >>>> com.sun.javatest.DefaultTestRunner.access$100(DefaultTestRunner.java:43) >>>> at com.sun.javatest.DefaultTestRunner$1.run(DefaultTestRunner.java:66) >>>> result: Not run. Test running... >>>> >>>> >>>> test result: Error. Unexpected exception caught from test >>>> java/io/BufferedReader/Lines.java: java.lang.NullPointerException >>>> >>>> >>>> On Jul 30, 2013, at 1:39 PM, Nick Williams wrote: >>>> >>>>> On Jul 30, 2013, at 1:16 PM, Nick Williams wrote: >>>>> >>>>>> On Jul 30, 2013, at 1:10 PM, Alan Bateman wrote: >>>>>> >>>>>>> On 30/07/2013 11:02, Nick Williams wrote: >>>>>>>> I'm running the core libs tests locally (for the first time), and >>>>>>>> every java.io test is failing. They're all failing for the same >>>>>>>> reason (output below), and I suspect it's something local and not >>>>>>>> an actual problem. But the test output is not very helpful. Note >>>>>>>> that all of the java.beans tests passed with flying colors. Once >>>>>>>> it got to java.io, everything started failing. Worse, each test is >>>>>>>> taking 60 seconds to fail. I could be here a while... >>>>>>>> >>>>>>>> Thoughts? >>>>>>> What command are you using? From the output it suggests that the >>>>>>> connection between jtreg and the agent VM cannot be established. >>>>>>> >>>>>>> -Alan. >>>>>> Command, just like README-builds.html#testing says: >>>>>> >>>>>> cd test && make >>>>>> PRODUCT_HOME=`pwd`/../build/macosx-x86_64-normal-server-release/images/j2sdk-image/ >>>>>> all >>>>>> >>>>>> I assume this is specifically an java.io-related problem because all >>>>>> the java.beans tests passed without exception and so far every >>>>>> java.io test through java.io.Externalizable (that's as far as it has >>>>>> gotten) has failed without exception. Wouldn't a problem with jtreg >>>>>> communicating with the agent VM have shown up in java.beans as well? >>>>>> I could be wrong of course. >>>>> I see now that java.beans tests run in "othervm mode" while java.io >>>>> tests run in "agentvm mode." Didn't realize they were being run >>>>> differently. Your explanation makes much more sense now, but I still >>>>> don't know what's wrong... >>>>> >>>>>>>> Here's the output from one of the tests. It looks like all the >>>>>>>> other test outputs: >>>>>>>> >>>>>>>> #Test Results (version 2) >>>>>>>> #Tue Jul 30 12:38:15 CDT 2013 >>>>>>>> #-----testdescription----- >>>>>>>> $file=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test/java/io/BufferedInputStream/ReadAfterClose.java >>>>>>>> >>>>>>>> $root=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test >>>>>>>> keywords=bug4143651 >>>>>>>> run=ASSUMED_ACTION main ReadAfterClose\n >>>>>>>> source=ReadAfterClose.java >>>>>>>> title=Test if I/O methods will check if the stream has been closed. >>>>>>>> >>>>>>>> #-----environment----- >>>>>>>> >>>>>>>> #-----testresult----- >>>>>>>> description=file\:/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test/java/io/BufferedInputStream/ReadAfterClose.java >>>>>>>> >>>>>>>> elapsed=60007 0\:01\:00.007 >>>>>>>> end=Tue Jul 30 12\:38\:15 CDT 2013 >>>>>>>> environment=regtest >>>>>>>> execStatus=Error. Cannot get VM for test\: >>>>>>>> java.net.SocketTimeoutException\: Accept timed out >>>>>>>> hostname=unknown >>>>>>>> javatestOS=Mac OS X 10.7.5 (x86_64) >>>>>>>> javatestVersion=4.4.1 >>>>>>>> jtregVersion=jtreg 4.1 dev b00 >>>>>>>> script=com.sun.javatest.regtest.RegressionScript >>>>>>>> sections=script_messages build compile >>>>>>>> start=Tue Jul 30 12\:37\:15 CDT 2013 >>>>>>>> test=java/io/BufferedInputStream/ReadAfterClose.java >>>>>>>> user.name=Nicholas >>>>>>>> work=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/build/macosx-amd64/testoutput/jdk_io/JTwork/java/io/BufferedInputStream >>>>>>>> >>>>>>>> >>>>>>>> #section:script_messages >>>>>>>> ----------messages:(5/308)---------- >>>>>>>> JDK under test: >>>>>>>> (/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/test/../build/macosx-x86_64-normal-server-release/images/j2sdk-image) >>>>>>>> >>>>>>>> openjdk version "1.8.0-internal" >>>>>>>> OpenJDK Runtime Environment (build >>>>>>>> 1.8.0-internal-icholas_2013_07_29_21_14-b00) >>>>>>>> OpenJDK 64-Bit Server VM (build 25.0-b42, mixed mode) >>>>>>>> >>>>>>>> >>>>>>>> #section:build >>>>>>>> ----------messages:(3/100)---------- >>>>>>>> command: build ReadAfterClose >>>>>>>> reason: Named class compiled on demand >>>>>>>> elapsed time (seconds): 60.005 >>>>>>>> result: Error. Cannot get VM for test: >>>>>>>> java.net.SocketTimeoutException: Accept timed out >>>>>>>> >>>>>>>> #section:compile >>>>>>>> ----------messages:(3/235)---------- >>>>>>>> command: compile -XDignore.symbol.file=true >>>>>>>> /Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test/java/io/BufferedInputStream/ReadAfterClose.java >>>>>>>> >>>>>>>> reason: .class file out of date or does not exist >>>>>>>> elapsed time (seconds): 60.005 >>>>>>>> result: Error. Cannot get VM for test: >>>>>>>> java.net.SocketTimeoutException: Accept timed out >>>>>>>> >>>>>>>> >>>>>>>> test result: Error. Cannot get VM for test: >>>>>>>> java.net.SocketTimeoutException: Accept timed out >>>>>>>> From nicholas+openjdk at nicholaswilliams.net Wed Jul 31 14:58:05 2013 From: nicholas+openjdk at nicholaswilliams.net (Nick Williams) Date: Wed, 31 Jul 2013 09:58:05 -0500 Subject: Try to run core libs tests -- All IO tests failing In-Reply-To: <51F92583.2080706@oracle.com> References: <68C504A0-F6DE-4A4D-B09C-0EC8FF1137AE@nicholaswilliams.net> <51F80198.4050209@oracle.com> <51F8262A.3060809@oracle.com> <51F922D2.4030305@oracle.com> <51F92583.2080706@oracle.com> Message-ID: <44EB4BAF-7699-4E08-9D93-74C60F19676F@nicholaswilliams.net> Yea, I've been working around it by running the modules one at a time. It's just a pain, that's all. N On Jul 31, 2013, at 9:56 AM, Jonathan Gibbons wrote: > Nick, > > A *workaround* for this problem would be to locally edit the names of the problem tests into jdk/test/ProblemList.txt so that they are not run. > > There is general work underway to improve/simplify the Makefile support for jtreg, that should address this problem. > > -- Jon > > On 07/31/2013 07:49 AM, Nick Williams wrote: >> That's how I'm running it. >> >> $ pwd >> /foo/bar/jdk8/jdk8 >> $ cd test >> $ make PRODUCT_HOME=`pwd`/../build/macosx-x86_64-normal-server-release/images/j2sdk-image/ all >> >> If one test fails in a batch, none of the following batches run. So if one test fails in java.io, java.lang won't run. Makes it difficult to run all of the tests, especial since there are two tests in java.lang (ThreadLocalSupplierTests due to java.lang.VerifyError: Bad local variable type, and DefaultMethodModeling due to java.lang.NullPointerException at java.util.Objects.requireNonNull when checking class B) that fail consistently (on Mac OS X at least) that I haven't been able to solve by identifying issues with the testing environment. >> >> Nick >> >> On Jul 31, 2013, at 9:44 AM, Chris Hegarty wrote: >> >>> I believe if you run the tests from the top-level test/Makefile, not jdk/test/Makefile, all individual test batches ( invocations of jtreg ) get run. >>> >>> -Chris. >>> >>> On 30/07/2013 21:46, Jonathan Gibbons wrote: >>>> jtreg itself does not "stop on error". If you're driving the tests >>>> through the makefiles, the makefiles may partition the work into >>>> separate jtreg runs on separate parts of the test suite. >>>> >>>> -- Jon >>>> >>>> >>>> On 07/30/2013 01:13 PM, Nick Williams wrote: >>>>> Okay, this is indeed very interesting. After two hours it was only >>>>> about half-way through the java.io tests and all of them had failed so >>>>> far. On a sheer hunch and nothing more, I unplugged my ethernet cable, >>>>> thus disconnecting me from any/all networks and the Internet. BOOM. >>>>> The rest of the java.io tests finished (and passed) in a few seconds, >>>>> leaving 137 that had failed. I then re-ran the tests while still >>>>> disconnected from the Internet and 312 of the java.io tests passed >>>>> this time, leaving only 1 failure (java/io/BufferedReader/Lines.java, >>>>> output below). >>>>> >>>>> I plugged my Ethernet back in and ran the tests again and java.io >>>>> started failing every test again, timing out after 60 seconds each. >>>>> Curiously extending my hunch I remained connected over Ethernet and >>>>> connected to a remote network via OpenVPN. Now all of the java.io test >>>>> pass again (except that same one, with the same output). >>>>> >>>>> What on Earth??? (If it helps, I'm on Mac OS X 10.7.5.) >>>>> >>>>> Unfortunately, the one failed java.io test prevents jtreg from >>>>> continuing on to the next set of tests (java.lang). Anyone know how to >>>>> tell jtreg to continue running on error? >>>>> >>>>> Nick >>>>> >>>>> #Test Results (version 2) >>>>> #Tue Jul 30 14:53:42 CDT 2013 >>>>> #-----testdescription----- >>>>> $file=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test/java/io/BufferedReader/Lines.java >>>>> >>>>> $root=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test >>>>> keywords=bug8003258 >>>>> run=USER_SPECIFIED testng Lines\n >>>>> source=Lines.java >>>>> title=\ >>>>> >>>>> #-----environment----- >>>>> >>>>> #-----testresult----- >>>>> end=Tue Jul 30 14\:53\:42 CDT 2013 >>>>> execStatus=Error. Unexpected exception caught from test >>>>> java/io/BufferedReader/Lines.java\: java.lang.NullPointerException >>>>> sections=script_messages Details >>>>> >>>>> #section:script_messages >>>>> ----------messages:(0/0)---------- >>>>> >>>>> #section:Details >>>>> ----------messages:(0/0)---------- >>>>> ----------Stack trace:(10/672)---------- >>>>> java.lang.NullPointerException >>>>> at >>>>> com.sun.javatest.regtest.TestNGReporter.getMatcher(TestNGReporter.java:97) >>>>> >>>>> at com.sun.javatest.regtest.TestNGReporter.add(TestNGReporter.java:80) >>>>> at com.sun.javatest.regtest.TestNGAction.endAction(TestNGAction.java:131) >>>>> at com.sun.javatest.regtest.MainAction.run(MainAction.java:260) >>>>> at >>>>> com.sun.javatest.regtest.RegressionScript.run(RegressionScript.java:149) >>>>> at com.sun.javatest.Script.run(Script.java:228) >>>>> at com.sun.javatest.DefaultTestRunner.runTest(DefaultTestRunner.java:174) >>>>> at >>>>> com.sun.javatest.DefaultTestRunner.access$100(DefaultTestRunner.java:43) >>>>> at com.sun.javatest.DefaultTestRunner$1.run(DefaultTestRunner.java:66) >>>>> result: Not run. Test running... >>>>> >>>>> >>>>> test result: Error. Unexpected exception caught from test >>>>> java/io/BufferedReader/Lines.java: java.lang.NullPointerException >>>>> >>>>> >>>>> On Jul 30, 2013, at 1:39 PM, Nick Williams wrote: >>>>> >>>>>> On Jul 30, 2013, at 1:16 PM, Nick Williams wrote: >>>>>> >>>>>>> On Jul 30, 2013, at 1:10 PM, Alan Bateman wrote: >>>>>>> >>>>>>>> On 30/07/2013 11:02, Nick Williams wrote: >>>>>>>>> I'm running the core libs tests locally (for the first time), and >>>>>>>>> every java.io test is failing. They're all failing for the same >>>>>>>>> reason (output below), and I suspect it's something local and not >>>>>>>>> an actual problem. But the test output is not very helpful. Note >>>>>>>>> that all of the java.beans tests passed with flying colors. Once >>>>>>>>> it got to java.io, everything started failing. Worse, each test is >>>>>>>>> taking 60 seconds to fail. I could be here a while... >>>>>>>>> >>>>>>>>> Thoughts? >>>>>>>> What command are you using? From the output it suggests that the >>>>>>>> connection between jtreg and the agent VM cannot be established. >>>>>>>> >>>>>>>> -Alan. >>>>>>> Command, just like README-builds.html#testing says: >>>>>>> >>>>>>> cd test && make >>>>>>> PRODUCT_HOME=`pwd`/../build/macosx-x86_64-normal-server-release/images/j2sdk-image/ >>>>>>> all >>>>>>> >>>>>>> I assume this is specifically an java.io-related problem because all >>>>>>> the java.beans tests passed without exception and so far every >>>>>>> java.io test through java.io.Externalizable (that's as far as it has >>>>>>> gotten) has failed without exception. Wouldn't a problem with jtreg >>>>>>> communicating with the agent VM have shown up in java.beans as well? >>>>>>> I could be wrong of course. >>>>>> I see now that java.beans tests run in "othervm mode" while java.io >>>>>> tests run in "agentvm mode." Didn't realize they were being run >>>>>> differently. Your explanation makes much more sense now, but I still >>>>>> don't know what's wrong... >>>>>> >>>>>>>>> Here's the output from one of the tests. It looks like all the >>>>>>>>> other test outputs: >>>>>>>>> >>>>>>>>> #Test Results (version 2) >>>>>>>>> #Tue Jul 30 12:38:15 CDT 2013 >>>>>>>>> #-----testdescription----- >>>>>>>>> $file=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test/java/io/BufferedInputStream/ReadAfterClose.java >>>>>>>>> >>>>>>>>> $root=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test >>>>>>>>> keywords=bug4143651 >>>>>>>>> run=ASSUMED_ACTION main ReadAfterClose\n >>>>>>>>> source=ReadAfterClose.java >>>>>>>>> title=Test if I/O methods will check if the stream has been closed. >>>>>>>>> >>>>>>>>> #-----environment----- >>>>>>>>> >>>>>>>>> #-----testresult----- >>>>>>>>> description=file\:/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test/java/io/BufferedInputStream/ReadAfterClose.java >>>>>>>>> >>>>>>>>> elapsed=60007 0\:01\:00.007 >>>>>>>>> end=Tue Jul 30 12\:38\:15 CDT 2013 >>>>>>>>> environment=regtest >>>>>>>>> execStatus=Error. Cannot get VM for test\: >>>>>>>>> java.net.SocketTimeoutException\: Accept timed out >>>>>>>>> hostname=unknown >>>>>>>>> javatestOS=Mac OS X 10.7.5 (x86_64) >>>>>>>>> javatestVersion=4.4.1 >>>>>>>>> jtregVersion=jtreg 4.1 dev b00 >>>>>>>>> script=com.sun.javatest.regtest.RegressionScript >>>>>>>>> sections=script_messages build compile >>>>>>>>> start=Tue Jul 30 12\:37\:15 CDT 2013 >>>>>>>>> test=java/io/BufferedInputStream/ReadAfterClose.java >>>>>>>>> user.name=Nicholas >>>>>>>>> work=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/build/macosx-amd64/testoutput/jdk_io/JTwork/java/io/BufferedInputStream >>>>>>>>> >>>>>>>>> >>>>>>>>> #section:script_messages >>>>>>>>> ----------messages:(5/308)---------- >>>>>>>>> JDK under test: >>>>>>>>> (/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/test/../build/macosx-x86_64-normal-server-release/images/j2sdk-image) >>>>>>>>> >>>>>>>>> openjdk version "1.8.0-internal" >>>>>>>>> OpenJDK Runtime Environment (build >>>>>>>>> 1.8.0-internal-icholas_2013_07_29_21_14-b00) >>>>>>>>> OpenJDK 64-Bit Server VM (build 25.0-b42, mixed mode) >>>>>>>>> >>>>>>>>> >>>>>>>>> #section:build >>>>>>>>> ----------messages:(3/100)---------- >>>>>>>>> command: build ReadAfterClose >>>>>>>>> reason: Named class compiled on demand >>>>>>>>> elapsed time (seconds): 60.005 >>>>>>>>> result: Error. Cannot get VM for test: >>>>>>>>> java.net.SocketTimeoutException: Accept timed out >>>>>>>>> >>>>>>>>> #section:compile >>>>>>>>> ----------messages:(3/235)---------- >>>>>>>>> command: compile -XDignore.symbol.file=true >>>>>>>>> /Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test/java/io/BufferedInputStream/ReadAfterClose.java >>>>>>>>> >>>>>>>>> reason: .class file out of date or does not exist >>>>>>>>> elapsed time (seconds): 60.005 >>>>>>>>> result: Error. Cannot get VM for test: >>>>>>>>> java.net.SocketTimeoutException: Accept timed out >>>>>>>>> >>>>>>>>> >>>>>>>>> test result: Error. Cannot get VM for test: >>>>>>>>> java.net.SocketTimeoutException: Accept timed out >>>>>>>>> > From Alan.Bateman at oracle.com Wed Jul 31 15:05:56 2013 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Wed, 31 Jul 2013 08:05:56 -0700 Subject: RFR 8015987: The corba repo contains unneeded .sjava files In-Reply-To: <51F9232A.2020100@oracle.com> References: <51F8FFF7.7030908@oracle.com> <51F9232A.2020100@oracle.com> Message-ID: <51F927D4.6030709@oracle.com> On 31/07/2013 07:46, Chris Hegarty wrote: > OK for me. > > -Chris. Looks okay to me too (and I actually thought these had been deleted already). -Alan From chris.hegarty at oracle.com Wed Jul 31 15:12:07 2013 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Wed, 31 Jul 2013 16:12:07 +0100 Subject: Try to run core libs tests -- All IO tests failing In-Reply-To: References: <68C504A0-F6DE-4A4D-B09C-0EC8FF1137AE@nicholaswilliams.net> <51F80198.4050209@oracle.com> <51F8262A.3060809@oracle.com> <51F922D2.4030305@oracle.com> Message-ID: <51F92947.70402@oracle.com> try: make PRODUCT_HOME=`pwd`/../build/macosx-x86_64-normal-server-release/images/j2sdk-image/ *jdk_core* -Chris. On 31/07/2013 15:49, Nick Williams wrote: > That's how I'm running it. > > $ pwd > /foo/bar/jdk8/jdk8 > $ cd test > $ make PRODUCT_HOME=`pwd`/../build/macosx-x86_64-normal-server-release/images/j2sdk-image/ all > > If one test fails in a batch, none of the following batches run. So if one test fails in java.io, java.lang won't run. Makes it difficult to run all of the tests, especial since there are two tests in java.lang (ThreadLocalSupplierTests due to java.lang.VerifyError: Bad local variable type, and DefaultMethodModeling due to java.lang.NullPointerException at java.util.Objects.requireNonNull when checking class B) that fail consistently (on Mac OS X at least) that I haven't been able to solve by identifying issues with the testing environment. > > Nick > > On Jul 31, 2013, at 9:44 AM, Chris Hegarty wrote: > >> I believe if you run the tests from the top-level test/Makefile, not jdk/test/Makefile, all individual test batches ( invocations of jtreg ) get run. >> >> -Chris. >> >> On 30/07/2013 21:46, Jonathan Gibbons wrote: >>> >>> jtreg itself does not "stop on error". If you're driving the tests >>> through the makefiles, the makefiles may partition the work into >>> separate jtreg runs on separate parts of the test suite. >>> >>> -- Jon >>> >>> >>> On 07/30/2013 01:13 PM, Nick Williams wrote: >>>> Okay, this is indeed very interesting. After two hours it was only >>>> about half-way through the java.io tests and all of them had failed so >>>> far. On a sheer hunch and nothing more, I unplugged my ethernet cable, >>>> thus disconnecting me from any/all networks and the Internet. BOOM. >>>> The rest of the java.io tests finished (and passed) in a few seconds, >>>> leaving 137 that had failed. I then re-ran the tests while still >>>> disconnected from the Internet and 312 of the java.io tests passed >>>> this time, leaving only 1 failure (java/io/BufferedReader/Lines.java, >>>> output below). >>>> >>>> I plugged my Ethernet back in and ran the tests again and java.io >>>> started failing every test again, timing out after 60 seconds each. >>>> Curiously extending my hunch I remained connected over Ethernet and >>>> connected to a remote network via OpenVPN. Now all of the java.io test >>>> pass again (except that same one, with the same output). >>>> >>>> What on Earth??? (If it helps, I'm on Mac OS X 10.7.5.) >>>> >>>> Unfortunately, the one failed java.io test prevents jtreg from >>>> continuing on to the next set of tests (java.lang). Anyone know how to >>>> tell jtreg to continue running on error? >>>> >>>> Nick >>>> >>>> #Test Results (version 2) >>>> #Tue Jul 30 14:53:42 CDT 2013 >>>> #-----testdescription----- >>>> $file=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test/java/io/BufferedReader/Lines.java >>>> >>>> $root=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test >>>> keywords=bug8003258 >>>> run=USER_SPECIFIED testng Lines\n >>>> source=Lines.java >>>> title=\ >>>> >>>> #-----environment----- >>>> >>>> #-----testresult----- >>>> end=Tue Jul 30 14\:53\:42 CDT 2013 >>>> execStatus=Error. Unexpected exception caught from test >>>> java/io/BufferedReader/Lines.java\: java.lang.NullPointerException >>>> sections=script_messages Details >>>> >>>> #section:script_messages >>>> ----------messages:(0/0)---------- >>>> >>>> #section:Details >>>> ----------messages:(0/0)---------- >>>> ----------Stack trace:(10/672)---------- >>>> java.lang.NullPointerException >>>> at >>>> com.sun.javatest.regtest.TestNGReporter.getMatcher(TestNGReporter.java:97) >>>> >>>> at com.sun.javatest.regtest.TestNGReporter.add(TestNGReporter.java:80) >>>> at com.sun.javatest.regtest.TestNGAction.endAction(TestNGAction.java:131) >>>> at com.sun.javatest.regtest.MainAction.run(MainAction.java:260) >>>> at >>>> com.sun.javatest.regtest.RegressionScript.run(RegressionScript.java:149) >>>> at com.sun.javatest.Script.run(Script.java:228) >>>> at com.sun.javatest.DefaultTestRunner.runTest(DefaultTestRunner.java:174) >>>> at >>>> com.sun.javatest.DefaultTestRunner.access$100(DefaultTestRunner.java:43) >>>> at com.sun.javatest.DefaultTestRunner$1.run(DefaultTestRunner.java:66) >>>> result: Not run. Test running... >>>> >>>> >>>> test result: Error. Unexpected exception caught from test >>>> java/io/BufferedReader/Lines.java: java.lang.NullPointerException >>>> >>>> >>>> On Jul 30, 2013, at 1:39 PM, Nick Williams wrote: >>>> >>>>> On Jul 30, 2013, at 1:16 PM, Nick Williams wrote: >>>>> >>>>>> On Jul 30, 2013, at 1:10 PM, Alan Bateman wrote: >>>>>> >>>>>>> On 30/07/2013 11:02, Nick Williams wrote: >>>>>>>> I'm running the core libs tests locally (for the first time), and >>>>>>>> every java.io test is failing. They're all failing for the same >>>>>>>> reason (output below), and I suspect it's something local and not >>>>>>>> an actual problem. But the test output is not very helpful. Note >>>>>>>> that all of the java.beans tests passed with flying colors. Once >>>>>>>> it got to java.io, everything started failing. Worse, each test is >>>>>>>> taking 60 seconds to fail. I could be here a while... >>>>>>>> >>>>>>>> Thoughts? >>>>>>> What command are you using? From the output it suggests that the >>>>>>> connection between jtreg and the agent VM cannot be established. >>>>>>> >>>>>>> -Alan. >>>>>> Command, just like README-builds.html#testing says: >>>>>> >>>>>> cd test&& make >>>>>> PRODUCT_HOME=`pwd`/../build/macosx-x86_64-normal-server-release/images/j2sdk-image/ >>>>>> all >>>>>> >>>>>> I assume this is specifically an java.io-related problem because all >>>>>> the java.beans tests passed without exception and so far every >>>>>> java.io test through java.io.Externalizable (that's as far as it has >>>>>> gotten) has failed without exception. Wouldn't a problem with jtreg >>>>>> communicating with the agent VM have shown up in java.beans as well? >>>>>> I could be wrong of course. >>>>> I see now that java.beans tests run in "othervm mode" while java.io >>>>> tests run in "agentvm mode." Didn't realize they were being run >>>>> differently. Your explanation makes much more sense now, but I still >>>>> don't know what's wrong... >>>>> >>>>>>> >>>>>>>> Here's the output from one of the tests. It looks like all the >>>>>>>> other test outputs: >>>>>>>> >>>>>>>> #Test Results (version 2) >>>>>>>> #Tue Jul 30 12:38:15 CDT 2013 >>>>>>>> #-----testdescription----- >>>>>>>> $file=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test/java/io/BufferedInputStream/ReadAfterClose.java >>>>>>>> >>>>>>>> $root=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test >>>>>>>> keywords=bug4143651 >>>>>>>> run=ASSUMED_ACTION main ReadAfterClose\n >>>>>>>> source=ReadAfterClose.java >>>>>>>> title=Test if I/O methods will check if the stream has been closed. >>>>>>>> >>>>>>>> #-----environment----- >>>>>>>> >>>>>>>> #-----testresult----- >>>>>>>> description=file\:/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test/java/io/BufferedInputStream/ReadAfterClose.java >>>>>>>> >>>>>>>> elapsed=60007 0\:01\:00.007 >>>>>>>> end=Tue Jul 30 12\:38\:15 CDT 2013 >>>>>>>> environment=regtest >>>>>>>> execStatus=Error. Cannot get VM for test\: >>>>>>>> java.net.SocketTimeoutException\: Accept timed out >>>>>>>> hostname=unknown >>>>>>>> javatestOS=Mac OS X 10.7.5 (x86_64) >>>>>>>> javatestVersion=4.4.1 >>>>>>>> jtregVersion=jtreg 4.1 dev b00 >>>>>>>> script=com.sun.javatest.regtest.RegressionScript >>>>>>>> sections=script_messages build compile >>>>>>>> start=Tue Jul 30 12\:37\:15 CDT 2013 >>>>>>>> test=java/io/BufferedInputStream/ReadAfterClose.java >>>>>>>> user.name=Nicholas >>>>>>>> work=/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/build/macosx-amd64/testoutput/jdk_io/JTwork/java/io/BufferedInputStream >>>>>>>> >>>>>>>> >>>>>>>> #section:script_messages >>>>>>>> ----------messages:(5/308)---------- >>>>>>>> JDK under test: >>>>>>>> (/Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/test/../build/macosx-x86_64-normal-server-release/images/j2sdk-image) >>>>>>>> >>>>>>>> openjdk version "1.8.0-internal" >>>>>>>> OpenJDK Runtime Environment (build >>>>>>>> 1.8.0-internal-icholas_2013_07_29_21_14-b00) >>>>>>>> OpenJDK 64-Bit Server VM (build 25.0-b42, mixed mode) >>>>>>>> >>>>>>>> >>>>>>>> #section:build >>>>>>>> ----------messages:(3/100)---------- >>>>>>>> command: build ReadAfterClose >>>>>>>> reason: Named class compiled on demand >>>>>>>> elapsed time (seconds): 60.005 >>>>>>>> result: Error. Cannot get VM for test: >>>>>>>> java.net.SocketTimeoutException: Accept timed out >>>>>>>> >>>>>>>> #section:compile >>>>>>>> ----------messages:(3/235)---------- >>>>>>>> command: compile -XDignore.symbol.file=true >>>>>>>> /Users/Nicholas/Documents/OpenJDK/Projects/jdk8/jdk8/jdk/test/java/io/BufferedInputStream/ReadAfterClose.java >>>>>>>> >>>>>>>> reason: .class file out of date or does not exist >>>>>>>> elapsed time (seconds): 60.005 >>>>>>>> result: Error. Cannot get VM for test: >>>>>>>> java.net.SocketTimeoutException: Accept timed out >>>>>>>> >>>>>>>> >>>>>>>> test result: Error. Cannot get VM for test: >>>>>>>> java.net.SocketTimeoutException: Accept timed out >>>>>>>> >>> > From kurchisubhra at gmail.com Wed Jul 31 15:14:31 2013 From: kurchisubhra at gmail.com (Kurchi Subhra Hazra) Date: Wed, 31 Jul 2013 08:14:31 -0700 Subject: Review request: JDK-8020191 System.getProperty( " os.name " ) returns " Windows NT (unknown) " on Windows 8.1 In-Reply-To: <51F91BE7.70403@oracle.com> References: <51F908CA.1070502@oracle.com> <51F91BE7.70403@oracle.com> Message-ID: Changes look good to me (once Alan's point is verified). Thanks, - Kurchi On Wed, Jul 31, 2013 at 7:15 AM, Alan Bateman wrote: > > The changes in the webrev look okay to me but the reference to the "app > compatibility shim" in the MS article is a bit confusing and not clear to > me (with checking into it more) whether this might consider java.exe as > something that isn't targeted to Windows 8.1. So can you verify that you > have checked it on the latest 8.1 preview? > > As regards the helper library then this could be useful in the future (for > now then it probably complicates things because the JDK still has to run on > older versions of Windows). > > -Alan. > > > > On 31/07/2013 05:53, Alexey Utkin wrote: > >> Bug description: >> https://jbs.oracle.com/bugs/**browse/JDK-8020191 >> http://bugs.sun.com/view_bug.**do?bug_id=8020191 >> >> Here is the suggested fix: >> http://cr.openjdk.java.net/~**uta/openjdk-webrevs/JDK-** >> 8020191/webrev.00/ >> >> Summary: >> We need to be consistent with the rest of OS, so I extend the case for >> 6.3 internal version number by values "Windows 8.1" for workstation OS, and >> "Windows Server 2012 R2" for server OS. >> (http://msdn.microsoft.com/en-**us/library/windows/desktop/** >> dn302074.aspx >> ) >> >> But we get a chance to have a wrong OS name due to MS compatibility >> problems. >> >> Here is the problem description: >> >> http://social.msdn.microsoft.**com/forums/windowsazure/zh-tw/** >> c471de52-611f-435d-ab44-**56064e5fd7d5/windows-81-** >> preview-getversionex-reports-**629200 >> >> and MS respond: >> http://msdn.microsoft.com/en-**us/library/windows/desktop/** >> dn302074.aspx >> >> Quotations: >> "In Windows 8.1 Preview, we have introduced a new API, Versionhelpers >> API, that deprecates the need for using GetVersion(Ex) APIs. This addresses >> difficulties in interpreting the numerical value returned by the >> GetVersion(Ex) APIs." >> >> "The internal version number for Windows 8.1 Preview and Windows Server >> 2012 R2 Preview is 6.3. Only apps that are targeting Windows 8.1 will >> receive a return value of 6.3. Those apps that are not targeted for Windows >> 8.1 will receive a return value of 6.2 unless previously shimmed as >> discussed below." >> >> >> Regards, >> -uta >> > > From chris.hegarty at oracle.com Wed Jul 31 15:12:32 2013 From: chris.hegarty at oracle.com (chris.hegarty at oracle.com) Date: Wed, 31 Jul 2013 15:12:32 +0000 Subject: hg: jdk8/tl/jdk: 8020539: Clean up doclint problems in java.util package, part 2 Message-ID: <20130731151331.5A430484B8@hg.openjdk.java.net> Changeset: 5561b34f6d4c Author: bpb Date: 2013-07-30 10:35 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/5561b34f6d4c 8020539: Clean up doclint problems in java.util package, part 2 Summary: Clean up doclint errors and warnings in classes in java.util Reviewed-by: darcy, chegar Contributed-by: Brian Burkhalter ! src/share/classes/java/util/List.java ! src/share/classes/java/util/Map.java ! src/share/classes/java/util/Optional.java ! src/share/classes/java/util/Random.java ! src/share/classes/java/util/Scanner.java ! src/share/classes/java/util/ServiceLoader.java ! src/share/classes/java/util/StringJoiner.java ! src/share/classes/java/util/TimeZone.java ! src/share/classes/java/util/UUID.java ! src/share/classes/java/util/Vector.java From chris.hegarty at oracle.com Wed Jul 31 15:20:03 2013 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Wed, 31 Jul 2013 16:20:03 +0100 Subject: ProblemList.txt Update ( add ThreadLocalSupplierTest ) Message-ID: <51F92B23.7000902@oracle.com> I would to add ThreadLocalSupplierTest to the ProblemList.txt until 8021230 issue can be resolved. hg diff test/ProblemList.txt diff -r 5561b34f6d4c test/ProblemList.txt --- a/test/ProblemList.txt Tue Jul 30 10:35:06 2013 -0700 +++ b/test/ProblemList.txt Wed Jul 31 16:15:25 2013 +0100 @@ -137,6 +137,9 @@ java/lang/reflect/Method/GenericStringTe # 8019845 due to memleak not related to the tested fix java/lang/instrument/RedefineBigClass.sh linux-x64 java/lang/instrument/RetransformBigClass.sh linux-x64 + +# 8021230 +java/lang/ThreadLocal/ThreadLocalSupplierTest.java generic-all ############################################################################ -Chris. From sean.coffey at oracle.com Wed Jul 31 15:17:58 2013 From: sean.coffey at oracle.com (=?ISO-8859-1?Q?Se=E1n_Coffey?=) Date: Wed, 31 Jul 2013 16:17:58 +0100 Subject: RFR 8015987: The corba repo contains unneeded .sjava files In-Reply-To: <51F8FFF7.7030908@oracle.com> References: <51F8FFF7.7030908@oracle.com> Message-ID: <51F92AA6.10905@oracle.com> Looks good from me also. I think these files were leftovers from some old development projects. Good to clean up. regards, Sean. On 31/07/13 13:15, Aleksej Efimov wrote: > Hi, > > There are unused .sjava files in corba repository which can be deleted. > The webrev: http://cr.openjdk.java.net/~aefimov/8015987/webrev.00/ > > BUG: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8015987 > > After execution of tests from CORBA SQE test suite - no issues were > discovered. This confirms that we can safely delete them. > > -Aleksej From Alan.Bateman at oracle.com Wed Jul 31 15:22:38 2013 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Wed, 31 Jul 2013 08:22:38 -0700 Subject: ProblemList.txt Update ( add ThreadLocalSupplierTest ) In-Reply-To: <51F92B23.7000902@oracle.com> References: <51F92B23.7000902@oracle.com> Message-ID: <51F92BBE.9010203@oracle.com> On 31/07/2013 08:20, Chris Hegarty wrote: > I would to add ThreadLocalSupplierTest to the ProblemList.txt until > 8021230 issue can be resolved. > > hg diff test/ProblemList.txt > diff -r 5561b34f6d4c test/ProblemList.txt > --- a/test/ProblemList.txt Tue Jul 30 10:35:06 2013 -0700 > +++ b/test/ProblemList.txt Wed Jul 31 16:15:25 2013 +0100 > @@ -137,6 +137,9 @@ java/lang/reflect/Method/GenericStringTe > # 8019845 due to memleak not related to the tested fix > java/lang/instrument/RedefineBigClass.sh > linux-x64 > java/lang/instrument/RetransformBigClass.sh > linux-x64 > + > +# 8021230 > +java/lang/ThreadLocal/ThreadLocalSupplierTest.java > generic-all > > > ############################################################################ > > > -Chris. > Looks fine to me, hopefully the verification issue or whatever this is hiding can be tracked down soon. -Alan From Johannes.Schindelin at gmx.de Tue Jul 30 14:14:58 2013 From: Johannes.Schindelin at gmx.de (Johannes Schindelin) Date: Tue, 30 Jul 2013 16:14:58 +0200 (CEST) Subject: Java 8 RFR 8011194: Apps launched via double-clicked .jars have file.encoding value of US-ASCII on Mac OS X In-Reply-To: <51F72EAD.7040201@oracle.com> References: <51F2B781.1050104@oracle.com> <51F5FA02.9020909@oracle.com> <51F6C860.4020000@oracle.com> <51F72EAD.7040201@oracle.com> Message-ID: Hi, On Tue, 30 Jul 2013, David Holmes wrote: > On 30/07/2013 5:54 AM, Brent Christian wrote: > > On 7/28/13 10:13 PM, David Holmes wrote: > > > On 27/07/2013 3:53 AM, Brent Christian wrote: > > > > Please review my fix for 8011194 : "Apps launched via double-clicked > > > > .jars have file.encoding value of US-ASCII on Mac OS X" > > > > > > > > http://bugs.sun.com/view_bug.do?bug_id=8011194 > > > > > > > > In most cases of launching a Java app on Mac (from the cmdline, or > > > > from a native .app bundle), reading and displaying UTF-8 > > > > characters beyond the standard ASCII range works fine. > > > > > > > > A notable exception is the launching of an app by double-clicking > > > > a .jar file. In this case, file.encoding defaults to US-ASCII, > > > > and characters outside of the ASCII range show up as garbage. > > > > > > Why does this occur? What sets the encoding to US-ASCII? > > > > "US-ASCII" is the answer we get from nl_langinfo(CODESET) because no > > values for LANG/LC* are set in the environment when double-clicking a > > .jar. > > > > We get "UTF-8" when launching from the command line because the > > default Terminal.app setup on Mac will setup LANG for you (to > > "en_US.UTF-8" in the US). > > Sounds like a user environment error to me. This isn't my area but I'm > not convinced we should be second guessing what we think the encoding > should be. Except that that is not the case here, of course. The user did *not* set any environment variable in this case. So we are not talking about "second guessing" or "user environment error" but about a sensible default. As to US-ASCII, sorry to say: the seventies called and want their character set back. There can be no question that UTF-8 is the best default character encoding, or are you even going to question *that*? > What if someone intends for it to be US-ASCII? Then LANG would not be unset, would it. Hth, Johannes From swpalmer at gmail.com Tue Jul 30 14:56:59 2013 From: swpalmer at gmail.com (Scott Palmer) Date: Tue, 30 Jul 2013 10:56:59 -0400 Subject: Java 8 RFR 8011194: Apps launched via double-clicked .jars have file.encoding value of US-ASCII on Mac OS X In-Reply-To: References: <51F2B781.1050104@oracle.com> <51F5FA02.9020909@oracle.com> <51F6C860.4020000@oracle.com> <51F72EAD.7040201@oracle.com> Message-ID: Then shouldn't you be complaining to Apple that the value returned by nl_langinfo needs to be changed? David's point seems to be that second guessing the character set reported by the OS is likely to cause a different set of problems. Scott On Tue, Jul 30, 2013 at 10:14 AM, Johannes Schindelin < Johannes.Schindelin at gmx.de> wrote: > Hi, > > On Tue, 30 Jul 2013, David Holmes wrote: > > > On 30/07/2013 5:54 AM, Brent Christian wrote: > > > On 7/28/13 10:13 PM, David Holmes wrote: > > > > On 27/07/2013 3:53 AM, Brent Christian wrote: > > > > > Please review my fix for 8011194 : "Apps launched via > double-clicked > > > > > .jars have file.encoding value of US-ASCII on Mac OS X" > > > > > > > > > > http://bugs.sun.com/view_bug.do?bug_id=8011194 > > > > > > > > > > In most cases of launching a Java app on Mac (from the cmdline, or > > > > > from a native .app bundle), reading and displaying UTF-8 > > > > > characters beyond the standard ASCII range works fine. > > > > > > > > > > A notable exception is the launching of an app by double-clicking > > > > > a .jar file. In this case, file.encoding defaults to US-ASCII, > > > > > and characters outside of the ASCII range show up as garbage. > > > > > > > > Why does this occur? What sets the encoding to US-ASCII? > > > > > > "US-ASCII" is the answer we get from nl_langinfo(CODESET) because no > > > values for LANG/LC* are set in the environment when double-clicking a > > > .jar. > > > > > > We get "UTF-8" when launching from the command line because the > > > default Terminal.app setup on Mac will setup LANG for you (to > > > "en_US.UTF-8" in the US). > > > > Sounds like a user environment error to me. This isn't my area but I'm > > not convinced we should be second guessing what we think the encoding > > should be. > > Except that that is not the case here, of course. The user did *not* set > any environment variable in this case. > > So we are not talking about "second guessing" or "user environment error" > but about a sensible default. > > As to US-ASCII, sorry to say: the seventies called and want their > character set back. > > There can be no question that UTF-8 is the best default character > encoding, or are you even going to question *that*? > > > What if someone intends for it to be US-ASCII? > > Then LANG would not be unset, would it. > > Hth, > Johannes > From francis at devrx.org Tue Jul 30 16:05:16 2013 From: francis at devrx.org (Francis Devereux) Date: Tue, 30 Jul 2013 17:05:16 +0100 Subject: Java 8 RFR 8011194: Apps launched via double-clicked .jars have file.encoding value of US-ASCII on Mac OS X In-Reply-To: References: <51F2B781.1050104@oracle.com> <51F5FA02.9020909@oracle.com> <51F6C860.4020000@oracle.com> <51F72EAD.7040201@oracle.com> Message-ID: <8CC8FA32-26C3-47D3-B6A3-33AA4BEC7D12@devrx.org> I suspect that Apple might be unlikely to change the value that nl_langinfo returns when LANG is unset. However, it might be possible to fix this issue without second-guessing the character set reported by the OS by calling [NSLocale currentLocale] (or the CFLocale equivalent) instead of nl_langinfo. I think (although I haven't checked) that that [NSLocale currentLocale] determines the current locale using a mechanism other than environment variables, because LANG is usually be unset for GUI apps on OS X. On 30 Jul 2013, at 15:56, Scott Palmer wrote: > Then shouldn't you be complaining to Apple that the value returned by > nl_langinfo needs to be changed? > David's point seems to be that second guessing the character set reported > by the OS is likely to cause a different set of problems. > > Scott > > > On Tue, Jul 30, 2013 at 10:14 AM, Johannes Schindelin < > Johannes.Schindelin at gmx.de> wrote: > >> Hi, >> >> On Tue, 30 Jul 2013, David Holmes wrote: >> >>> On 30/07/2013 5:54 AM, Brent Christian wrote: >>>> On 7/28/13 10:13 PM, David Holmes wrote: >>>>> On 27/07/2013 3:53 AM, Brent Christian wrote: >>>>>> Please review my fix for 8011194 : "Apps launched via >> double-clicked >>>>>> .jars have file.encoding value of US-ASCII on Mac OS X" >>>>>> >>>>>> http://bugs.sun.com/view_bug.do?bug_id=8011194 >>>>>> >>>>>> In most cases of launching a Java app on Mac (from the cmdline, or >>>>>> from a native .app bundle), reading and displaying UTF-8 >>>>>> characters beyond the standard ASCII range works fine. >>>>>> >>>>>> A notable exception is the launching of an app by double-clicking >>>>>> a .jar file. In this case, file.encoding defaults to US-ASCII, >>>>>> and characters outside of the ASCII range show up as garbage. >>>>> >>>>> Why does this occur? What sets the encoding to US-ASCII? >>>> >>>> "US-ASCII" is the answer we get from nl_langinfo(CODESET) because no >>>> values for LANG/LC* are set in the environment when double-clicking a >>>> .jar. >>>> >>>> We get "UTF-8" when launching from the command line because the >>>> default Terminal.app setup on Mac will setup LANG for you (to >>>> "en_US.UTF-8" in the US). >>> >>> Sounds like a user environment error to me. This isn't my area but I'm >>> not convinced we should be second guessing what we think the encoding >>> should be. >> >> Except that that is not the case here, of course. The user did *not* set >> any environment variable in this case. >> >> So we are not talking about "second guessing" or "user environment error" >> but about a sensible default. >> >> As to US-ASCII, sorry to say: the seventies called and want their >> character set back. >> >> There can be no question that UTF-8 is the best default character >> encoding, or are you even going to question *that*? >> >>> What if someone intends for it to be US-ASCII? >> >> Then LANG would not be unset, would it. >> >> Hth, >> Johannes >> > From rickard.backman at oracle.com Wed Jul 31 17:00:24 2013 From: rickard.backman at oracle.com (rickard.backman at oracle.com) Date: Wed, 31 Jul 2013 17:00:24 +0000 Subject: hg: jdk8/tl/jdk: 8006324: [TEST_BUG] sun/invoke/util/ValueConversionsTest.java should be modified Message-ID: <20130731170109.E1992484BC@hg.openjdk.java.net> Changeset: 4bd51f6268f4 Author: rbackman Date: 2013-07-24 10:57 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/4bd51f6268f4 8006324: [TEST_BUG] sun/invoke/util/ValueConversionsTest.java should be modified Reviewed-by: kvn, twisti ! test/sun/invoke/util/ValueConversionsTest.java From nicholas+openjdk at nicholaswilliams.net Wed Jul 31 19:17:54 2013 From: nicholas+openjdk at nicholaswilliams.net (Nick Williams) Date: Wed, 31 Jul 2013 14:17:54 -0500 Subject: Getting ciObject from oop/jobject Message-ID: <25D4AFB8-82DE-43E0-92E5-754BFC4DBBAD@nicholaswilliams.net> In native code (library_call.cpp), if I have an oop (which I can convert to a jobject if need be), how do I get a ciObject? I see that ciEnv has a ciObject* get_object(oop) method, but it's private. And ciObjectFactory has a ciObject* get(oop) method, but I can't figure out how to get the ciObjectFactory instance. I know that ciObject keeps a jobject internally, and I know that ciObject has a ciObject(oop) constructor, but it's protected (for good reason). If it helps, I'm trying to inline a method and need to set_result(makecon(TypeInstPtr::make(oopInstance))). I may be going down the wrong path. Thanks in advance for any help, Nick From mark.reinhold at oracle.com Wed Jul 31 20:42:11 2013 From: mark.reinhold at oracle.com (mark.reinhold at oracle.com) Date: Wed, 31 Jul 2013 13:42:11 -0700 Subject: problems with sun.reflect.Reflection.getCallerClass(int) In-Reply-To: <51DE6B0A.1010207@gmx.org> References: <51DE6B0A.1010207@gmx.org> Message-ID: <20130731134211.948357@eggemoggin.niobe.net> FYI, we're going to revert this method to its previous behavior in JDK 7u40: http://bugs.sun.com/view_bug.do?bug_id=8021946 . What will happen to this method in JDK 8 requires further thought. - Mark From brent.christian at oracle.com Wed Jul 31 20:43:46 2013 From: brent.christian at oracle.com (Brent Christian) Date: Wed, 31 Jul 2013 13:43:46 -0700 Subject: Java 8 RFR 8011194: Apps launched via double-clicked .jars have file.encoding value of US-ASCII on Mac OS X In-Reply-To: References: <51F2B781.1050104@oracle.com> <51F5FA02.9020909@oracle.com> <51F6C860.4020000@oracle.com> <51F72EAD.7040201@oracle.com> <8CC8FA32-26C3-47D3-B6A3-33AA4BEC7D12@devrx.org> <4DB36382-0D2A-492F-8472-C198D2AB1568@apple.com> Message-ID: <51F97702.5090203@oracle.com> On 7/30/13 4:06 PM, David DeHaven wrote: > > Judging from the docs, nl_langinfo seems like a Unix portability > function (something more likely to be happier with ASCII in a > terminal), not something to be used by a native Cocoa application. Exactly - so I think it expects to be called from a cmdline with a shell-style surrounding environment, with LANG/etc variables set. David suggests that calling nl_langinfo() is "asking the wrong question." In the particular context of double-click launching on Mac, you could say that's true (or at least asking the question in the wrong way). But consider - the code in question is shared with other Unix platforms, and when running from the cmdline/shell scripts/etc, nl_langinfo() *is* the right way to ask the question. To ask the right question for this specific context on MacOS X (NSLocale or CFLocale) I suspect would involve a fair amount of code surgery, and the end result would be the same. Given this, I think my proposed change is a good one from a practical standpoint. Thank you, everyone, for your feedback. -Brent >> Apple is highly unlikely to change the behavior of nl_langinfo(). >> >> There is already code in the JDK that calls into JRSCopyPrimaryLanguage(), JRSCopyCanonicalLanguageForPrimaryLanguage(), and JRSSetDefaultLocalization() for exactly this purpose. >> >> Please proceed with setting the encoding to UTF-8. It is the de-facto standard for every Cocoa application I have ever seen. US-ASCII is always the wrong choice for a graphical app on OS X. >> >> Regards, >> Mike Swingler >> Apple Inc. >> >> On Jul 30, 2013, at 9:05 AM, Francis Devereux wrote: >> >>> I suspect that Apple might be unlikely to change the value that nl_langinfo returns when LANG is unset. >>> >>> However, it might be possible to fix this issue without second-guessing the character set reported by the OS by calling [NSLocale currentLocale] (or the CFLocale equivalent) instead of nl_langinfo. I think (although I haven't checked) that that [NSLocale currentLocale] determines the current locale using a mechanism other than environment variables, because LANG is usually be unset for GUI apps on OS X. >>> >>> On 30 Jul 2013, at 15:56, Scott Palmer wrote: >>> >>>> Then shouldn't you be complaining to Apple that the value returned by >>>> nl_langinfo needs to be changed? >>>> David's point seems to be that second guessing the character set reported >>>> by the OS is likely to cause a different set of problems. >>>> >>>> Scott >>>> >>>> >>>> On Tue, Jul 30, 2013 at 10:14 AM, Johannes Schindelin < >>>> Johannes.Schindelin at gmx.de> wrote: >>>> >>>>> Hi, >>>>> >>>>> On Tue, 30 Jul 2013, David Holmes wrote: >>>>> >>>>>> On 30/07/2013 5:54 AM, Brent Christian wrote: >>>>>>> On 7/28/13 10:13 PM, David Holmes wrote: >>>>>>>> On 27/07/2013 3:53 AM, Brent Christian wrote: >>>>>>>>> Please review my fix for 8011194 : "Apps launched via >>>>> double-clicked >>>>>>>>> .jars have file.encoding value of US-ASCII on Mac OS X" >>>>>>>>> >>>>>>>>> http://bugs.sun.com/view_bug.do?bug_id=8011194 >>>>>>>>> >>>>>>>>> In most cases of launching a Java app on Mac (from the cmdline, or >>>>>>>>> from a native .app bundle), reading and displaying UTF-8 >>>>>>>>> characters beyond the standard ASCII range works fine. >>>>>>>>> >>>>>>>>> A notable exception is the launching of an app by double-clicking >>>>>>>>> a .jar file. In this case, file.encoding defaults to US-ASCII, >>>>>>>>> and characters outside of the ASCII range show up as garbage. >>>>>>>> >>>>>>>> Why does this occur? What sets the encoding to US-ASCII? >>>>>>> >>>>>>> "US-ASCII" is the answer we get from nl_langinfo(CODESET) because no >>>>>>> values for LANG/LC* are set in the environment when double-clicking a >>>>>>> .jar. >>>>>>> >>>>>>> We get "UTF-8" when launching from the command line because the >>>>>>> default Terminal.app setup on Mac will setup LANG for you (to >>>>>>> "en_US.UTF-8" in the US). >>>>>> >>>>>> Sounds like a user environment error to me. This isn't my area but I'm >>>>>> not convinced we should be second guessing what we think the encoding >>>>>> should be. >>>>> >>>>> Except that that is not the case here, of course. The user did *not* set >>>>> any environment variable in this case. >>>>> >>>>> So we are not talking about "second guessing" or "user environment error" >>>>> but about a sensible default. >>>>> >>>>> As to US-ASCII, sorry to say: the seventies called and want their >>>>> character set back. >>>>> >>>>> There can be no question that UTF-8 is the best default character >>>>> encoding, or are you even going to question *that*? >>>>> >>>>>> What if someone intends for it to be US-ASCII? >>>>> >>>>> Then LANG would not be unset, would it. >>>>> >>>>> Hth, >>>>> Johannes >>>>> >>>> >>> >> > From nicholas+openjdk at nicholaswilliams.net Wed Jul 31 20:50:53 2013 From: nicholas+openjdk at nicholaswilliams.net (Nick Williams) Date: Wed, 31 Jul 2013 15:50:53 -0500 Subject: problems with sun.reflect.Reflection.getCallerClass(int) In-Reply-To: <20130731134211.948357@eggemoggin.niobe.net> References: <51DE6B0A.1010207@gmx.org> <20130731134211.948357@eggemoggin.niobe.net> Message-ID: That is, indeed, great news! I have almost completed a patch that I will propose later this week to make this a public API. Nick On Jul 31, 2013, at 3:42 PM, mark.reinhold at oracle.com wrote: > FYI, we're going to revert this method to its previous behavior in > JDK 7u40: http://bugs.sun.com/view_bug.do?bug_id=8021946 . > > What will happen to this method in JDK 8 requires further thought. > > - Mark From stuart.marks at oracle.com Wed Jul 31 21:38:26 2013 From: stuart.marks at oracle.com (Stuart Marks) Date: Wed, 31 Jul 2013 14:38:26 -0700 Subject: Remaining doclint issues in java.net In-Reply-To: <51F67C14.5040804@oracle.com> References: <51F67C14.5040804@oracle.com> Message-ID: <51F983D2.3050501@oracle.com> On 7/29/13 7:28 AM, Chris Hegarty wrote: > > There are two remaining doclint warnings in the java.net package. > > >:javac -Xdoclint:all/protected src/share/classes/java/net/DatagramPacket.java > src/share/classes/java/net/DatagramPacket.java:142: warning: no @throws for > java.net.SocketException > public DatagramPacket(byte buf[], int offset, int length, > ^ > src/share/classes/java/net/DatagramPacket.java:178: warning: no @throws for > java.net.SocketException > public DatagramPacket(byte buf[], int length, > ^ > > These are caused by no @throws SE declaration on the constructors. > > As it happens 'throws SE' was incorrectly added to these constructors when > introduced in 1.4. The original API specified that SE was thrown when the given > SocketAddress was not supported. That was later changed to throw IAE, in 1.4.2. > These constructor now can never throw SE. > > Removing 'throws SE' from the method declaration is a binary compatible change, > but not source compatible ( XXX is never thrown in body of corresponding try > statement ). I don't think breaking source compatibility for this kind of > change is justified. If it is, then the solution is to simply remove 'throws SE'. > > Back in the real world, I guess we need to come up with some wording for the > '@throws SE' declaration. Something vague like "If an I/O Exception occurs", or > can we put something stronger like "will never be thrown" ?? I'd like to make a case for removing 'throws SE' even though it's a source incompatible change. It's not that source incompatibilities are strictly prohibited. They are allowed, and it depends on how often they occur and how difficult they are to fix. I seem to recall there was a similar issue when "more precise rethrow" was added in Java 7; this was indeed a source incompatibility but a survey was done and it was quite rare. How often are these DatagramPacket constructors used? I'd have to say, probably more often than the fairly obscure cases that the "more precise rethrow" feature caused issues with. On the other hand, fixing up code that constructs a DatagramPacket ought to be pretty simple: removing the catch of SocketException. This is already known to be dead code, so it can simply be removed. The alternative is to add "@throws SocketException never" to the javadoc, just to get rid of the doclint warning, but this has the consequence of requiring people to keep dead code around indefinitely, and furthermore it requires them to add new dead code every time they create a DatagramPacket. I'm not claiming that removing 'throws SE' is obviously the right answer, but I'd like to see it considered seriously. s'marks From kumar.x.srinivasan at oracle.com Wed Jul 31 21:47:18 2013 From: kumar.x.srinivasan at oracle.com (kumar.x.srinivasan at oracle.com) Date: Wed, 31 Jul 2013 21:47:18 +0000 Subject: hg: jdk8/tl/langtools: 8014826: c.s.t.javac.tree.Pretty.visitNewArray() prints duplicate dimension markers Message-ID: <20130731214726.BCE15484D0@hg.openjdk.java.net> Changeset: 05370ef9dccb Author: ksrini Date: 2013-07-31 08:37 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/05370ef9dccb 8014826: c.s.t.javac.tree.Pretty.visitNewArray() prints duplicate dimension markers Reviewed-by: jjg, vromero ! src/share/classes/com/sun/tools/javac/tree/Pretty.java + test/tools/javac/tree/NewArrayPretty.java From mhall at mhcomputing.net Wed Jul 31 21:39:57 2013 From: mhall at mhcomputing.net (Matthew Hall) Date: Wed, 31 Jul 2013 14:39:57 -0700 Subject: Remaining doclint issues in java.net In-Reply-To: <51F983D2.3050501@oracle.com> References: <51F67C14.5040804@oracle.com> <51F983D2.3050501@oracle.com> Message-ID: <20130731213957.GA24485@mhcomputing.net> On Wed, Jul 31, 2013 at 02:38:26PM -0700, Stuart Marks wrote: > The alternative is to add "@throws SocketException never" to the > javadoc, just to get rid of the doclint warning, but this has the > consequence of requiring people to keep dead code around > indefinitely, and furthermore it requires them to add new dead code > every time they create a DatagramPacket. I have never understood in many years using Java why the compiler generates errors about attempting to catch supposedly-impossible exceptions, instead of warnings. For me it only leads to difficulties when I'm trying to write prototypes or refactor and clean up some old brittle code, and I run into that rather dubious sort of error. This is a good example of where it causes more harm than good. Is there still a really good reason for this over-paranoid compiler error given that checked exceptions aren't as popular as they used to be anyways? Matthew.

    Charset

    Description

    CharsetDescription
    US-ASCIISeven-bit ASCII, a.k.a. ISO646-US, > * a.k.a. the Basic Latin block of the Unicode character set