Re: RFR: 8284161: Implementation of Virtual Threads (Preview) [v8]

2022-04-27 Thread Paul Sandoz
On Wed, 27 Apr 2022 14:24:20 GMT, Alan Bateman  wrote:

>> This is the implementation of JEP 425: Virtual Threads (Preview); TBD which 
>> JDK version to target.
>> 
>> We will refresh this PR periodically to pick up changes and fixes from the 
>> loom repo.
>> 
>> Most of the new mechanisms in the HotSpot VM are disabled by default and 
>> require running with `--enable-preview` to enable.
>> 
>> The patch has support for x64 and aarch64 on the usual operating systems 
>> (Linux, macOS, and Windows). There are stubs (calling Unimplemented) for 
>> zero and some of the other ports. Additional ports can be contributed via 
>> PRs against the fibers branch in the loom repo.
>> 
>> There are changes in many areas. To reduce notifications/mails, the labels 
>> have been trimmed down for now to hotspot, serviceability and core-libs. 
>> We'll add the complete set of labels when the PR is further along.
>> 
>> The changes include a refresh of java.util.concurrent and ForkJoinPool from 
>> Doug Lea's CVS. These changes will probably be proposed and integrated in 
>> advance of this PR.
>> 
>> The changes include some non-exposed and low-level infrastructure to support 
>> the (in draft) JEPs for Structured Concurrency and Scope Locals. This is to 
>> make life a bit easier and avoid having to separate VM changes and juggle 
>> branches at this time.
>
> Alan Bateman has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Refresh 7965cc6b168e567ac2596f2fbc3b00a7d99b7e1e

It's great to see end game in play for this multi-year effort, impressive work 
by all involved.

I looked through code in the base module. Generally looks well structured and 
documented.

The fork join code is naturally hard to review. I did try! (it takes the prize 
for the highest Java code density in the JDK). I mostly looked for regular and 
repeated structure rather than trying to fully understand/review the intricate 
concurrency details.

IMO there is some post integration work to do around the architecture of thread 
containers, i presume the structured concurrency implementation (use of thread 
flock) will help with that.

-

Marked as reviewed by psandoz (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/8166


Re: RFR: 8284161: Implementation of Virtual Threads (Preview) [v8]

2022-04-27 Thread Paul Sandoz
On Wed, 27 Apr 2022 14:24:20 GMT, Alan Bateman  wrote:

>> This is the implementation of JEP 425: Virtual Threads (Preview); TBD which 
>> JDK version to target.
>> 
>> We will refresh this PR periodically to pick up changes and fixes from the 
>> loom repo.
>> 
>> Most of the new mechanisms in the HotSpot VM are disabled by default and 
>> require running with `--enable-preview` to enable.
>> 
>> The patch has support for x64 and aarch64 on the usual operating systems 
>> (Linux, macOS, and Windows). There are stubs (calling Unimplemented) for 
>> zero and some of the other ports. Additional ports can be contributed via 
>> PRs against the fibers branch in the loom repo.
>> 
>> There are changes in many areas. To reduce notifications/mails, the labels 
>> have been trimmed down for now to hotspot, serviceability and core-libs. 
>> We'll add the complete set of labels when the PR is further along.
>> 
>> The changes include a refresh of java.util.concurrent and ForkJoinPool from 
>> Doug Lea's CVS. These changes will probably be proposed and integrated in 
>> advance of this PR.
>> 
>> The changes include some non-exposed and low-level infrastructure to support 
>> the (in draft) JEPs for Structured Concurrency and Scope Locals. This is to 
>> make life a bit easier and avoid having to separate VM changes and juggle 
>> branches at this time.
>
> Alan Bateman has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Refresh 7965cc6b168e567ac2596f2fbc3b00a7d99b7e1e

src/java.base/share/classes/java/lang/Thread.java line 116:

> 114:  * carrier threads. Locking and I/O operations are examples of 
> operations
> 115:  * where a carrier thread may be re-scheduled from one virtual thread to 
> another.
> 116:  * Code executing in a virtual thread is not aware of underlying carrier 
> thread.

Suggestion:

 * Code executing in a virtual thread is not aware of the underlying carrier 
thread.

-

PR: https://git.openjdk.java.net/jdk/pull/8166


Re: RFR: 8284161: Implementation of Virtual Threads (Preview) [v8]

2022-04-27 Thread Paul Sandoz
On Wed, 27 Apr 2022 14:24:20 GMT, Alan Bateman  wrote:

>> This is the implementation of JEP 425: Virtual Threads (Preview); TBD which 
>> JDK version to target.
>> 
>> We will refresh this PR periodically to pick up changes and fixes from the 
>> loom repo.
>> 
>> Most of the new mechanisms in the HotSpot VM are disabled by default and 
>> require running with `--enable-preview` to enable.
>> 
>> The patch has support for x64 and aarch64 on the usual operating systems 
>> (Linux, macOS, and Windows). There are stubs (calling Unimplemented) for 
>> zero and some of the other ports. Additional ports can be contributed via 
>> PRs against the fibers branch in the loom repo.
>> 
>> There are changes in many areas. To reduce notifications/mails, the labels 
>> have been trimmed down for now to hotspot, serviceability and core-libs. 
>> We'll add the complete set of labels when the PR is further along.
>> 
>> The changes include a refresh of java.util.concurrent and ForkJoinPool from 
>> Doug Lea's CVS. These changes will probably be proposed and integrated in 
>> advance of this PR.
>> 
>> The changes include some non-exposed and low-level infrastructure to support 
>> the (in draft) JEPs for Structured Concurrency and Scope Locals. This is to 
>> make life a bit easier and avoid having to separate VM changes and juggle 
>> branches at this time.
>
> Alan Bateman has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Refresh 7965cc6b168e567ac2596f2fbc3b00a7d99b7e1e

src/java.base/share/classes/java/util/concurrent/ThreadPerTaskExecutor.java 
line 45:

> 43:  * threads is unbounded.
> 44:  */
> 45: class ThreadPerTaskExecutor implements ExecutorService {

This class manages the set of per-task threads which arguably should be the job 
of the thread container, and it awkwardly overrides the container's set of 
threads by setting a field on `SharedThreadContainer.threadsSupplier`.

`SharedThreadContainer` supports a number of different shared container 
policies that could be made clearer.

Architecturally i think this could be better layered but it can be iterated on 
later.

-

PR: https://git.openjdk.java.net/jdk/pull/8166


Re: RFR: 8284161: Implementation of Virtual Threads (Preview) [v8]

2022-04-27 Thread Paul Sandoz
On Wed, 27 Apr 2022 17:27:56 GMT, Mandy Chung  wrote:

>> Alan Bateman has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   Refresh 7965cc6b168e567ac2596f2fbc3b00a7d99b7e1e
>
> src/java.base/share/classes/java/lang/PinnedThreadPrinter.java line 58:
> 
>> 56: 
>> 57: // maps a class to the hashes of stack traces pinned by that code in 
>> that class
>> 58: private static final Map, Hashes> classToHashes = new 
>> WeakHashMap<>();
> 
> Can you use `ClassValue` in this case?

I was wondering that too, but held off commenting since it's not super 
performance critical given `classToHashes` is synchronized on. However, it does 
make the code a little clearer.

-

PR: https://git.openjdk.java.net/jdk/pull/8166


Re: RFR: 8284161: Implementation of Virtual Threads (Preview) [v2]

2022-04-15 Thread Paul Sandoz
On Wed, 13 Apr 2022 14:21:20 GMT, Alan Bateman  wrote:

>> This is the implementation of JEP 425: Virtual Threads (Preview); TBD which 
>> JDK version to target.
>> 
>> We will refresh this PR periodically to pick up changes and fixes from the 
>> loom repo.
>> 
>> Most of the new mechanisms in the HotSpot VM are disabled by default and 
>> require running with `--enable-preview` to enable.
>> 
>> The patch has support for x64 and aarch64 on the usual operating systems 
>> (Linux, macOS, and Windows). There are stubs (calling Unimplemented) for 
>> zero and some of the other ports. Additional ports can be contributed via 
>> PRs against the fibers branch in the loom repo.
>> 
>> There are changes in many areas. To reduce notifications/mails, the labels 
>> have been trimmed down for now to hotspot, serviceability and core-libs. 
>> We'll add the complete set of labels when the PR is further along.
>> 
>> The changes include a refresh of java.util.concurrent and ForkJoinPool from 
>> Doug Lea's CVS. These changes will probably be proposed and integrated in 
>> advance of this PR.
>> 
>> The changes include some non-exposed and low-level infrastructure to support 
>> the (in draft) JEPs for Structured Concurrency and Scope Locals. This is to 
>> make life a bit easier and avoid having to separate VM changes and juggle 
>> branches at this time.
>
> Alan Bateman has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Refresh

src/java.base/share/classes/jdk/internal/vm/annotation/ChangesCurrentThread.java
 line 35:

> 33:  * disables inlining for the method to which it is applied unless the
> 34:  * method being unlined into is also annotated ChangesCurrentThread.
> 35: 

Suggestion:

 * method being inlined into is also annotated ChangesCurrentThread.
 *

-

PR: https://git.openjdk.java.net/jdk/pull/8166


Re: RFR: 8284161: Implementation of Virtual Threads (Preview) [v2]

2022-04-15 Thread Paul Sandoz
On Wed, 13 Apr 2022 14:21:20 GMT, Alan Bateman  wrote:

>> This is the implementation of JEP 425: Virtual Threads (Preview); TBD which 
>> JDK version to target.
>> 
>> We will refresh this PR periodically to pick up changes and fixes from the 
>> loom repo.
>> 
>> Most of the new mechanisms in the HotSpot VM are disabled by default and 
>> require running with `--enable-preview` to enable.
>> 
>> The patch has support for x64 and aarch64 on the usual operating systems 
>> (Linux, macOS, and Windows). There are stubs (calling Unimplemented) for 
>> zero and some of the other ports. Additional ports can be contributed via 
>> PRs against the fibers branch in the loom repo.
>> 
>> There are changes in many areas. To reduce notifications/mails, the labels 
>> have been trimmed down for now to hotspot, serviceability and core-libs. 
>> We'll add the complete set of labels when the PR is further along.
>> 
>> The changes include a refresh of java.util.concurrent and ForkJoinPool from 
>> Doug Lea's CVS. These changes will probably be proposed and integrated in 
>> advance of this PR.
>> 
>> The changes include some non-exposed and low-level infrastructure to support 
>> the (in draft) JEPs for Structured Concurrency and Scope Locals. This is to 
>> make life a bit easier and avoid having to separate VM changes and juggle 
>> branches at this time.
>
> Alan Bateman has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Refresh

src/java.base/share/classes/jdk/internal/vm/ThreadContainers.java line 184:

> 182:  * with the Thread API.
> 183:  */
> 184: private static class RootContainer extends ThreadContainer {

This implementation could be clearer if split out into two, and the value 
assigned to `INSTANCE` is selected based  on the system property. Something to 
consider later perhaps.

-

PR: https://git.openjdk.java.net/jdk/pull/8166


Re: RFR: 8284161: Implementation of Virtual Threads (Preview) [v2]

2022-04-15 Thread Paul Sandoz
On Wed, 13 Apr 2022 14:21:20 GMT, Alan Bateman  wrote:

>> This is the implementation of JEP 425: Virtual Threads (Preview); TBD which 
>> JDK version to target.
>> 
>> We will refresh this PR periodically to pick up changes and fixes from the 
>> loom repo.
>> 
>> Most of the new mechanisms in the HotSpot VM are disabled by default and 
>> require running with `--enable-preview` to enable.
>> 
>> The patch has support for x64 and aarch64 on the usual operating systems 
>> (Linux, macOS, and Windows). There are stubs (calling Unimplemented) for 
>> zero and some of the other ports. Additional ports can be contributed via 
>> PRs against the fibers branch in the loom repo.
>> 
>> There are changes in many areas. To reduce notifications/mails, the labels 
>> have been trimmed down for now to hotspot, serviceability and core-libs. 
>> We'll add the complete set of labels when the PR is further along.
>> 
>> The changes include a refresh of java.util.concurrent and ForkJoinPool from 
>> Doug Lea's CVS. These changes will probably be proposed and integrated in 
>> advance of this PR.
>> 
>> The changes include some non-exposed and low-level infrastructure to support 
>> the (in draft) JEPs for Structured Concurrency and Scope Locals. This is to 
>> make life a bit easier and avoid having to separate VM changes and juggle 
>> branches at this time.
>
> Alan Bateman has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Refresh

src/java.base/share/classes/jdk/internal/vm/Continuation.java line 474:

> 472: private void processNmethods(int before, int after) {
> 473: 
> 474: }

Unused field and method?

-

PR: https://git.openjdk.java.net/jdk/pull/8166


Re: RFR: 8284161: Implementation of Virtual Threads (Preview) [v2]

2022-04-15 Thread Paul Sandoz
On Wed, 13 Apr 2022 14:21:20 GMT, Alan Bateman  wrote:

>> This is the implementation of JEP 425: Virtual Threads (Preview); TBD which 
>> JDK version to target.
>> 
>> We will refresh this PR periodically to pick up changes and fixes from the 
>> loom repo.
>> 
>> Most of the new mechanisms in the HotSpot VM are disabled by default and 
>> require running with `--enable-preview` to enable.
>> 
>> The patch has support for x64 and aarch64 on the usual operating systems 
>> (Linux, macOS, and Windows). There are stubs (calling Unimplemented) for 
>> zero and some of the other ports. Additional ports can be contributed via 
>> PRs against the fibers branch in the loom repo.
>> 
>> There are changes in many areas. To reduce notifications/mails, the labels 
>> have been trimmed down for now to hotspot, serviceability and core-libs. 
>> We'll add the complete set of labels when the PR is further along.
>> 
>> The changes include a refresh of java.util.concurrent and ForkJoinPool from 
>> Doug Lea's CVS. These changes will probably be proposed and integrated in 
>> advance of this PR.
>> 
>> The changes include some non-exposed and low-level infrastructure to support 
>> the (in draft) JEPs for Structured Concurrency and Scope Locals. This is to 
>> make life a bit easier and avoid having to separate VM changes and juggle 
>> branches at this time.
>
> Alan Bateman has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Refresh

src/java.base/share/classes/jdk/internal/vm/Continuation.java line 264:

> 262: } finally {
> 263: fence();
> 264: StackChunk c = tail;

`c` is not used

src/java.base/share/classes/jdk/internal/vm/Continuation.java line 310:

> 308: 
> 309: @IntrinsicCandidate
> 310: private static int doYield() { throw new Error("Intrinsic not 
> installed"); };

Suggestion:

private static int doYield() { throw new Error("Intrinsic not installed"); }

-

PR: https://git.openjdk.java.net/jdk/pull/8166


Re: RFR: 8284161: Implementation of Virtual Threads (Preview) [v2]

2022-04-15 Thread Paul Sandoz
On Wed, 13 Apr 2022 14:21:20 GMT, Alan Bateman  wrote:

>> This is the implementation of JEP 425: Virtual Threads (Preview); TBD which 
>> JDK version to target.
>> 
>> We will refresh this PR periodically to pick up changes and fixes from the 
>> loom repo.
>> 
>> Most of the new mechanisms in the HotSpot VM are disabled by default and 
>> require running with `--enable-preview` to enable.
>> 
>> The patch has support for x64 and aarch64 on the usual operating systems 
>> (Linux, macOS, and Windows). There are stubs (calling Unimplemented) for 
>> zero and some of the other ports. Additional ports can be contributed via 
>> PRs against the fibers branch in the loom repo.
>> 
>> There are changes in many areas. To reduce notifications/mails, the labels 
>> have been trimmed down for now to hotspot, serviceability and core-libs. 
>> We'll add the complete set of labels when the PR is further along.
>> 
>> The changes include a refresh of java.util.concurrent and ForkJoinPool from 
>> Doug Lea's CVS. These changes will probably be proposed and integrated in 
>> advance of this PR.
>> 
>> The changes include some non-exposed and low-level infrastructure to support 
>> the (in draft) JEPs for Structured Concurrency and Scope Locals. This is to 
>> make life a bit easier and avoid having to separate VM changes and juggle 
>> branches at this time.
>
> Alan Bateman has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Refresh

src/java.base/share/classes/jdk/internal/vm/Continuation.java line 115:

> 113: }
> 114: 
> 115: private Runnable target;

Can be final? (Does not appear to be updated by the VM, or via unsafe by some 
other class)

-

PR: https://git.openjdk.java.net/jdk/pull/8166


Re: RFR: 8284161: Implementation of Virtual Threads (Preview) [v2]

2022-04-15 Thread Paul Sandoz
On Wed, 13 Apr 2022 14:21:20 GMT, Alan Bateman  wrote:

>> This is the implementation of JEP 425: Virtual Threads (Preview); TBD which 
>> JDK version to target.
>> 
>> We will refresh this PR periodically to pick up changes and fixes from the 
>> loom repo.
>> 
>> Most of the new mechanisms in the HotSpot VM are disabled by default and 
>> require running with `--enable-preview` to enable.
>> 
>> The patch has support for x64 and aarch64 on the usual operating systems 
>> (Linux, macOS, and Windows). There are stubs (calling Unimplemented) for 
>> zero and some of the other ports. Additional ports can be contributed via 
>> PRs against the fibers branch in the loom repo.
>> 
>> There are changes in many areas. To reduce notifications/mails, the labels 
>> have been trimmed down for now to hotspot, serviceability and core-libs. 
>> We'll add the complete set of labels when the PR is further along.
>> 
>> The changes include a refresh of java.util.concurrent and ForkJoinPool from 
>> Doug Lea's CVS. These changes will probably be proposed and integrated in 
>> advance of this PR.
>> 
>> The changes include some non-exposed and low-level infrastructure to support 
>> the (in draft) JEPs for Structured Concurrency and Scope Locals. This is to 
>> make life a bit easier and avoid having to separate VM changes and juggle 
>> branches at this time.
>
> Alan Bateman has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Refresh

src/java.base/share/classes/jdk/internal/vm/Continuation.java line 94:

> 92: default:
> 93: throw new AssertionError("Unknown pinned reason: " + 
> reason);
> 94: }

Suggestion:

return switch (reason) {
case 2 -> Pinned.CRITICAL_SECTION;
case 3 -> Pinned.NATIVE;
case 4 -> Pinned.MONITOR;
default -> throw new AssertionError("Unknown pinned reason: " + 
reason);
};

-

PR: https://git.openjdk.java.net/jdk/pull/8166


Re: RFR: 8284161: Implementation of Virtual Threads (Preview) [v2]

2022-04-15 Thread Paul Sandoz
On Wed, 13 Apr 2022 14:21:20 GMT, Alan Bateman  wrote:

>> This is the implementation of JEP 425: Virtual Threads (Preview); TBD which 
>> JDK version to target.
>> 
>> We will refresh this PR periodically to pick up changes and fixes from the 
>> loom repo.
>> 
>> Most of the new mechanisms in the HotSpot VM are disabled by default and 
>> require running with `--enable-preview` to enable.
>> 
>> The patch has support for x64 and aarch64 on the usual operating systems 
>> (Linux, macOS, and Windows). There are stubs (calling Unimplemented) for 
>> zero and some of the other ports. Additional ports can be contributed via 
>> PRs against the fibers branch in the loom repo.
>> 
>> There are changes in many areas. To reduce notifications/mails, the labels 
>> have been trimmed down for now to hotspot, serviceability and core-libs. 
>> We'll add the complete set of labels when the PR is further along.
>> 
>> The changes include a refresh of java.util.concurrent and ForkJoinPool from 
>> Doug Lea's CVS. These changes will probably be proposed and integrated in 
>> advance of this PR.
>> 
>> The changes include some non-exposed and low-level infrastructure to support 
>> the (in draft) JEPs for Structured Concurrency and Scope Locals. This is to 
>> make life a bit easier and avoid having to separate VM changes and juggle 
>> branches at this time.
>
> Alan Bateman has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Refresh

src/java.base/share/classes/jdk/internal/misc/ThreadTracker.java line 59:

> 57: && this.thread == other.thread;
> 58: }
> 59: }

Suggestion:

private record ThreadRef(Thread thread) {
@Override
public int hashCode() {
return Long.hashCode(thread.threadId());
}

@Override
public boolean equals(Object obj) {
return (obj instanceof ThreadRef other)
&& this.thread == other.thread;
}
}

-

PR: https://git.openjdk.java.net/jdk/pull/8166


Re: RFR: 8284161: Implementation of Virtual Threads (Preview) [v2]

2022-04-15 Thread Paul Sandoz
On Wed, 13 Apr 2022 14:21:20 GMT, Alan Bateman  wrote:

>> This is the implementation of JEP 425: Virtual Threads (Preview); TBD which 
>> JDK version to target.
>> 
>> We will refresh this PR periodically to pick up changes and fixes from the 
>> loom repo.
>> 
>> Most of the new mechanisms in the HotSpot VM are disabled by default and 
>> require running with `--enable-preview` to enable.
>> 
>> The patch has support for x64 and aarch64 on the usual operating systems 
>> (Linux, macOS, and Windows). There are stubs (calling Unimplemented) for 
>> zero and some of the other ports. Additional ports can be contributed via 
>> PRs against the fibers branch in the loom repo.
>> 
>> There are changes in many areas. To reduce notifications/mails, the labels 
>> have been trimmed down for now to hotspot, serviceability and core-libs. 
>> We'll add the complete set of labels when the PR is further along.
>> 
>> The changes include a refresh of java.util.concurrent and ForkJoinPool from 
>> Doug Lea's CVS. These changes will probably be proposed and integrated in 
>> advance of this PR.
>> 
>> The changes include some non-exposed and low-level infrastructure to support 
>> the (in draft) JEPs for Structured Concurrency and Scope Locals. This is to 
>> make life a bit easier and avoid having to separate VM changes and juggle 
>> branches at this time.
>
> Alan Bateman has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Refresh

src/java.base/share/classes/jdk/internal/misc/ThreadFlock.java line 262:

> 260:  * @return the thread, started
> 261:  * @throws IllegalStateException if this flock is shutdown or closed
> 262:  * @throws jdk.incubator.concurrent.StructureViolationException if 
> the current

Suggestion:

 * @throws WrongThreadException if the current thread is not the owner or a 
thread
 * contained in the flock
 * @throws jdk.incubator.concurrent.StructureViolationException if the 
current

-

PR: https://git.openjdk.java.net/jdk/pull/8166


Re: RFR: 8284161: Implementation of Virtual Threads (Preview) [v2]

2022-04-15 Thread Paul Sandoz
On Wed, 13 Apr 2022 14:21:20 GMT, Alan Bateman  wrote:

>> This is the implementation of JEP 425: Virtual Threads (Preview); TBD which 
>> JDK version to target.
>> 
>> We will refresh this PR periodically to pick up changes and fixes from the 
>> loom repo.
>> 
>> Most of the new mechanisms in the HotSpot VM are disabled by default and 
>> require running with `--enable-preview` to enable.
>> 
>> The patch has support for x64 and aarch64 on the usual operating systems 
>> (Linux, macOS, and Windows). There are stubs (calling Unimplemented) for 
>> zero and some of the other ports. Additional ports can be contributed via 
>> PRs against the fibers branch in the loom repo.
>> 
>> There are changes in many areas. To reduce notifications/mails, the labels 
>> have been trimmed down for now to hotspot, serviceability and core-libs. 
>> We'll add the complete set of labels when the PR is further along.
>> 
>> The changes include a refresh of java.util.concurrent and ForkJoinPool from 
>> Doug Lea's CVS. These changes will probably be proposed and integrated in 
>> advance of this PR.
>> 
>> The changes include some non-exposed and low-level infrastructure to support 
>> the (in draft) JEPs for Structured Concurrency and Scope Locals. This is to 
>> make life a bit easier and avoid having to separate VM changes and juggle 
>> branches at this time.
>
> Alan Bateman has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Refresh

src/java.base/share/classes/jdk/internal/misc/InternalLock.java line 46:

> 44: } else {
> 45: CAN_USE_INTERNAL_LOCK = true;
> 46: }

Suggestion:

CAN_USE_INTERNAL_LOCK = Boolean.getBoolean("jdk.io.useMonitors");

-

PR: https://git.openjdk.java.net/jdk/pull/8166


Re: RFR: 8284161: Implementation of Virtual Threads (Preview) [v2]

2022-04-15 Thread Paul Sandoz
On Wed, 13 Apr 2022 14:21:20 GMT, Alan Bateman  wrote:

>> This is the implementation of JEP 425: Virtual Threads (Preview); TBD which 
>> JDK version to target.
>> 
>> We will refresh this PR periodically to pick up changes and fixes from the 
>> loom repo.
>> 
>> Most of the new mechanisms in the HotSpot VM are disabled by default and 
>> require running with `--enable-preview` to enable.
>> 
>> The patch has support for x64 and aarch64 on the usual operating systems 
>> (Linux, macOS, and Windows). There are stubs (calling Unimplemented) for 
>> zero and some of the other ports. Additional ports can be contributed via 
>> PRs against the fibers branch in the loom repo.
>> 
>> There are changes in many areas. To reduce notifications/mails, the labels 
>> have been trimmed down for now to hotspot, serviceability and core-libs. 
>> We'll add the complete set of labels when the PR is further along.
>> 
>> The changes include a refresh of java.util.concurrent and ForkJoinPool from 
>> Doug Lea's CVS. These changes will probably be proposed and integrated in 
>> advance of this PR.
>> 
>> The changes include some non-exposed and low-level infrastructure to support 
>> the (in draft) JEPs for Structured Concurrency and Scope Locals. This is to 
>> make life a bit easier and avoid having to separate VM changes and juggle 
>> branches at this time.
>
> Alan Bateman has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Refresh

src/java.base/share/classes/jdk/internal/misc/Blocker.java line 118:

> 116: static long beginCompensatedBlock(ForkJoinPool pool) {
> 117: try {
> 118: return (long) beginCompensatedBlock.invoke(pool);

Suggestion:

return (long) beginCompensatedBlock.invokeExact(pool);

src/java.base/share/classes/jdk/internal/misc/Blocker.java line 126:

> 124: static void endCompensatedBlock(ForkJoinPool pool, long post) {
> 125: try {
> 126: endCompensatedBlock.invoke(pool, post);

Suggestion:

endCompensatedBlock.invokeExact(pool, post);

-

PR: https://git.openjdk.java.net/jdk/pull/8166


Re: RFR: 8284161: Implementation of Virtual Threads (Preview) [v2]

2022-04-14 Thread Paul Sandoz
On Wed, 13 Apr 2022 14:21:20 GMT, Alan Bateman  wrote:

>> This is the implementation of JEP 425: Virtual Threads (Preview); TBD which 
>> JDK version to target.
>> 
>> We will refresh this PR periodically to pick up changes and fixes from the 
>> loom repo.
>> 
>> Most of the new mechanisms in the HotSpot VM are disabled by default and 
>> require running with `--enable-preview` to enable.
>> 
>> The patch has support for x64 and aarch64 on the usual operating systems 
>> (Linux, macOS, and Windows). There are stubs (calling Unimplemented) for 
>> zero and some of the other ports. Additional ports can be contributed via 
>> PRs against the fibers branch in the loom repo.
>> 
>> There are changes in many areas. To reduce notifications/mails, the labels 
>> have been trimmed down for now to hotspot, serviceability and core-libs. 
>> We'll add the complete set of labels when the PR is further along.
>> 
>> The changes include a refresh of java.util.concurrent and ForkJoinPool from 
>> Doug Lea's CVS. These changes will probably be proposed and integrated in 
>> advance of this PR.
>> 
>> The changes include some non-exposed and low-level infrastructure to support 
>> the (in draft) JEPs for Structured Concurrency and Scope Locals. This is to 
>> make life a bit easier and avoid having to separate VM changes and juggle 
>> branches at this time.
>
> Alan Bateman has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Refresh

src/java.base/share/classes/java/lang/VirtualThread.java line 65:

> 63:  * system.
> 64:  */
> 65: class VirtualThread extends Thread {

Suggestion:

final class VirtualThread extends Thread {

src/java.base/share/classes/java/lang/VirtualThread.java line 94:

> 92:  *  RUNNING -> PARKING // Thread attempts to park
> 93:  *  PARKING -> PARKED  // yield successful, thread is parked
> 94:  *  PARKING -> PINNED  // yield failed, thread is pinned

Suggestion:

 *  PARKING -> PARKED  // parking successful, thread is parked
 *  PARKING -> PINNED  // parking failed, thread is pinned

-

PR: https://git.openjdk.java.net/jdk/pull/8166


Re: RFR: 8284161: Implementation of Virtual Threads (Preview) [v2]

2022-04-14 Thread Paul Sandoz
On Wed, 13 Apr 2022 14:21:20 GMT, Alan Bateman  wrote:

>> This is the implementation of JEP 425: Virtual Threads (Preview); TBD which 
>> JDK version to target.
>> 
>> We will refresh this PR periodically to pick up changes and fixes from the 
>> loom repo.
>> 
>> Most of the new mechanisms in the HotSpot VM are disabled by default and 
>> require running with `--enable-preview` to enable.
>> 
>> The patch has support for x64 and aarch64 on the usual operating systems 
>> (Linux, macOS, and Windows). There are stubs (calling Unimplemented) for 
>> zero and some of the other ports. Additional ports can be contributed via 
>> PRs against the fibers branch in the loom repo.
>> 
>> There are changes in many areas. To reduce notifications/mails, the labels 
>> have been trimmed down for now to hotspot, serviceability and core-libs. 
>> We'll add the complete set of labels when the PR is further along.
>> 
>> The changes include a refresh of java.util.concurrent and ForkJoinPool from 
>> Doug Lea's CVS. These changes will probably be proposed and integrated in 
>> advance of this PR.
>> 
>> The changes include some non-exposed and low-level infrastructure to support 
>> the (in draft) JEPs for Structured Concurrency and Scope Locals. This is to 
>> make life a bit easier and avoid having to separate VM changes and juggle 
>> branches at this time.
>
> Alan Bateman has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Refresh

src/java.base/share/classes/java/lang/Thread.java line 3028:

> 3026: 
> 3027: /** The thread container that this thread is in */
> 3028: @Stable private volatile ThreadContainer container;

The `volatile` modifier with `@Stable` is unusual. IIUC the field is set once 
on start (behaves as if a final field). Once C2 gets hold of it and can treat 
the value as a runtime constant the `volatile` has no effect. This is a tricky 
area but i think a store fence will suffice in `setThreadContainer` since the 
value goes from null to non-null and therefore cannot be speculated upon.

-

PR: https://git.openjdk.java.net/jdk/pull/8166


Re: RFR: 8284161: Implementation of Virtual Threads (Preview) [v2]

2022-04-14 Thread Paul Sandoz
On Wed, 13 Apr 2022 14:21:20 GMT, Alan Bateman  wrote:

>> This is the implementation of JEP 425: Virtual Threads (Preview); TBD which 
>> JDK version to target.
>> 
>> We will refresh this PR periodically to pick up changes and fixes from the 
>> loom repo.
>> 
>> Most of the new mechanisms in the HotSpot VM are disabled by default and 
>> require running with `--enable-preview` to enable.
>> 
>> The patch has support for x64 and aarch64 on the usual operating systems 
>> (Linux, macOS, and Windows). There are stubs (calling Unimplemented) for 
>> zero and some of the other ports. Additional ports can be contributed via 
>> PRs against the fibers branch in the loom repo.
>> 
>> There are changes in many areas. To reduce notifications/mails, the labels 
>> have been trimmed down for now to hotspot, serviceability and core-libs. 
>> We'll add the complete set of labels when the PR is further along.
>> 
>> The changes include a refresh of java.util.concurrent and ForkJoinPool from 
>> Doug Lea's CVS. These changes will probably be proposed and integrated in 
>> advance of this PR.
>> 
>> The changes include some non-exposed and low-level infrastructure to support 
>> the (in draft) JEPs for Structured Concurrency and Scope Locals. This is to 
>> make life a bit easier and avoid having to separate VM changes and juggle 
>> branches at this time.
>
> Alan Bateman has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Refresh

src/java.base/share/classes/java/lang/Thread.java line 213:

> 211: 
> 212: // Additional fields for platform threads
> 213: private static class FieldHolder {

All but the task field are explicitly known by the VM (and stillborn is not 
accessed by Java code. Suggest grouping accordingly.

-

PR: https://git.openjdk.java.net/jdk/pull/8166


Re: RFR: 8284161: Implementation of Virtual Threads (Preview) [v2]

2022-04-14 Thread Paul Sandoz
On Wed, 13 Apr 2022 14:21:20 GMT, Alan Bateman  wrote:

>> This is the implementation of JEP 425: Virtual Threads (Preview); TBD which 
>> JDK version to target.
>> 
>> We will refresh this PR periodically to pick up changes and fixes from the 
>> loom repo.
>> 
>> Most of the new mechanisms in the HotSpot VM are disabled by default and 
>> require running with `--enable-preview` to enable.
>> 
>> The patch has support for x64 and aarch64 on the usual operating systems 
>> (Linux, macOS, and Windows). There are stubs (calling Unimplemented) for 
>> zero and some of the other ports. Additional ports can be contributed via 
>> PRs against the fibers branch in the loom repo.
>> 
>> There are changes in many areas. To reduce notifications/mails, the labels 
>> have been trimmed down for now to hotspot, serviceability and core-libs. 
>> We'll add the complete set of labels when the PR is further along.
>> 
>> The changes include a refresh of java.util.concurrent and ForkJoinPool from 
>> Doug Lea's CVS. These changes will probably be proposed and integrated in 
>> advance of this PR.
>> 
>> The changes include some non-exposed and low-level infrastructure to support 
>> the (in draft) JEPs for Structured Concurrency and Scope Locals. This is to 
>> make life a bit easier and avoid having to separate VM changes and juggle 
>> branches at this time.
>
> Alan Bateman has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Refresh

src/java.base/share/classes/java/lang/Thread.java line 862:

> 860:  * @param start the starting value of the counter
> 861:  * @return this builder
> 862:  * @throws IllegalArgumentException if count is negative

Suggestion:

 * @throws IllegalArgumentException if start is negative

-

PR: https://git.openjdk.java.net/jdk/pull/8166


Re: RFR: 8272992: Replace usages of Collections.sort with List.sort call in jdk.* modules

2021-09-13 Thread Paul Sandoz
On Mon, 23 Aug 2021 21:08:05 GMT, Andrey Turbanov 
 wrote:

> Collections.sort is just a wrapper, so it is better to use an instance method 
> directly.

This looks a good change. Either as part of this PR or as a follow up I think 
it is worth reviewing the comparators passed to the sort method.

In some cases there is repetition and in other cases it may be possible to use 
`Comparator.comparing` or the primitive specialization.

-

PR: https://git.openjdk.java.net/jdk/pull/5230


Re: RFR: 8268698: Use Objects.check{Index, FromToIndex, FromIndexSize} where possible [v7]

2021-06-22 Thread Paul Sandoz
On Tue, 22 Jun 2021 02:58:28 GMT, Yi Yang  wrote:

> I found that after solving the problem that Preconditions cannot be used 
> during the VM startup, a series of functions such as 
> String.checkIndex/checkOffset/.. can also be harmlessly replaced, but this 
> changeset is somewhat large and may overwrite the previous review progress. 
> If it will confuse the current review progress for reviewers involving in 
> this PR, I'd like to file a new PR to do this change later.

Yes, I think that helps to review. It's often easier, review-wise, to have 
separate PRs for specific areas, rather than keep expanding an existing PR.

-

PR: https://git.openjdk.java.net/jdk/pull/4507


Re: RFR: 8268698: Use Objects.check{Index, FromToIndex, FromIndexSize} where possible [v6]

2021-06-21 Thread Paul Sandoz
On Mon, 21 Jun 2021 05:17:09 GMT, Yi Yang  wrote:

>> After JDK-8265518(#3615), it's possible to replace all variants of 
>> checkIndex by 
>> Objects.checkIndex/Objects.checkFromToIndex/Objects.checkFromIndexSize in 
>> the whole JDK codebase.
>
> Yi Yang has updated the pull request incrementally with one additional commit 
> since the last revision:
> 
>   more replacement 2

All the updates to the check* methods look ok (requires some careful looking!).

I cannot recall what others said about the change in exception messages. 
@jddarcy any advice here?

src/java.base/share/classes/jdk/internal/util/Preconditions.java line 78:

> 76: = Preconditions.outOfBoundsExceptionFormatter(new 
> StringIndexOutOfBoundsExceptionProducer());
> 77: 
> 78: public static final BiFunction, 
> StringIndexOutOfBoundsException> AIOOBE_FORMATTER

Using incorrect exception type. Suggest you embed as inner class rather than 
separate declaration, since they are only used in one place.

-

PR: https://git.openjdk.java.net/jdk/pull/4507


Re: RFR: 8268698: Use Objects.check{Index, FromToIndex, FromIndexSize} where possible [v2]

2021-06-18 Thread Paul Sandoz
On Fri, 18 Jun 2021 05:54:01 GMT, Yi Yang  wrote:

>> After JDK-8265518(#3615), it's possible to replace all variants of 
>> checkIndex by 
>> Objects.checkIndex/Objects.checkFromToIndex/Objects.checkFromIndexSize in 
>> the whole JDK codebase.
>
> Yi Yang has updated the pull request incrementally with one additional commit 
> since the last revision:
> 
>   restore IndexOfOufBoundsException; split exception line

@kahatlen for cases earlier in VM startup you need to avoid method references 
and lambda expressions. See the implementation of 
`outOfBoundsExceptionFormatter`, and see the usage in `VarHandle` for two 
examples.

Custom exception formaters should ideally be constants held in static final 
fields.

I think the API complexity comes down to whether it is necessary to preserve 
existing exception messages or not when converting existing code to use the 
precondition methods. The API is designed to do that and composes reasonably 
well for default exception messages with a non-default exceptions. We could 
argue (i would!) it is preferable to have a consistent exception messages for 
index out of bounds exceptions, thereby we could collapse and simplify, but 
this is sometimes considered a change in behaviour.

src/java.base/share/classes/java/util/Base64.java line 935:

> 933: throw new IOException("Stream is closed");
> 934: Preconditions.checkFromIndexSize(len, off, b.length,
> 935: 
> Preconditions.outOfBoundsExceptionFormatter(ArrayIndexOutOfBoundsException::new));

`outOfBoundsExceptionFormatter` will allocate. Store the result of 
`Preconditions.outOfBoundsExceptionFormatter(ArrayIndexOutOfBoundsException::new))`
 in a public static final on `Preconditions`, and replace the method ref with a 
inner class (thereby making it usable earlier at VM startup.

-

PR: https://git.openjdk.java.net/jdk/pull/4507


Re: RFR: 8268698: Use Objects.check{Index, FromToIndex, FromIndexSize} where possible

2021-06-17 Thread Paul Sandoz
On Thu, 17 Jun 2021 10:21:35 GMT, Alan Bateman  wrote:

>> After JDK-8265518(#3615), it's possible to replace all variants of 
>> checkIndex by 
>> Objects.checkIndex/Objects.checkFromToIndex/Objects.checkFromIndexSize in 
>> the whole JDK codebase.
>
> src/java.base/share/classes/java/util/Base64.java line 934:
> 
>> 932: if (closed)
>> 933: throw new IOException("Stream is closed");
>> 934: Preconditions.checkFromIndexSize(len, off, b.length, (xa, 
>> xb) -> new ArrayIndexOutOfBoundsException());
> 
> You might want to split this really long line too, to avoid inconsistent line 
> length in this source file.

I would suggest factoring out `(xa, xb) -> new 
ArrayIndexOutOfBoundsException()` as a reusable component on `Preconditions`, 
and maybe even supplying an exception message (since it is rather useful, and 
way better than no message).

See the usages of `Preconditions.outOfBoundsExceptionFormatter` (where there 
just happens to be many repeated cases of supplying AIOOBE with a message, that 
could also be consolidated, separate fix perhaps).

-

PR: https://git.openjdk.java.net/jdk/pull/4507


Re: Review Request: 8238358: Implementation of JEP 371: Hidden Classes

2020-04-14 Thread Paul Sandoz
Looks good to me (not familiar with all the code areas.

Minor suggestion:

MethodHandles.java

1811  * ASCII periods. For the instance of {@link java.lang.Class} 
representing {@code C}:
1812  * 
1813  *  {@link Class#getName()} returns the string {@code GN + "/" 
+ },
1814  *  even though this is not a valid binary class or interface 
name.
1815  *  {@link Class#descriptorString()} returns the string
1816  *  {@code "L" + N + ";" + "/" +  },
1817  *  even though this is not a valid type descriptor name.
1818  * 

Add another bullet:

“
even though this is not a valid type descriptor name; and

- therefore {@link Class#describeConstable} returns an empty {@code Optional}.
“

?

Paul.

> On Apr 11, 2020, at 8:13 PM, Mandy Chung  wrote:
> 
> Please review the delta patch:
> http://cr.openjdk.java.net/~mchung/valhalla/webrevs/hidden-classes/webrev.06-delta/
> 
> Incremental specdiff:
> http://cr.openjdk.java.net/~mchung/valhalla/webrevs/hidden-classes/specdiff-inc/overview-summary.html
> This is to follow a discussion [1] on Class::descriptorString and 
> MethodType::descriptorString for hidden classes.   The proposal is to define 
> the descriptor string for a hidden class of this form:
> "L" + N + ";" + "/" + 
> 
> The spec of `Lookup::defineHiddenClass`, `Class::descriptorString` and 
> `MethodType::descriptorString` are updated to return the descriptor of this 
> form for a hidden class.   To support hidden class, 
> `java.lang.invoke.TypeDescriptor` spec is revised such that a 
> `TypeDescriptor` object can represent an entity that may not be described in 
> nominal form. This change affects JVM TI, JDWP and JDI.The spec 
> change includes a couple other JVM TI and java.instrument spec clarification 
> w.r.t. hidden classes that Serguei has been working on.
> 
> 
> 
> Mandy
> [1] 
> https://mail.openjdk.java.net/pipermail/valhalla-dev/2020-April/007093.html
> 
> 
> As a record, the above patch is applied on the top:
> http://cr.openjdk.java.net/~mchung/valhalla/webrevs/hidden-classes/webrev.06/
> 
> webrev.06 includes the following changes that have been reviewed:
> 1. rename "weak hidden" and Klass::is_hidden_weak to is_non_strong_hidden
> 2. remove unused `setImplMethod` method from lambda proxy class
> 3. include Serguei's patch to fix JDK-8242166: regression in JDI ClassUnload 
> events
> 4. drop the uniqueness guarantee of the suffix of the hidden class's name
> 
> On 3/31/20 8:01 PM, Mandy Chung wrote:
>> Thanks to the review feedbacks.
>> 
>> Updated webrev:
>> http://cr.openjdk.java.net/~mchung/valhalla/webrevs/hidden-classes/webrev.04/
>>  
>> Delta between webrev.03 and webrev.04:
>> http://cr.openjdk.java.net/~mchung/valhalla/webrevs/hidden-classes/webrev.03-delta/
>>  
>> 
>> Summary of changes is:
>> 1. Update javac to retain the previous behavior when compiling to target 
>> release <= 14 where lambda proxy class is not a nestmate
>> 2. Rename Class::isHiddenClass to Class::isHidden
>> 3. Address Joe's feedback on the CSR to document the behavior of the 
>> relevant methods in java.lang.Class for hidden classes
>> 4. Add test case for unloadable class with nest host error
>> 5. Add test cases for hidden classes with different kinds of class or 
>> interface
>> 6. Update dcmd to drop "weak hidden class" and refer it as "hidden class"
>> 7. Small changes in response to Remi, Coleen, Paul's review comments
>> 8. Fix copyright headers
>> 9. Fix @modules in tests
>> 
>> Most of the changes above have also been reviewed as separate patches.
>> 
>> Thanks
>> Mandy
>> 
>> On 3/26/20 4:57 PM, Mandy Chung wrote:
>>> Please review the implementation of JEP 371: Hidden Classes. The main 
>>> changes are in core-libs and hotspot runtime area.  Small changes are made 
>>> in javac, VM compiler (intrinsification of Class::isHiddenClass), JFR, JDI, 
>>> and jcmd.  CSR [1]has been reviewed and is in the finalized state (see 
>>> specdiff and javadoc below for reference).
>>> 
>>> Webrev:
>>> http://cr.openjdk.java.net/~mchung/valhalla/webrevs/hidden-classes/webrev.03
>>>  
>>> 
>>> javadoc/specdiff
>>> http://cr.openjdk.java.net/~mchung/valhalla/webrevs/hidden-classes/api/
>>> http://cr.openjdk.java.net/~mchung/valhalla/webrevs/hidden-classes/specdiff/
>>>  
>>> 
>>> JVMS 5.4.4 change:
>>> http://cr.openjdk.java.net/~mchung/valhalla/webrevs/hidden-classes/Draft-JVMS-HiddenClasses.pdf
>>>  
>>> 
>>> CSR:
>>> https://bugs.openjdk.java.net/browse/JDK-8238359
>>> 
>>> Thanks
>>> Mandy
>>> [1] https://bugs.openjdk.java.net/browse/JDK-8238359
>>> [2] https://bugs.openjdk.java.net/browse/JDK-8240338
>>> [3] https://bugs.openjdk.java.net/browse/JDK-8230502
>> 
> 



Re: Review Request: 8238358: Implementation of JEP 371: Hidden Classes

2020-03-27 Thread Paul Sandoz
+1
Paul.

> On Mar 27, 2020, at 3:22 PM, Mandy Chung  wrote:
> 
> Hi Paul,
> 
> This is the delta incorporating your comment:
>   
> http://cr.openjdk.java.net/~mchung/valhalla/webrevs/hidden-classes/webrev.03-delta-psandoz/
>  
> 
> 
> This patch also took Alex's comment to make it clear that the hidden class is 
> the lookup class of the returned Lookup object and drops the sentence you 
> commented on:
> 
> On 3/27/20 1:18 PM, Mandy Chung wrote:
>>> MethodHandles.java 
>>> — 
>>> 
>>> 1786  * (Given the {@code Lookup} object returned this method, its 
>>> lookup class 
>>> 1787  * is a {@code Class} object for which {@link Class#getName()} 
>>> returns a string 
>>> 1788  * that is not a binary name.) 
>>> 
>>> “ 
>>> (The {@code Lookup} object returned from this method has a lookup class 
>>> that is 
>>> a {@code Class} object whose {@link Class#getName()} returns a string 
>>> that is not a binary name.) 
>>> “ 
> 
> 
> Mandy



Re: Review Request: 8238358: Implementation of JEP 371: Hidden Classes

2020-03-27 Thread Paul Sandoz
Hi Mandy,

Very thorough, bravo!

Minor suggestions below.

Paul.

MethodHandleNatives.java
—

 142 
 143 /**
 144  * Flags for Lookup.ClassOptions
 145  */
 146 static final int
 147 NESTMATE_CLASS= 0x0001,
 148 HIDDEN_CLASS  = 0x0002,
 149 STRONG_LOADER_LINK= 0x0004,
 150 ACCESS_VM_ANNOTATIONS = 0x0008;
 151 }
 

Suggest you add a comment to keep the values in sync with the VM component.


MethodHandles.java
—

1786  * (Given the {@code Lookup} object returned this method, its 
lookup class
1787  * is a {@code Class} object for which {@link Class#getName()} 
returns a string
1788  * that is not a binary name.)

“
(The {@code Lookup} object returned from this method has a lookup class that is 
a {@code Class} object whose {@link Class#getName()} returns a string
that is not a binary name.)
“


1902 Set opts = options.length > 0 ? Set.of(options) : 
Set.of();

You can just do:

  Set opts = Set.of(options)

And/or inline it into the subsequent method call.  The implementation of Set.of 
checks the array length.


2001 ClassDefiner makeHiddenClassDefiner(byte[] bytes,

I think you can telescope the methods for non-name and name accepting since 
IIUC the name is derived from the byte[].  Thereby you can remove some code 
duplication. i.e. pull ClassDefiner.className out from ClassDefiner and place 
the logic in the factory methods.  Alternative push the factory methods into 
ClassDefiner to keep all the logic together.



3797 public enum ClassOption {

Shuffle up to be closer to the defineHiddenClass


3798 /**
3799  * This class option specifies the hidden class be added to
3800  * {@linkplain Class#getNestHost nest} of a lookup class as
3801  * a nestmate.

Suggest:

"This class option specifies the hidden class “ -> “Specifies that a hidden 
class 


3812  * This class option specifies the hidden class to have a 
strong

“Specifies that a hidden class have a …"


3813  * relationship with the class loader marked as its defining 
loader,
3814  * as a normal class or interface has with its own defining 
loader.
3815  * This means that the hidden class may be unloaded if and 
only if
3816  * its defining loader is not reachable and thus may be 
reclaimed
3817  * by a garbage collector (JLS 12.7).


StringConcatFactory.java
—

 861 // use of @ForceInline no longer has any effect

?

 862 mv.visitAnnotation("Ljdk/internal/vm/annotation/ForceInline;", 
true);
 863 mv.visitCode();





> On Mar 26, 2020, at 4:57 PM, Mandy Chung  wrote:
> 
> Please review the implementation of JEP 371: Hidden Classes. The main changes 
> are in core-libs and hotspot runtime area.  Small changes are made in javac, 
> VM compiler (intrinsification of Class::isHiddenClass), JFR, JDI, and jcmd.  
> CSR [1]has been reviewed and is in the finalized state (see specdiff and 
> javadoc below for reference).
> 
> Webrev:
> http://cr.openjdk.java.net/~mchung/valhalla/webrevs/hidden-classes/webrev.03
> 
> Hidden class is created via `Lookup::defineHiddenClass`. From JVM's point
> of view, a hidden class is a normal class except the following:
> 
> - A hidden class has no initiating class loader and is not registered in any 
> dictionary.
> - A hidden class has a name containing an illegal character `Class::getName` 
> returns `p.Foo/0x1234` whereas `GetClassSignature` returns "Lp/Foo.0x1234;".
> - A hidden class is not modifiable, i.e. cannot be redefined or 
> retransformed. JVM TI IsModifableClass returns false on a hidden.
> - Final fields in a hidden class is "final".  The value of final fields 
> cannot be overriden via reflection.  setAccessible(true) can still be called 
> on reflected objects representing final fields in a hidden class and its 
> access check will be suppressed but only have read-access (i.e. can do 
> Field::getXXX but not setXXX).
> 
> Brief summary of this patch:
> 
> 1. A new Lookup::defineHiddenClass method is the API to create a hidden class.
> 2. A new Lookup.ClassOption enum class defines NESTMATE and STRONG option that
>can be specified when creating a hidden class.
> 3. A new Class::isHiddenClass method tests if a class is a hidden class.
> 4. Field::setXXX method will throw IAE on a final field of a hidden class
>regardless of the value of the accessible flag.
> 5. JVM_LookupDefineClass is the new JVM entry point for Lookup::defineClass
>and defineHiddenClass to create a class from the given bytes.
> 6. ClassLoaderData implementation is not changed.  There is one primary CLD
>that holds the classes strongly referenced by its defining loader.  There
>can be zero or more additional CLDs - one per weak class.
> 7. Nest host determination is updated 

Re: RFR [9] 8153737: Unsupported Module

2016-04-08 Thread Paul Sandoz

> On 7 Apr 2016, at 19:14, Chris Hegarty  wrote:
> 
> Enough technical debt has been paid down that we can now create the new
> JDK-specific module as proposed by JEP 260 [1], named jdk.unsupported.
> This module will initially contain, and export, the sun.misc package,
> and will eventually export the sun.reflect package too ( once it has
> been sanitized ). The jdk.unsupported module will be present in full JRE
> and JDK images.
> 

And in the modular world it’s necessary to explicitly declare a requirement on 
idk.unsupported.


> http://cr.openjdk.java.net/~chegar/8153737/
> https://bugs.openjdk.java.net/browse/JDK-8153737
> 

+1

An important milestone.

Paul.


signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: JDK-8041679 Replace uses of StringBuffer with StringBuilder within the JDK

2014-05-13 Thread Paul Sandoz

On May 12, 2014, at 1:00 PM, Ivan Gerasimov ivan.gerasi...@oracle.com wrote:

 src/share/classes/sun/misc/UUDecoder.java
 126 StringBuilder x = new StringBuilder();
 Is only filled, but doesn't seem to be used anyhow.
 Maybe just delete it?
 

Thanks, i will take a look at this and your other change once 
s/StringBuffer/StringBuilder/g is out of the way.

Paul.



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: JDK-8041679 Replace uses of StringBuffer with StringBuilder within the JDK

2014-05-13 Thread Paul Sandoz

On May 12, 2014, at 4:07 PM, Daniel Fuchs daniel.fu...@oracle.com wrote:

 Hi Paul,
 
 I looked at -management and the changes there look good.
 
 There is just some two spaces vs four space formatting in
 http://cr.openjdk.java.net/~psandoz/jdk9/sb/JDK-8041679-buffer-to-builder-management/webrev/src/share/classes/com/sun/jndi/cosnaming/CNNameParser.java.frames.html
 line 99.
 

Thanks, updated.

Paul.


signature.asc
Description: Message signed with OpenPGP using GPGMail


JDK-8041679 Replace uses of StringBuffer with StringBuilder within the JDK

2014-05-12 Thread Paul Sandoz
Hi,

This is a request for review of Otavio's patch replacing StringBuffer with 
StringBuilder within OpenJDK. (I also need to review it.)

It covers many areas and i have grouped the patches into such areas to aid 
reviewing. When commenting please including core-libs.

Jtreg tests showed no regressions, but when reviewing we need to be mindful of 
the context e.g. if the buffer escapes and can cross thread boundaries. 

This is also an experiment to see if we can review the whole thing under one 
bug :-) if things prove problematic and slow we can split it out. Many files 
are touched but there are not many changes to each file and changes are very 
formulaic.

I have also included ASM related changes, but i suspect we may have to leave 
those alone since such changes will make it more difficult to pull in ASM from 
upstream.
 
-

Otavio, for the record can you reply to this thread posting your single 
(uber) patch as textual attachment? (IIUC such attachments should now be 
supported by the email server).

Paul.

- core
http://cr.openjdk.java.net/~psandoz/jdk9/sb/JDK-8041679-buffer-to-builder-core/webrev/

- io
http://cr.openjdk.java.net/~psandoz/jdk9/sb/JDK-8041679-buffer-to-builder-io/webrev/

- management
http://cr.openjdk.java.net/~psandoz/jdk9/sb/JDK-8041679-buffer-to-builder-management/webrev/

- rmi
http://cr.openjdk.java.net/~psandoz/jdk9/sb/JDK-8041679-buffer-to-builder-rmi/webrev/

- security
http://cr.openjdk.java.net/~psandoz/jdk9/sb/JDK-8041679-buffer-to-builder-security/webrev/


- tools
http://cr.openjdk.java.net/~psandoz/jdk9/sb/JDK-8041679-buffer-to-builder-tools/webrev/


- graphics/media
http://cr.openjdk.java.net/~psandoz/jdk9/sb/JDK-8041679-buffer-to-builder-media/webrev/


- asm
http://cr.openjdk.java.net/~psandoz/jdk9/sb/JDK-8041679-buffer-to-builder-asm/webrev/


signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: JDK-8041679 Replace uses of StringBuffer with StringBuilder within the JDK

2014-05-12 Thread Paul Sandoz

On May 12, 2014, at 12:42 PM, Alan Bateman alan.bate...@oracle.com wrote:

 On 12/05/2014 11:03, Paul Sandoz wrote:
 
 It covers many areas and i have grouped the patches into such areas to aid 
 reviewing. When commenting please including core-libs.
 The groupings are a bit odd

Yeah, definitely idiosyncratic, i tried to lump 'em in terms of areas where 
people could focus their expertise without creating too few or too many webrevs.


 but I looked through the -core, -io, -management and -rmi patches and don't 
 see any issues.

Thanks!


 Nothing jumped out to suggest that the StringBuffer could be leaked to other 
 threads. There are a few cases where additional work could be done but I 
 assume you want to focus on s/StringBuffer/StringBuilder/g.
 

It might be worth fixing those if they are not too disruptive.


 You might want to hear from Remi or Kumar before including asm. I mention it 
 because there might be preference to get changes to ASM done upstream to 
 avoid the copy in OpenJDK from diverging.
 

Yes.


 As a general point then I don't see any reason why this can't be one 
 change-set. Periodically it makes sense to do a coarse grain split, say core 
 + client but shouldn't be necessary here, unless of course there is some 
 major refactoring or other big changes in, or coming soon to, jdk9/client. A 
 coarse grain split just reduced the need for merging when sync'ing up 
 integration forests.
 

Ok.


 One minor comment is that refactoring where you change the name of the local 
 can sometimes impact the alignment of statement that span several lines. 
 VMID.toString is the only one that I noticed here and it's no big deal.
 

I fixed that.

Paul.



signature.asc
Description: Message signed with OpenPGP using GPGMail


hg: jdk8/tl/jdk: 4 new changesets

2014-01-31 Thread paul . sandoz
Changeset: 9f098aed44c0
Author:anazarov
Date:  2014-01-31 12:01 +0100
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/9f098aed44c0

8032025: Update repeating annotations demo
Reviewed-by: jfranck

+ 
src/share/sample/annotations/DependencyChecker/PluginChecker/src/checker/Device.java
+ 
src/share/sample/annotations/DependencyChecker/PluginChecker/src/checker/Kettle.xml
+ 
src/share/sample/annotations/DependencyChecker/PluginChecker/src/checker/Module.java
+ 
src/share/sample/annotations/DependencyChecker/PluginChecker/src/checker/PluginChecker.java
+ 
src/share/sample/annotations/DependencyChecker/PluginChecker/src/checker/Require.java
+ 
src/share/sample/annotations/DependencyChecker/PluginChecker/src/checker/RequireContainer.java
+ 
src/share/sample/annotations/DependencyChecker/Plugins/src/plugins/BoilerPlugin.java
+ 
src/share/sample/annotations/DependencyChecker/Plugins/src/plugins/ExtendedBoilerPlugin.java
+ 
src/share/sample/annotations/DependencyChecker/Plugins/src/plugins/TimerPlugin.java
+ src/share/sample/annotations/Validator/src/PositiveIntegerSupplier.java
+ src/share/sample/annotations/Validator/src/SupplierValidator.java
+ src/share/sample/annotations/Validator/src/Validate.java
+ src/share/sample/annotations/Validator/src/Validator.java
+ src/share/sample/annotations/index.html

Changeset: f72a8df6a2ed
Author:anazarov
Date:  2014-01-31 12:01 +0100
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/f72a8df6a2ed

8031650: Update bulk operation demo
Reviewed-by: psandoz, mduigou

+ src/share/sample/lambda/BulkDataOperations/index.html
+ src/share/sample/lambda/BulkDataOperations/src/CSVProcessor.java
+ src/share/sample/lambda/BulkDataOperations/src/Grep.java
+ src/share/sample/lambda/BulkDataOperations/src/PasswordGenerator.java
+ src/share/sample/lambda/BulkDataOperations/src/WC.java

Changeset: 4574011c1689
Author:anazarov
Date:  2014-01-31 12:01 +0100
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/4574011c1689

8032020: Update try-with-resources demo
Reviewed-by: darcy, alanb, smarks

+ src/share/sample/try-with-resources/index.html
+ src/share/sample/try-with-resources/src/CustomAutoCloseableSample.java
+ src/share/sample/try-with-resources/src/Unzip.java
+ src/share/sample/try-with-resources/src/ZipCat.java

Changeset: a4f68fc5f353
Author:psandoz
Date:  2014-01-31 12:01 +0100
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/a4f68fc5f353

8032056: Create demo to illustrate new practices of the default methods usage
Reviewed-by: briangoetz, rfield, psandoz
Contributed-by: taras.led...@oracle.com

+ src/share/sample/lambda/DefaultMethods/ArrayIterator.java
+ src/share/sample/lambda/DefaultMethods/DiamondInheritance.java
+ src/share/sample/lambda/DefaultMethods/Inheritance.java
+ src/share/sample/lambda/DefaultMethods/MixIn.java
+ src/share/sample/lambda/DefaultMethods/Reflection.java
+ src/share/sample/lambda/DefaultMethods/SimplestUsage.java



hg: jdk8/tl/jdk: 8032190: Specifications of stream flatMap methods should require mapped streams to be closed

2014-01-23 Thread paul . sandoz
Changeset: 68eb0c55a8c0
Author:psandoz
Date:  2014-01-21 10:49 +0100
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/68eb0c55a8c0

8032190: Specifications of stream flatMap methods should require mapped streams 
to be closed
Reviewed-by: chegar, alanb

! 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



hg: jdk8/tl/jdk: 8028564: Concurrent calls to CHM.put can fail to add the key/value to the map

2013-12-05 Thread paul . sandoz
Changeset: dc2f0c40399a
Author:psandoz
Date:  2013-12-05 09:44 +0100
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/dc2f0c40399a

8028564: Concurrent calls to CHM.put can fail to add the key/value to the map
Reviewed-by: psandoz, chegar, alanb
Contributed-by: Doug Lea d...@cs.oswego.edu

! src/share/classes/java/util/concurrent/ConcurrentHashMap.java
+ test/java/util/concurrent/ConcurrentHashMap/ConcurrentAssociateTest.java
+ test/java/util/concurrent/ConcurrentHashMap/ConcurrentContainsKeyTest.java



hg: jdk8/tl/jdk: 8029164: Race condition in CompletableFuture.thenCompose with asynchronous task

2013-12-04 Thread paul . sandoz
Changeset: 2aa455506c49
Author:psandoz
Date:  2013-12-04 10:27 +0100
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/2aa455506c49

8029164: Race condition in CompletableFuture.thenCompose with asynchronous task
Reviewed-by: dl, chegar, mduigou

! src/share/classes/java/util/concurrent/CompletableFuture.java
+ test/java/util/concurrent/CompletableFuture/ThenComposeAsyncTest.java



hg: jdk8/tl/jdk: 8028516: Java doc error in Int/Long/Double/Stream.peek

2013-11-25 Thread paul . sandoz
Changeset: 1f45b24ffe4b
Author:psandoz
Date:  2013-11-25 09:55 +0100
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/1f45b24ffe4b

8028516: Java doc error in Int/Long/Double/Stream.peek
Reviewed-by: chegar

! 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



hg: jdk8/tl/jdk: 8027712: DistinctOpTest fails for unordered test

2013-11-05 Thread paul . sandoz
Changeset: d5b3f83ffc40
Author:psandoz
Date:  2013-11-05 12:08 +0100
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/d5b3f83ffc40

8027712: DistinctOpTest fails for unordered test
Reviewed-by: henryjen, alanb

! 
test/java/util/stream/test/org/openjdk/tests/java/util/stream/DistinctOpTest.java



Re: Codereview request: 8026028 [findbugs] findbugs report some issue in com.sun.jmx.snmp package

2013-10-17 Thread Paul Sandoz

On Oct 16, 2013, at 3:58 PM, shanliang shanliang.ji...@oracle.com wrote:

 Hi,
 
 Please review the following fix, main issue here is that we should clone an 
 internal variable before returning.
 
 webrev:
 http://cr.openjdk.java.net/~sjiang/JDK-8026028/00/
 
 bug
 https://bugs.openjdk.java.net/browse/JDK-8026028
 

+1.

Paul.


signature.asc
Description: Message signed with OpenPGP using GPGMail


hg: jdk8/tl/jdk: 8020061: Clarify reporting characteristics between splits

2013-10-09 Thread paul . sandoz
Changeset: 1cd20806fd5c
Author:psandoz
Date:  2013-10-09 15:19 +0200
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/1cd20806fd5c

8020061: Clarify reporting characteristics between splits
Reviewed-by: alanb, chegar

! src/share/classes/java/util/Spliterator.java



hg: jdk8/tl/jdk: 8025136: SplittableRandom enchancements

2013-10-08 Thread paul . sandoz
Changeset: b90dcd1a71bf
Author:psandoz
Date:  2013-10-08 11:17 +0200
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/b90dcd1a71bf

8025136: SplittableRandom enchancements
Reviewed-by: psandoz, martin
Contributed-by: Doug Lea d...@cs.oswego.edu, Guy Steele 
guy.ste...@oracle.com

! src/share/classes/java/util/Random.java
! src/share/classes/java/util/SplittableRandom.java
! src/share/classes/java/util/concurrent/ThreadLocalRandom.java



hg: jdk8/tl/jdk: 2 new changesets

2013-10-03 Thread paul . sandoz
Changeset: 811c35a6a58f
Author:psandoz
Date:  2013-10-02 16:34 +0200
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/811c35a6a58f

8025534: Unsafe typecast in java.util.stream.Streams.Nodes
8025538: Unsafe typecast in java.util.stream.SpinedBuffer
8025533: Unsafe typecast in 
java.util.stream.Streams.RangeIntSpliterator.splitPoint()
8025525: Unsafe typecast in java.util.stream.Node.OfPrimitive.asArray()
Reviewed-by: chegar

! src/share/classes/java/util/stream/Node.java
! src/share/classes/java/util/stream/Nodes.java
! src/share/classes/java/util/stream/SortedOps.java
! src/share/classes/java/util/stream/SpinedBuffer.java
! src/share/classes/java/util/stream/Streams.java

Changeset: c55a7941050c
Author:psandoz
Date:  2013-10-03 10:59 +0200
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/c55a7941050c

8025567: Mark relevant public stream tests as serialization hostile
Reviewed-by: alanb

! 
test/java/util/stream/test/org/openjdk/tests/java/util/stream/ForEachOpTest.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/StreamBuilderTest.java
! 
test/java/util/stream/test/org/openjdk/tests/java/util/stream/ToArrayOpTest.java



hg: jdk8/tl/jdk: 8025535: Unsafe typecast in java.util.stream.SortedOps

2013-10-02 Thread paul . sandoz
Changeset: e1b04fd49204
Author:psandoz
Date:  2013-10-01 18:20 +0200
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/e1b04fd49204

8025535: Unsafe typecast in java.util.stream.SortedOps
Reviewed-by: mduigou, chegar

! src/share/classes/java/util/stream/SortedOps.java
! 
test/java/util/stream/test/org/openjdk/tests/java/util/stream/SortedOpTest.java



hg: jdk8/tl/jdk: 8024341: j.u.regex.Pattern.splitAsStream() doesn't correspond to split() method if using an example from the spec

2013-09-20 Thread paul . sandoz
Changeset: c30dc8e7744e
Author:psandoz
Date:  2013-09-20 17:11 -0700
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/c30dc8e7744e

8024341: j.u.regex.Pattern.splitAsStream() doesn't correspond to split() method 
if using an example from the spec
Reviewed-by: alanb

! src/share/classes/java/util/regex/Pattern.java
+ test/java/util/regex/PatternStreamTest.java
- test/java/util/regex/PatternTest.java



hg: jdk8/tl/jdk: 8025002: .codePoints().sorted().iterator().hasNext() causes NegativeArraySizeException

2013-09-19 Thread paul . sandoz
Changeset: f36714707c38
Author:psandoz
Date:  2013-09-18 10:49 -0700
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/f36714707c38

8025002: .codePoints().sorted().iterator().hasNext() causes 
NegativeArraySizeException
Reviewed-by: henryjen, alanb

! src/share/classes/java/lang/CharSequence.java
! test/java/lang/CharSequence/DefaultTest.java



hg: jdk8/tl/jdk: 8024405: Spliterators.spliterator should support CONCURRENT characteristic

2013-09-19 Thread paul . sandoz
Changeset: 0ef7ddef9de0
Author:psandoz
Date:  2013-09-19 20:41 -0700
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/0ef7ddef9de0

8024405: Spliterators.spliterator should support CONCURRENT characteristic
Reviewed-by: martin

! src/share/classes/java/util/Spliterator.java
! src/share/classes/java/util/Spliterators.java
! test/java/util/Spliterator/SpliteratorCharacteristics.java
! test/java/util/Spliterator/SpliteratorTraversingAndSplittingTest.java



hg: jdk8/tl/jdk: 8024182: test/java/util/Arrays/SetAllTest.java fails to compile due to recent compiler changes

2013-09-04 Thread paul . sandoz
Changeset: 462c5589bc1a
Author:psandoz
Date:  2013-08-12 12:22 +0200
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/462c5589bc1a

8024182: test/java/util/Arrays/SetAllTest.java fails to compile due to recent 
compiler changes
Summary: Use explicit lambda due to javac simplfying rules for overload 
resolution with implicit lambdas
Reviewed-by: alanb, mduigou

! test/java/util/Arrays/SetAllTest.java



hg: jdk8/tl/jdk: 8023463: Improvements to HashMap/LinkedHashMap use of bins/buckets and trees (red/black); ...

2013-09-04 Thread paul . sandoz
Changeset: d62c911aebbb
Author:psandoz
Date:  2013-09-04 09:34 +0200
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/d62c911aebbb

8023463: Improvements to HashMap/LinkedHashMap use of bins/buckets and trees 
(red/black)
8012913: LinkedHashMap key/value/entry spliterators should report ORDERED
Reviewed-by: mduigou, forax, bchristi, alanb
Contributed-by: Doug Lea d...@cs.oswego.edu, Paul Sandoz 
paul.san...@oracle.com

! src/share/classes/java/util/HashMap.java
! src/share/classes/java/util/LinkedHashMap.java
! test/java/lang/reflect/Generics/Probe.java
! test/java/util/Map/CheckRandomHashSeed.java
! test/java/util/Map/InPlaceOpsCollisions.java
+ test/java/util/Map/MapBinToFromTreeTest.java
- test/java/util/Map/TreeBinSplitBackToEntries.java
! test/java/util/Spliterator/SpliteratorCharacteristics.java



hg: jdk8/tl/jdk: 8023155: Ensure functional consistency across Random, ThreadLocalRandom, SplittableRandom

2013-08-28 Thread paul . sandoz
Changeset: b1f41565b806
Author:psandoz
Date:  2013-08-28 22:11 +0200
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/b1f41565b806

8023155: Ensure functional consistency across Random, ThreadLocalRandom, 
SplittableRandom
Reviewed-by: mduigou
Contributed-by: Doug Lea d...@cs.oswego.edu, Paul Sandoz 
paul.san...@oracle.com

! src/share/classes/java/util/Random.java
! src/share/classes/java/util/concurrent/ThreadLocalRandom.java
! test/java/util/Random/RandomStreamTest.java
+ test/java/util/Random/RandomTest.java
! test/java/util/SplittableRandom/SplittableRandomTest.java
+ test/java/util/concurrent/ThreadLocalRandom/ThreadLocalRandomTest.java



hg: jdk8/tl/jdk: 8023234: StampedLock serializes readers on writer unlock

2013-08-26 Thread paul . sandoz
Changeset: 8a36fc7f494c
Author:shade
Date:  2013-08-26 17:50 +0400
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/8a36fc7f494c

8023234: StampedLock serializes readers on writer unlock
Summary: Sync-up the fix from jsr166 CVS, signal more readers on writer unlock
Reviewed-by: martin, shade
Contributed-by: Doug Lea d...@cs.oswego.edu

! src/share/classes/java/util/concurrent/locks/StampedLock.java
+ test/java/util/concurrent/locks/StampedLock/ReadersUnlockAfterWriteUnlock.java



hg: jdk8/tl/jdk: 8020292: j.u.SplittableRandom

2013-08-26 Thread paul . sandoz
Changeset: 5ce9025c9e1a
Author:psandoz
Date:  2013-08-26 22:55 +0200
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/5ce9025c9e1a

8020292: j.u.SplittableRandom
Reviewed-by: mduigou
Contributed-by: Guy Steele guy.ste...@oracle.com, Doug Lea 
d...@cs.oswego.edu, Brian Goetz brian.go...@oracle.com, Paul Sandoz 
paul.san...@oracle.com

+ src/share/classes/java/util/SplittableRandom.java
+ test/java/util/SplittableRandom/SplittableRandomTest.java
+ 
test/java/util/stream/test/org/openjdk/tests/java/util/SplittableRandomTest.java



hg: jdk8/tl/jdk: 8023367: Collections.emptyList().sort((Comparator)null) throws NPE

2013-08-20 Thread paul . sandoz
Changeset: c17d6543b30f
Author:psandoz
Date:  2013-08-20 17:36 +0200
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/c17d6543b30f

8023367: Collections.emptyList().sort((Comparator)null) throws NPE
Reviewed-by: alanb, mduigou

! src/share/classes/java/util/Collections.java
! test/java/util/Collection/ListDefaults.java



hg: jdk8/tl/jdk: 8022318: Document Spliterator characteristics and binding policy of java util concurrent collection impls

2013-08-19 Thread paul . sandoz
Changeset: 9e9f5713b26d
Author:psandoz
Date:  2013-08-06 14:26 +0100
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/9e9f5713b26d

8022318: Document Spliterator characteristics and binding policy of java util 
concurrent collection impls
Reviewed-by: chegar
Contributed-by: Martin Buchholz marti...@google.com, Paul Sandoz 
paul.san...@oracle.com

! src/share/classes/java/util/concurrent/ArrayBlockingQueue.java
! src/share/classes/java/util/concurrent/ConcurrentHashMap.java
! src/share/classes/java/util/concurrent/ConcurrentLinkedDeque.java
! src/share/classes/java/util/concurrent/ConcurrentLinkedQueue.java
! src/share/classes/java/util/concurrent/ConcurrentNavigableMap.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/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
! src/share/classes/java/util/concurrent/package-info.java



hg: jdk8/tl/jdk: 8014824: Document Spliterator characteristics and binding policy of java util collection impls

2013-08-19 Thread paul . sandoz
Changeset: 3647aab7b1d5
Author:psandoz
Date:  2013-08-06 14:26 +0100
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/3647aab7b1d5

8014824: Document Spliterator characteristics and binding policy of java util 
collection impls
Reviewed-by: chegar

! src/share/classes/java/util/ArrayDeque.java
! src/share/classes/java/util/ArrayList.java
! src/share/classes/java/util/HashSet.java
! src/share/classes/java/util/LinkedHashMap.java
! src/share/classes/java/util/LinkedHashSet.java
! src/share/classes/java/util/LinkedList.java
! src/share/classes/java/util/List.java
! src/share/classes/java/util/PriorityQueue.java
! src/share/classes/java/util/Set.java
! src/share/classes/java/util/SortedSet.java
! src/share/classes/java/util/Spliterator.java
! src/share/classes/java/util/TreeMap.java
! src/share/classes/java/util/TreeSet.java
! src/share/classes/java/util/Vector.java



hg: jdk8/tl/jdk: 8023150: java/util/stream tests no longer compiling following JDK-8019401

2013-08-16 Thread paul . sandoz
Changeset: 5fe19566b6f0
Author:psandoz
Date:  2013-08-16 12:29 +0200
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/5fe19566b6f0

8023150: java/util/stream tests no longer compiling following JDK-8019401
Reviewed-by: alanb

! 
test/java/util/stream/test/org/openjdk/tests/java/util/stream/TabulatorsTest.java



hg: jdk8/tl/jdk: 2 new changesets

2013-08-16 Thread paul . sandoz
Changeset: 2eebaff52a94
Author:psandoz
Date:  2013-08-16 12:46 +0200
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/2eebaff52a94

8012940: More than 50 tests failed in Serialization/DeSerialization testing 
(test-mangled)
Reviewed-by: ksrini

+ test/java/util/stream/bootlib/java/util/stream/LambdaTestMode.java
! test/java/util/stream/bootlib/java/util/stream/StreamTestDataProvider.java

Changeset: 02ce5a0e4b98
Author:psandoz
Date:  2013-08-16 12:46 +0200
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/02ce5a0e4b98

8022898: java/util/Spliterator/SpliteratorCollisions.java fails in 
HashableIntSpliteratorWithNull data provider
Reviewed-by: henryjen, alanb, rriggs

! test/java/util/Spliterator/SpliteratorCollisions.java



hg: jdk8/tl/jdk: 8022797: Clarify spliterator characteristics for collections containing no elements

2013-08-16 Thread paul . sandoz
Changeset: 737b6c298d81
Author:psandoz
Date:  2013-08-13 11:16 +0200
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/737b6c298d81

8022797: Clarify spliterator characteristics for collections containing no 
elements
Reviewed-by: alanb, mduigou

! src/share/classes/java/util/Collection.java



hg: jdk8/tl/jdk: 8021863: Stream.concat incorrectly calculates unsized state

2013-07-31 Thread paul . sandoz
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



hg: jdk8/tl/jdk: 8021883: j.u.Random/RandomStream.java test needs more robust timeout duration

2013-07-31 Thread paul . sandoz
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



hg: jdk8/tl/jdk: 8020156: TreeMap.values().spliterator() does not report ORDERED; ...

2013-07-29 Thread paul . sandoz
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



hg: jdk8/tl/jdk: 8019395: Consolidate StreamSupport.{stream, parallelStream} into a single method

2013-07-12 Thread paul . sandoz
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



hg: jdk8/tl/jdk: 8019484: Sync j.u.c.ConcurrentHashMap from 166 to tl

2013-07-11 Thread paul . sandoz
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 d...@cs.oswego.edu

! src/share/classes/java/util/concurrent/ConcurrentHashMap.java
! src/share/classes/java/util/concurrent/ConcurrentMap.java
! src/share/classes/java/util/concurrent/ConcurrentNavigableMap.java



hg: jdk8/tl/jdk: 8017447: Unmodifiable map entry becomes modifiable if taken from a stream of map entries

2013-07-10 Thread paul . sandoz
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



hg: jdk8/tl/jdk: 8020040: Improve and generalize the F/J tasks to handle right or left-balanced trees

2013-07-10 Thread paul . sandoz
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 d...@cs.oswego.edu, paul sandoz 
paul.san...@oracle.com

! 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



hg: jdk8/tl/jdk: 8017141: java.util/stream Spliterators from sequential sources should not catch OOME

2013-07-09 Thread paul . sandoz
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.san...@oracle.com

! src/share/classes/java/util/LinkedList.java
! src/share/classes/java/util/Spliterators.java



hg: jdk8/tl/jdk: 8019551: Make BaseStream public

2013-07-09 Thread paul . sandoz
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 brian.go...@oracle.com

! src/share/classes/java/util/stream/AbstractPipeline.java
! src/share/classes/java/util/stream/BaseStream.java



hg: jdk8/tl/jdk: 8019370: Sync j.u.c Fork/Join from 166 to tl

2013-07-09 Thread paul . sandoz
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 d...@cs.oswego.edu

! 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



hg: jdk8/tl/jdk: 2 new changesets

2013-07-03 Thread paul . sandoz
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 d...@cs.oswego.edu

! 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 d...@cs.oswego.edu

! 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



hg: jdk8/tl/jdk: 8017329: 8b92-lambda regression: TreeSet(a, b).stream().substream(1).parallel().iterator() is empty

2013-07-03 Thread paul . sandoz
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



hg: jdk8/tl/jdk: 8009736: Comparator API cleanup

2013-06-28 Thread paul . sandoz
Changeset: c1df54fd19b2
Author:henryjen
Date:  2013-06-11 13:41 -0700
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/c1df54fd19b2

8009736: Comparator API cleanup
Reviewed-by: psandoz, briangoetz, mduigou, plevart

! src/share/classes/java/util/Collections.java
! src/share/classes/java/util/Comparator.java
! src/share/classes/java/util/Comparators.java
! src/share/classes/java/util/Map.java
! src/share/classes/java/util/TreeMap.java
! src/share/classes/java/util/function/BinaryOperator.java
! src/share/classes/java/util/stream/Collectors.java
! src/share/classes/java/util/stream/ReferencePipeline.java
! src/share/classes/java/util/stream/SortedOps.java
! test/java/nio/file/Files/StreamTest.java
! test/java/util/Collection/ListDefaults.java
+ test/java/util/Comparator/BasicTest.java
+ test/java/util/Comparator/TypeTest.java
- test/java/util/Comparators/BasicTest.java
+ test/java/util/Map/EntryComparators.java
+ test/java/util/function/BinaryOperator/BasicTest.java
! 
test/java/util/stream/test/org/openjdk/tests/java/util/stream/SequentialOpTest.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/sun/misc/JavaLangAccess/NewUnsafeString.java



hg: jdk8/tl/jdk: 8012987: Optimizations for Stream.limit/substream

2013-06-28 Thread paul . sandoz
Changeset: 28b71c97a72d
Author:psandoz
Date:  2013-06-28 10:29 +0200
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/28b71c97a72d

8012987: Optimizations for Stream.limit/substream
Reviewed-by: mduigou
Contributed-by: Brian Goetz brian.go...@oracle.com, Paul Sandoz 
paul.san...@oracle.com

! src/share/classes/java/util/stream/AbstractPipeline.java
! src/share/classes/java/util/stream/AbstractTask.java
! src/share/classes/java/util/stream/DoubleStream.java
! src/share/classes/java/util/stream/ForEachOps.java
! src/share/classes/java/util/stream/IntStream.java
! src/share/classes/java/util/stream/LongStream.java
! src/share/classes/java/util/stream/PipelineHelper.java
! src/share/classes/java/util/stream/SliceOps.java
! src/share/classes/java/util/stream/Stream.java
! src/share/classes/java/util/stream/StreamSpliterators.java
! test/java/util/stream/bootlib/java/util/stream/OpTestCase.java
! test/java/util/stream/bootlib/java/util/stream/SpliteratorTestHelper.java
+ test/java/util/stream/boottest/java/util/stream/SliceSpliteratorTest.java
! test/java/util/stream/boottest/java/util/stream/StreamFlagsTest.java
! 
test/java/util/stream/test/org/openjdk/tests/java/util/stream/InfiniteStreamWithLimitOpTest.java



hg: jdk8/tl/jdk: 8016308: Updates to j.u.stream.Node/Nodes

2013-06-20 Thread paul . sandoz
Changeset: 656ea2349aa5
Author:psandoz
Date:  2013-06-20 10:45 +0200
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/656ea2349aa5

8016308: Updates to j.u.stream.Node/Nodes
Reviewed-by: mduigou
Contributed-by: Brian Goetz brian.go...@oracle.com, Paul Sandoz 
paul.san...@oracle.com

! src/share/classes/java/util/stream/Node.java
! src/share/classes/java/util/stream/Nodes.java
! src/share/classes/java/util/stream/SliceOps.java
! test/java/util/stream/boottest/java/util/stream/DoubleNodeTest.java
! test/java/util/stream/boottest/java/util/stream/IntNodeTest.java
! test/java/util/stream/boottest/java/util/stream/LongNodeTest.java



hg: jdk8/tl/jdk: 8016324: filter/flatMap pipeline sinks should pass size information to downstream sink

2013-06-20 Thread paul . sandoz
Changeset: 85524d9839dc
Author:psandoz
Date:  2013-06-20 11:02 +0200
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/85524d9839dc

8016324: filter/flatMap pipeline sinks should pass size information to 
downstream sink
Reviewed-by: chegar, mduigou
Contributed-by: Brian Goetz brian.go...@oracle.com

! src/share/classes/java/util/stream/DoublePipeline.java
! src/share/classes/java/util/stream/IntPipeline.java
! src/share/classes/java/util/stream/LongPipeline.java
! src/share/classes/java/util/stream/ReferencePipeline.java



hg: jdk8/tl/jdk: 8016455: Sync stream tests from lambda to tl

2013-06-20 Thread paul . sandoz
Changeset: f758d7c24396
Author:psandoz
Date:  2013-06-20 11:15 +0200
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/f758d7c24396

8016455: Sync stream tests from lambda to tl
Reviewed-by: mduigou
Contributed-by: Brian Goetz brian.go...@oracle.com, Paul Sandoz 
paul.san...@oracle.com

! test/java/util/stream/bootlib/java/util/stream/IntStreamTestDataProvider.java
! test/java/util/stream/bootlib/java/util/stream/LambdaTestHelpers.java
+ test/java/util/stream/bootlib/java/util/stream/LoggingTestCase.java
! test/java/util/stream/bootlib/java/util/stream/OpTestCase.java
! test/java/util/stream/bootlib/java/util/stream/SpliteratorTestHelper.java
! test/java/util/stream/boottest/java/util/stream/DoubleNodeTest.java
! test/java/util/stream/boottest/java/util/stream/IntNodeTest.java
! test/java/util/stream/boottest/java/util/stream/LongNodeTest.java
! test/java/util/stream/boottest/java/util/stream/NodeTest.java
! test/java/util/stream/boottest/java/util/stream/UnorderedTest.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/ForEachOpTest.java
! 
test/java/util/stream/test/org/openjdk/tests/java/util/stream/GroupByOpTest.java
! 
test/java/util/stream/test/org/openjdk/tests/java/util/stream/IntSliceOpTest.java
! 
test/java/util/stream/test/org/openjdk/tests/java/util/stream/IntUniqOpTest.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/RangeTest.java
! 
test/java/util/stream/test/org/openjdk/tests/java/util/stream/ReduceByOpTest.java
! 
test/java/util/stream/test/org/openjdk/tests/java/util/stream/SequentialOpTest.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/StreamLinkTest.java
! 
test/java/util/stream/test/org/openjdk/tests/java/util/stream/StreamSpliteratorTest.java
! 
test/java/util/stream/test/org/openjdk/tests/java/util/stream/TabulatorsTest.java
! 
test/java/util/stream/test/org/openjdk/tests/java/util/stream/ToArrayOpTest.java



hg: jdk8/tl/jdk: 8016139: PrimitiveIterator.forEachRemaining

2013-06-20 Thread paul . sandoz
Changeset: 562f5cf13a9c
Author:psandoz
Date:  2013-06-20 11:21 +0200
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/562f5cf13a9c

8016139: PrimitiveIterator.forEachRemaining
Reviewed-by: alanb

! src/share/classes/java/util/PrimitiveIterator.java



hg: jdk8/tl/jdk: 8016251: Balanced spliterator for SpinedBuffer

2013-06-13 Thread paul . sandoz
Changeset: a50394c44464
Author:psandoz
Date:  2013-06-13 11:13 +0200
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/a50394c44464

8016251: Balanced spliterator for SpinedBuffer
Reviewed-by: mduigou
Contributed-by: Brian Goetz brian.go...@oracle.com, Peter Levart 
peter.lev...@gmail.com, Paul Sandoz paul.san...@oracle.com

! src/share/classes/java/util/stream/DoublePipeline.java
! src/share/classes/java/util/stream/IntPipeline.java
! src/share/classes/java/util/stream/LongPipeline.java
! src/share/classes/java/util/stream/Node.java
! src/share/classes/java/util/stream/Nodes.java
! src/share/classes/java/util/stream/SortedOps.java
! src/share/classes/java/util/stream/SpinedBuffer.java
! test/java/util/stream/boottest/java/util/stream/DoubleNodeTest.java
! test/java/util/stream/boottest/java/util/stream/IntNodeTest.java
! test/java/util/stream/boottest/java/util/stream/LongNodeTest.java
! test/java/util/stream/boottest/java/util/stream/SpinedBufferTest.java



hg: jdk8/tl/jdk: 8015895: Int/LongStream.range/rangeClosed; ...

2013-06-11 Thread paul . sandoz
Changeset: 8d627f324c38
Author:psandoz
Date:  2013-06-11 12:13 +0200
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/8d627f324c38

8015895: Int/LongStream.range/rangeClosed
8012986: Right-bias range spliterators for large ranges
Reviewed-by: mduigou

! src/share/classes/java/util/stream/IntStream.java
! src/share/classes/java/util/stream/LongStream.java
! src/share/classes/java/util/stream/Streams.java
! test/java/util/stream/bootlib/java/util/stream/IntStreamTestDataProvider.java
! test/java/util/stream/bootlib/java/util/stream/LongStreamTestDataProvider.java
! test/java/util/stream/test/org/openjdk/tests/java/util/stream/RangeTest.java



hg: jdk8/tl/jdk: 8015492: Remove DoubleStream.range methods

2013-06-10 Thread paul . sandoz
Changeset: 3990fcab2cd9
Author:psandoz
Date:  2013-06-10 11:52 +0200
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/3990fcab2cd9

8015492: Remove DoubleStream.range methods
Reviewed-by: alanb

! src/share/classes/java/util/stream/DoubleStream.java
! src/share/classes/java/util/stream/Streams.java
! 
test/java/util/stream/bootlib/java/util/stream/DoubleStreamTestDataProvider.java
! 
test/java/util/stream/test/org/openjdk/tests/java/util/stream/ExplodeOpTest.java
! 
test/java/util/stream/test/org/openjdk/tests/java/util/stream/ForEachOpTest.java
! test/java/util/stream/test/org/openjdk/tests/java/util/stream/RangeTest.java
! 
test/java/util/stream/test/org/openjdk/tests/java/util/stream/StreamBuilderTest.java
! 
test/java/util/stream/test/org/openjdk/tests/java/util/stream/StreamSpliteratorTest.java



hg: jdk8/tl/jdk: 8015798: Rename IntStream.longs/doubles and LongStream.doubles to asXxxStream

2013-06-10 Thread paul . sandoz
Changeset: 7322e8ad7c01
Author:psandoz
Date:  2013-06-10 12:20 +0200
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/7322e8ad7c01

8015798: Rename IntStream.longs/doubles and LongStream.doubles to asXxxStream
Reviewed-by: alanb

! src/share/classes/java/util/stream/IntPipeline.java
! src/share/classes/java/util/stream/IntStream.java
! src/share/classes/java/util/stream/LongPipeline.java
! src/share/classes/java/util/stream/LongStream.java
! test/java/util/stream/boottest/java/util/stream/SpinedBufferTest.java
! 
test/java/util/stream/test/org/openjdk/tests/java/util/stream/DoublePrimitiveOpsTests.java
! 
test/java/util/stream/test/org/openjdk/tests/java/util/stream/ExplodeOpTest.java
! 
test/java/util/stream/test/org/openjdk/tests/java/util/stream/ForEachOpTest.java
! test/java/util/stream/test/org/openjdk/tests/java/util/stream/MapOpTest.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/MinMaxTest.java
! 
test/java/util/stream/test/org/openjdk/tests/java/util/stream/PrimitiveSumTest.java
! 
test/java/util/stream/test/org/openjdk/tests/java/util/stream/StreamBuilderTest.java
! 
test/java/util/stream/test/org/openjdk/tests/java/util/stream/StreamSpliteratorTest.java



hg: jdk8/tl/jdk: 8015792: Rename Spliterators.spliteratorFromIterator to Spliterators.iterator

2013-06-10 Thread paul . sandoz
Changeset: 9c462579b624
Author:psandoz
Date:  2013-06-10 12:26 +0200
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/9c462579b624

8015792: Rename Spliterators.spliteratorFromIterator to Spliterators.iterator
Reviewed-by: chegar

! src/share/classes/java/util/Spliterators.java
! src/share/classes/java/util/stream/DoublePipeline.java
! src/share/classes/java/util/stream/IntPipeline.java
! src/share/classes/java/util/stream/LongPipeline.java
! src/share/classes/java/util/stream/ReferencePipeline.java
! src/share/classes/java/util/stream/SpinedBuffer.java
! test/java/util/Spliterator/SpliteratorTraversingAndSplittingTest.java
! test/java/util/stream/bootlib/java/util/stream/TestData.java
! test/java/util/stream/boottest/java/util/stream/DoubleNodeTest.java
! test/java/util/stream/boottest/java/util/stream/IntNodeTest.java
! test/java/util/stream/boottest/java/util/stream/LongNodeTest.java
! 
test/java/util/stream/test/org/openjdk/tests/java/util/stream/SortedOpTest.java



hg: jdk8/tl/jdk: 8015790: Remove duplicate spliterator tests

2013-06-04 Thread paul . sandoz
Changeset: fad4ef2123ca
Author:psandoz
Date:  2013-06-04 11:53 +0200
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/fad4ef2123ca

8015790: Remove duplicate spliterator tests
Reviewed-by: alanb, mduigou

- 
test/java/util/stream/test/org/openjdk/tests/java/util/stream/SpliteratorLateBindingFailFastTest.java
- 
test/java/util/stream/test/org/openjdk/tests/java/util/stream/SpliteratorTraversingAndSplittingTest.java



hg: jdk8/tl/jdk: 8015008: Primitive iterator over empty sequence, null consumer: forEachRemaining methods do not throw NPE

2013-06-03 Thread paul . sandoz
Changeset: f3c7c5f753dc
Author:psandoz
Date:  2013-06-03 10:28 +0200
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/f3c7c5f753dc

8015008: Primitive iterator over empty sequence, null consumer: 
forEachRemaining methods do not throw NPE
Reviewed-by: chegar

! src/share/classes/java/util/PrimitiveIterator.java
+ test/java/util/Iterator/PrimitiveIteratorDefaults.java



hg: jdk8/tl/jdk: 8014731: j.u.stream.StreamSupport class has default constructor generated

2013-06-03 Thread paul . sandoz
Changeset: 44ef47f3efed
Author:psandoz
Date:  2013-06-03 10:45 +0200
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/44ef47f3efed

8014731: j.u.stream.StreamSupport class has default constructor generated
Summary: This change set also fixes broken links
Reviewed-by: alanb, chegar
Contributed-by: Paul Sandoz paul.san...@oracle.com, Henry Jen 
henry@oracle.com

! src/share/classes/java/util/stream/StreamSupport.java



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

2013-06-03 Thread paul . sandoz
Changeset: a79e2683eae3
Author:psandoz
Date:  2013-06-03 17:37 +0200
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/a79e2683eae3

8014383: StringJoiner example in class description not in sync with streams API
Reviewed-by: alanb

! src/share/classes/java/util/StringJoiner.java



hg: jdk8/tl/jdk: 8014732: Minor spec issue: java.util.Spliterator.getExactSizeIfKnown

2013-05-31 Thread paul . sandoz
Changeset: b47044426bcd
Author:psandoz
Date:  2013-05-31 09:58 +0200
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/b47044426bcd

8014732: Minor spec issue: java.util.Spliterator.getExactSizeIfKnown
Summary: A minor documentation issue (not a spec issue).
Reviewed-by: chegar, dl

! src/share/classes/java/util/Spliterator.java



hg: jdk8/tl/jdk: 8014409: Spec typo: extra } in the spec for j.u.s.StreamBuilder

2013-05-30 Thread paul . sandoz
Changeset: 156ee44cd456
Author:psandoz
Date:  2013-05-30 16:08 +0200
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/156ee44cd456

8014409: Spec typo: extra } in the spec for j.u.s.StreamBuilder
Summary: Also fixes documentation on StreamBuilder.OfDouble
Reviewed-by: alanb, chegar, mduigou

! src/share/classes/java/util/stream/StreamBuilder.java



hg: jdk8/tl/jdk: 8014393: Minor typo in the spec for j.u.stream.Stream.findFirst()

2013-05-30 Thread paul . sandoz
Changeset: b4742d038100
Author:psandoz
Date:  2013-05-28 15:22 +0200
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/b4742d038100

8014393: Minor typo in the spec for j.u.stream.Stream.findFirst()
Reviewed-by: alanb, chegar

! 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



Re: Review Request: 7193339 Prepare system classes be defined by a non-null module loader

2012-08-27 Thread Paul Sandoz

On Aug 25, 2012, at 12:57 AM, Mandy Chung mandy.ch...@oracle.com wrote:

 On 8/24/2012 3:44 PM, David Holmes wrote:
 My other query with these changes is whether we are certain that using the 
 specified loader rather than the boot loader will always be correct. 
 
 Yes I'm to my best knowledge but I'm looking to the reviewers to tell me 
 otherwise :)
 

To the best of my knowledge too.


 The class being loaded is either part of the same module or expressed in its 
 module dependency.  

And for that reason it may be best to use the three arg method call [*] as much 
as possible for code in the JDK code base. If code is shuffled around it then 
becomes clearer if the constraint, either part of the same module or expressed 
in its module dependency, breaks.

Paul.

[*] That is not a negative on the stuff below.


 I ran the JCK tests in module mode with the jigsaw modular JDK that uncovered 
 these files to be changed.  There are other places in the JDK that I didn't 
 touch since they were not found by my testing.
 
 BTW, I have created a new CR:
   7194006:  A new Class.forName(String cn, boolean initialize) method
 
 http://cr.openjdk.java.net/~mchung/jdk8/webrevs/7193339/webrev.02/
 
 This include Paul's suggestion and slightly improved the javadoc
 for Class.forName you suggested [1]:
 
 - * @param initialize whether the class must be initialized
 + * @param initialize if {@code true} the class will be initialized.
 + *   See Section 12 of emThe Java Language 
 Specification/em.
 
 Thanks
 Mandy
 [1] http://mail.openjdk.java.net/pipermail/jigsaw-dev/2012-May/002534.html



Re: Review Request: 7193339 Prepare system classes be defined by a non-null module loader

2012-08-25 Thread Paul Sandoz
Hi Mandy,

--- old/src/share/classes/com/sun/jmx/remote/internal/IIOPHelper.java   Thu Aug 
23 12:29:01 2012
+++ new/src/share/classes/com/sun/jmx/remote/internal/IIOPHelper.java   Thu Aug 
23 12:29:00 2012
@@ -52,7 +52,7 @@
 AccessController.doPrivileged(new PrivilegedActionIIOPProxy() {
 public IIOPProxy run() {
 try {
-Class? c = Class.forName(IMPL_CLASS, true, null);
+Class? c = Class.forName(IMPL_CLASS);


Why not:

  Class? c = Class.forName(IMPL_CLASS, true, 
IIOPHelper.class.getClassLoader());

to avoid traversing up the call stack to obtain the calling class.

Paul.

On Aug 23, 2012, at 9:33 PM, Mandy Chung mandy.ch...@oracle.com wrote:

 On 8/23/2012 11:58 AM, Alan Bateman wrote:
 On 23/08/2012 18:43, Mandy Chung wrote:
 This change is to bring the jdk modularization changes from jigsaw repo [1]
 to jdk8.  This allows the jdk modularization changes to be exposed for
 testing as early as possible and minimize the amount of changes carried
 in the jigsaw repo that helps sync up jigsaw with jdk8/jdk9.
 
 Webrev at:
 http://cr.openjdk.java.net/~mchung/jdk8/webrevs/7193339/webrev.00/
 
 This looks good to me and it's good to have these changes in jdk8.
 
 One suggestion for ReflectUtil is to add a private static boolean isAncestor 
 method as I think that would make the checks in needsPackageAccessCheck 
 easier to read. Also in ClassLoader you could use just use 
 needsClassLoaderPermissionCheck(from,to).
 
 
 Done.  This is a good cleanup I considered to do too but missed in the 
 previous webrev.
 
 http://cr.openjdk.java.net/~mchung/jdk8/webrevs/7193339/webrev.01/
 
 Thanks for the review.
 Mandy