I've had a morning of discussion about streaming Map this morning. While
there is clearly no appetite for a JDK MapStream right now, it does seem
that two additional methods on Map.Entry could help.
Two of the common cases when streaming over Map.Entry are to transform the
keys and to transform
Hi,
We have had multiple attempts at a BiStream for references.
Mike had quite a good one. I thought my last attempt was rather good too :-) it
avoided boxing on critical paths, while avoiding much bifurcation of the
Spliterator API, and supported some nice use-cases. However, it would likely
Hi Tagir,
AutoCloseable.close states:
* However, implementers of this interface are strongly encouraged
* to make their {@code close} methods idempotent.
It’s possible we just did not consider this aspect too much in BaseStream.close
and we just lent on the "strongly encouraged”, which seems
Hello,
We've seen some more low-frequency failures of
java/util/concurrent/forkjoin/FJExceptionTableLeak.java
Please review the patch below which records the known-intermittentness
in the source of the test and demotes the test from tier 1 to tier 2.
When the issue is resolved
Hi Masayoshi,
Thank you for pointing that out. I have removed line 29 from the test.
Please review the updated Webrev:
http://cr.openjdk.java.net/~rpatil/8141243/webrev.01/
Regards,
Ramanand.
-Original Message-
From: Masayoshi Okutsu
Sent: Friday, January 15, 2016 8:18 AM
To:
Hi,
Another possibility would be to introduce the following default methods
to Map.Entry:
public interface Map.Entry {
...
default Map.Entry withKey(L key) { ... }
default Map.Entry withValue(W value) { ... }
}
Usage would then look like:
Hello!
SC> Finally, the Collectors class could do with a new method entriesToMap()
SC> that collects a stream of Map.Entry back into a Map.
I was thinking about adding such collector into my library and checked
StackOverflow to understand the useful scenarios. Seems that having
entriesToMap()
+1
On Jan 15, 2016, at 1:01 PM, joe darcy wrote:
> Hello,
>
> We've seen some more low-frequency failures of
>
> java/util/concurrent/forkjoin/FJExceptionTableLeak.java
>
> Please review the patch below which records the known-intermittentness in
> the source of the
Looks fine Joe.
On 1/15/16 1:01 PM, joe darcy wrote:
Hello,
We've seen some more low-frequency failures of
java/util/concurrent/forkjoin/FJExceptionTableLeak.java
Please review the patch below which records the
known-intermittentness in the source of the test and demotes the test
from
Hi,
For completeness, having also the methods
default Entry withKeyAsValue(NK newKey) {
return new AbstractMap.SimpleEntry<>(newKey, getKey());
}
public Entry withValueAsKey(NV newValue) {
return new
On Jan 11, 2016, at 7:04 AM, Paul Sandoz wrote:
>
> When the new range check methods Object.check* were added the exception
> reporting was a little vague and lossy, but i got a CCC pass to revisit later
> on, and John nudged me to sort this out, so here is another more
Hello!
Note that having single swap() method which just swaps key and value
in addition to withKey/withValue covers this use case:
Map gad = dag.entrySet()
.stream()
.flatMap(e -> e.getValue().stream().map(e.swap()::withKey))
.collect(groupingBy(Entry::getKey,
So, this proposal is essentially trying to add something small to JDK 9 in
advance of the long wait for value types and a full solution to the problem
space. A stream of Map.Entry is painful today, and my idea or Remi's would
definitely assist without pushing the API too far (I'm not such a fan of
looks good!
On Fri, Jan 15, 2016 at 11:21 PM, joe darcy wrote:
> Hello,
>
> Mea culpa, I omitted the line continuation characters in my recent fix for
> JDK-8147480.
>
> Please review the patch below to add the continuation characters and restore
> the full set of tests to
14 matches
Mail list logo