Re: Moderator Responsibilities

2018-08-17 Thread Jonathan Bluett-Duncan
ong here like adults is what. > > Ok. > > > > Get Outlook for Android <https://aka.ms/ghei36> > > -- > *From:* Jonathan Bluett-Duncan > *Sent:* Friday, August 17, 2018 3:11:22 PM > *To:* mea...@outlook.com > *Cc:* core-libs-dev &g

Re: Moderator Responsibilities

2018-08-17 Thread Jonathan Bluett-Duncan
Hi Mr Rupplin, I can't speak for anyone else, but I'm personally puzzled by your email. Could you clarify what you mean by "There will be no more kid games. If you are asked, please answer fully and promptly. Debugging a long compile stack can be complicated."? I ask because it came across as ant

Re: RFR: JDK-8200436 - String::isBlank

2018-05-15 Thread Jonathan Bluett-Duncan
How about String.isWhitespaceOrEmpty? I think that accurately describes the method. Cheers, Jonathan On 15 May 2018 at 19:15, Jeremy Manson wrote: > Seems to me that consistency matters here: for Character to call it > whitespace and for String to call it blank is a little weird. > > Is there a

Re: RFR(JDK11/NIO) 8202285: (fs) Add a method to Files for comparing file contents

2018-04-27 Thread Jonathan Bluett-Duncan
Hi Joe, I wonder if the method `isSameContent` should be named `haveSameContents` so as to read more fluently in English. Cheers, Jonathan On 27 April 2018 at 11:58, Daniel Fuchs wrote: > Hi Joe, > > On the specification side, I think I would reword the API > documentation to first explain how

Re: Raw String Literal Library Support

2018-03-13 Thread Jonathan Bluett-Duncan
proposed String.splits()). For examples ":".split(":", -1) and "".split(":", -1), they actually produce ["", ""] and [""] respectively, which I like better. Cheers, Jonathan On 14 March 2018 at 00:12, Jonathan Bluett-Dunca

Re: Raw String Literal Library Support

2018-03-13 Thread Jonathan Bluett-Duncan
Paul, AFAICT, one sort of behaviour which String.split() allows which Pattern.splitAsStream() and the proposed String.splits() don't is allowing a negative limit, e.g. String.split(string, -1). Over at http://errorprone.info/bugpattern/StringSplitter, they argue that a limit of -1 has less surpri

Re: core-libs-dev Digest, Vol 131, Issue 19

2018-03-04 Thread Jonathan Bluett-Duncan
Okay. Do you have any citations that we can refer to to confirm for ourselves that this is indeed a recognised need? Cheers, Jonathan On 4 March 2018 at 05:24, A Z wrote: > To who it may concern, > > > 'There was a JSR to add a new mode' > > > then I suppose I would be asking for that change

Re: [11] RFR: 4993841: (str) java.lang.Character should have a toString(int) method

2018-03-02 Thread Jonathan Bluett-Duncan
Hi Rémi, I'm sure I've misunderstood something, but AFAIK the code example you gave is already valid code and was valid as far back as Java 8 (I don't have an IDE at hand to confirm this). Did you perhaps mean to ask instead that the code snippet below would work with the resolution of https://bu

Re: [10] RFR 8193856 takeWhile produces incorrect result with elements produced by flatMap

2017-12-20 Thread Jonathan Bluett-Duncan
Hi Paul, It seems that some clever Googler managed to find a workaround for aggressive `flatMap` operations in the form of a so-called `MoreStreams.flatten` operation, implemented in a side project called google/mug. I'm sharing the javadoc

Re: RFR 4358774: Add null InputStream and OutputStream

2017-12-08 Thread Jonathan Bluett-Duncan
Like David, I prefer the `null{$ClassName}` alternative to `null{Source|Sink}`. (I assume from his wording that he prefers `null{$ClassName}`.) I prefer `null{$ClassName}` not only because it's less ambiguous, but also because Guava has existing types `{Byte|Char}Source` and `{Byte|Char}Sink`, so

Re: RFR(s): 8060192: Add default method Collection.toArray(generator)

2017-12-07 Thread Jonathan Bluett-Duncan
Hi Stuart, Looking over http://cr.openjdk.java.net/~smarks/reviews/8060192/webrev.2/src/java.base/share/classes/java/util/ArrayList.java.cdiff.html, I'm wondering if the method `ArrayList.toArray(IntFunction)` should have an `@Override` to make it clear that it's overriding the default method in C

Re: [10?] RFR: 8193128: Reduce number of implementation classes returned by List/Set/Map.of()

2017-12-06 Thread Jonathan Bluett-Duncan
Hi Claes, Looking at http://cr.openjdk.java.net/~redestad/8193128/open.00/src/java.base/share/classes/java/util/ImmutableCollections.java.cdiff.html, there are sections labelled --- 646,657 and --- 834,845 where lines like `Objects.requireNonNull(0 /* zero */);` are written. I believe th

Re: RFR: JDK-8133680 add Stream.foldLeft() terminal operation

2017-08-21 Thread Jonathan Bluett-Duncan
> OK, so I think an indexed stream returning pairs of (long,T) is the answer. ...which I suspect might be worth waiting on Project Valhalla for, if I've understood you correctly, since an IndexedElement would essentially be a `long` and object pair, and having the `long` element stored or retrieva

Re: RFR: 8186334: JarFile throws ArrayIndexOutOfBoundsException when the manifest contains certain characters

2017-08-21 Thread Jonathan Bluett-Duncan
Would it not be viable to merge this into Java 9 in the foreseeable future for one of its inevitable bug fix releases? I admit I'm unfamiliar with the whole process, so I realise my question may be naive or that the answer is considered "common knowledge". Cheers, Jonathan On 21 August 2017 at 18

Re: java.util.stream 'map' method, proposal of method name change

2017-08-15 Thread Jonathan Bluett-Duncan
Hi Krunoslav, I think the reason the method was named `map` rather than `replaceWith` or an equivalent name, is because `map` is a well-known name for this sort of *higher-order function*. The name itself has been around in functional programming languages like Haskell and Scala and programming mo

Re: [10] RFR 8134512 : provide Alpha-Numeric (logical) Comparator

2017-07-28 Thread Jonathan Bluett-Duncan
Hi Ivan, It looks like the MyComparator code example which you gave in your last email lost its formatting along the way, so I'm finding it difficult to read. Would you mind resubmitting it? Cheers, Jonathan On 28 July 2017 at 17:25, Ivan Gerasimov wrote: > Hi Peter! > > Thank a lot for lookin

Re: [10] RFR 8134512 : provide Alpha-Numeric (logical) Comparator

2017-07-24 Thread Jonathan Bluett-Duncan
eful addition. Best regards, Jonathan On 24 Jul 2017 06:21, "Ivan Gerasimov" wrote: Thank you Jonathan for looking into that! I agree with all your suggestions. Here's the updated webrev with suggested modifications: WEBREV: http://cr.openjdk.java.net/~igerasim/8134512/02/webrev

Re: [10] RFR 8134512 : provide Alpha-Numeric (logical) Comparator

2017-07-23 Thread Jonathan Bluett-Duncan
Meant to reply to core-libs-dev as well; doing so now. Jonathan On 23 July 2017 at 11:50, Jonathan Bluett-Duncan wrote: > Hi Ivan, > > I'm not a reviewer per se, but I thought I'd chime in. > > There's a few things with Comparator.java which I thi

Re: Getting a live view of environment variables (Gradle and JDK 9)

2017-05-16 Thread Jonathan Bluett-Duncan
Hi Cédric, I don't know if it's been considered, but has anyone from the Gradle team asked the Bazel team about this problem? They may have useful insight about this problem with `System.getenv`, considering that Bazel is apparently very fast and (partially) written in Java. I hope this helps.

Re: Optional.isEmpty()

2017-04-22 Thread Jonathan Bluett-Duncan
Hi Peter, Your reasoning has personally convinced me that a method like `isEmpty()` would pull its weight. However, at the risk of bikeshedding, I think it should be named differently, as `isEmpty()` immediately makes me think that `findModule()` returns a List, which I'd easily find confusing. H

Re: [PATCH] 8178117: Add public state constructors for Int/Long/DoubleSummaryStatistics

2017-04-06 Thread Jonathan Bluett-Duncan
Hi Chris, Unfortunately the patch you sent (in what I presume was an attachment) is missing. I believe the OpenJDK mailing list servers intentionally strip out attachments in all emails, which seems to be at odds with the advice given in http://openjdk.java.net/contribute/. (Either the contributio

Re: [NEW BUG]: Avoid allocations in String.replace(CharSequence, CharSequence) in case no replacement happened

2017-03-02 Thread Jonathan Bluett-Duncan
Hi Vitaly, > If there's no early bail out, there's an implicit null check when > replacement.toString() is called... Oh apologies! I had missed in the code that NPE does get thrown if `replacement` is null, no matter if the `if (j < 0) { ... }` block is entered or not, because `replacement.toSt

Re: [NEW BUG]: Avoid allocations in String.replace(CharSequence, CharSequence) in case no replacement happened

2017-03-02 Thread Jonathan Bluett-Duncan
Hi Christoph and Vitaly, I am struggling to understand why the null-check for `replacement` has been moved within the `if (j < 0) { ... }` block. Could one of you explain to me the reasoning behind this change? I ask because, AFAICT, making it so that it only throws an NPE if `replacement` is nul

Re: [NEW BUG]: Avoid allocations in String.replace(CharSequence, CharSequence) in case no replacement happened

2017-03-01 Thread Jonathan Bluett-Duncan
Hi Christoph, I think it's worth adding a small comment to the end of `String tgtStr = target.toString();`, saying that the null check is implicit, in case people read the code in the future and get confused as to why only `replacement` is apparently null-checked. What do you think? Kind regards,

Re: Stream based API for tree like structures

2017-01-20 Thread Jonathan Bluett-Duncan
Hi Kasper, If what you're looking for is a more immediate solution, I can think of a couple of libraries which may do the trick: 1. Durian 's TreeDef and TreeStream. Difficult to understand and use at first, but I believe it ticks a good number of boxe

Re: RFR: 8054214: JapaneseEra.getDisplayName doesn't return names if it's an additional era

2016-12-08 Thread Jonathan Bluett-Duncan
Hi Masayoshi, I'm not a reviewer, but there's something in JapaneseEra.java.cdiff.html which isn't terribly clear to me, so I wonder if you could clarify it for me. In

Re: Enhancements to Java Collections API

2016-12-01 Thread Jonathan Bluett-Duncan
Hi John, I'm not sure about most of the suggestions you've made, especially the Bidi* ones, but I understand that something like your suggestion for an enhanced `Optional getIfPresent(K key)` is (or was) being investigated by Mr. Goetz himself and other people over at Project Valhalla

Re: RFR: JDK-8167648: java.io.PrintWriter should have PrintWriter((String|File), Charset) constructors

2016-11-23 Thread Jonathan Bluett-Duncan
Hi Patrick, Have you considered making `withAutoFlush()` return the `PrintWriter` itself, allowing fluent code snippets like the following? ``` PrintWriter writer = new PrintWriter(new File("path/to/file.txt"), StandardCharsets.UTF_8).withAutoFlush(); ``` Kind regards, Jonathan On 23 November 2

Re: 8152515: (logging) LogManager.resetLogger should ignore LinkageError

2016-10-28 Thread Jonathan Bluett-Duncan
tion so they are disjoint at the catch > clauses. > And the compiler produces an error if a catch clause hides another > exception to keep > the mistake from being hidden. > > $.02, Roger > > > > On 10/28/2016 12:00 PM, Jonathan Bluett-Duncan wrote: > >> I&#x

Re: 8152515: (logging) LogManager.resetLogger should ignore LinkageError

2016-10-28 Thread Jonathan Bluett-Duncan
I've an awful suspicion that the `catch (LinkageError e)` block is unreachable, as the `catch (Exception e)` block would run first, being located above the other block in the source code. Is my suspicion correct? Kind regards, Jonathan On 28 October 2016 at 16:36, Jason Mehrens wrote: > Daniel

Re: RFR: jsr166 jdk9 integration wave 12

2016-10-20 Thread Jonathan Bluett-Duncan
e jdk collections. Thanks again, Jonathan On 20 October 2016 at 04:45, Martin Buchholz wrote: > > > On Wed, Oct 19, 2016 at 4:40 PM, Jonathan Bluett-Duncan < > jbluettdun...@gmail.com> wrote: > >> Hi Martin, >> >> By collections infrastructure, do you mean

Re: RFR: jsr166 jdk9 integration wave 12

2016-10-19 Thread Jonathan Bluett-Duncan
Hi Martin, By collections infrastructure, do you mean something like the collection testers in guava-testlib? If so, I agree that JUnit 5's dynamic tests look promising for implementing such an infrastructure. I admit I don't have all the context here, but would using guava-testlib in the meantim

Re: Review request: JDK-8167630 jdeps --generate-module-info forgets to close the resource after checking any unnamed package

2016-10-12 Thread Jonathan Bluett-Duncan
Not a reviewer, but looks good to me. :-) Kind regards, Jonathan On 12 Oct 2016 23:54, "Lance Andersen" wrote: > +1 > > On Oct 12, 2016, at 6:52 PM, Mandy Chung wrote: > > > > Simple patch close the ClassFileReader with try-with-resource. > > > > > > diff --git a/src/jdk.jdeps/share/classes/co

Re: RFR: JDK-8134373: explore potential uses of convenience factories within the JDK

2016-10-12 Thread Jonathan Bluett-Duncan
dk9/dev/jdk/rev/af71f6a36731 Jonathan, thanks for your contribution. And Patrick, thanks again for hosting the webrev. s'marks On 10/12/16 6:53 AM, Jonathan Bluett-Duncan wrote: Hi all, Thank you very much for all reviewing my changeset over the last few days and for finding the bits I for

Re: RFR: JDK-8134373: explore potential uses of convenience factories within the JDK

2016-10-12 Thread Jonathan Bluett-Duncan
Hi all, Thank you very much for all reviewing my changeset over the last few days and for finding the bits I forgot to transfer from webrev01 to webrev02. I've been quiet as I'm still busy with university and will be for the foreseeable future. Stuart, many thanks again for sponsoring the change

Re: RFR: JDK-8134373: explore potential uses of convenience factories within the JDK

2016-10-10 Thread Jonathan Bluett-Duncan
a/reviews/8134373/webrev.02 > > -Patrick > > > > > Am 07.10.2016 um 12:00 schrieb Jonathan Bluett-Duncan < > jbluettdun...@gmail.com>: > > > > Hi all, > > > > Sorry for the delayed response, I've been busy lately with university > an

Re: RFR: JDK-8134373: explore potential uses of convenience factories within the JDK

2016-10-07 Thread Jonathan Bluett-Duncan
Hi all, Sorry for the delayed response, I've been busy lately with university and other things. Thank you all for your comments. I'll leave the DateTimeFormatter comment in, as you requested Stephen and Roger, and I'll work again with Patrick as soon as I'm ready. Kind regards, Jonathan On 6 Oc

Re: RFR: JDK-8134373: explore potential uses of convenience factories within the JDK

2016-10-05 Thread Jonathan Bluett-Duncan
Stuart, thank you very much for your continued review of this changeset, and for finding those usages of CookieManager::get in Grepcode for me. I've applied the comment you suggested for ModuleFinder and I've also fixed the NetscapeCookieStore typo. Stephen, thank you for getting back about DateTi

Re: RFR: 8167005: Comment on the need for an empty constructor in ArrayList$Itr

2016-10-05 Thread Jonathan Bluett-Duncan
ctually pushed, since there's an implicit link in the commit >> itself anyhow. >> >> Thanks! >> >> /Claes >> >> On 2016-10-04 23:20, Jonathan Bluett-Duncan wrote: >> >>> The explanation which Stuart gives for this change in >>> ht

Re: RFR: 8167005: Comment on the need for an empty constructor in ArrayList$Itr

2016-10-04 Thread Jonathan Bluett-Duncan
The explanation which Stuart gives for this change in https://bugs.openjdk.java.net/browse/JDK-8167005 seems to describe why this constructor is needed much better than the comment itself does. So I wonder if it's worth adding the link to the bug report in the comment. E.g. // prevent generation o

Re: [9] Review Request: 8143077 Deprecate InputEvent._MASK in favor of InputEvent._DOWN_MASK

2016-09-30 Thread Jonathan Bluett-Duncan
Hi Sergey, I'm not a reviewer, but after reading the deprecation messages in Event.java * @deprecated It is recommended that {@code AWTEvent} class and its > subclasses > * be used instead. I get the impression they would read better without the redundant "class" in the middle, like

Re: RFR: JDK-8134373: explore potential uses of convenience factories within the JDK

2016-09-30 Thread Jonathan Bluett-Duncan
Hi Stuart, Thanks for doing such a thorough review of the parts you've managed to look at so far. I see you had a number of questions in your numbered bullet points, so I'll do my best to answer them below. 1) It actually didn't occur to me that there was a potential TOCTOU problem in ModuleFind

Re: RFR: JDK-8134373: explore potential uses of convenience factories within the JDK

2016-09-15 Thread Jonathan Bluett-Duncan
ttps://bugs.openjdk.java.net/browse/JDK-8134373 > > regarding serialization compatibility. Reviewers should take care that > updating code to use these new collection factories doesn't change any > serialization formats. Unfortunately I am not confident that we have > sufficient te

Re: RFR: JDK-8134373: explore potential uses of convenience factories within the JDK

2016-09-15 Thread Jonathan Bluett-Duncan
, Jonathan On 15 September 2016 at 15:06, Jonathan Bluett-Duncan < jbluettdun...@gmail.com> wrote: > Pavel, > > >> 6. I couldn't find any evidence that `resolverFields` might contain >> `null`. >> Am I missing a javadoc or a line of code? Maybe we should t

Re: RFR: JDK-8134373: explore potential uses of convenience factories within the JDK

2016-09-15 Thread Jonathan Bluett-Duncan
Pavel, > 6. I couldn't find any evidence that `resolverFields` might contain `null`. > Am I missing a javadoc or a line of code? Maybe we should talk to java.time > folks to see if it's the case? > When I ran the tests for java.time, one of them failed because `null` was being passed to `resolve

Re: RFR: JDK-8134373: explore potential uses of convenience factories within the JDK

2016-09-15 Thread Jonathan Bluett-Duncan
Wow, lots of discussion went on since I was busy doing other stuff! Thanks Patrick for doing the work of creating a new webrev for me. Really appreciated! Pavel already mentioned it, but I think List.of instead of Collections.emptyList in ZoneOffsetTransition is the right thing to do for visual a

Re: RFR: JDK-8134373: explore potential uses of convenience factories within the JDK

2016-09-15 Thread Jonathan Bluett-Duncan
rick Reinhart : > > Hi Jonathan, > > On 2016-09-13 02:13, Jonathan Bluett-Duncan wrote: > > Hi Patrick, > Thank you very much for the offer to hold my patch for me! > > > No problem. > > Is it common practice to send patches to others using PGP? > > > No, thi

Re: [PATCH] JDK-8134373: explore potential uses of convenience factories within the JDK

2016-09-12 Thread Jonathan Bluett-Duncan
DKs final phase, I > could offer you to hold that patch. Just send it to me and I will prepare > the webrev for you…. > > -Patrick > > > > Am 12.09.2016 um 20:36 schrieb Jonathan Bluett-Duncan < > jbluettdun...@gmail.com>: > > > > Hi David, > > &

Re: [PATCH] JDK-8134373: explore potential uses of convenience factories within the JDK

2016-09-12 Thread Jonathan Bluett-Duncan
e for you on cr.openjdk.java.net. > > That aside you may be hard pressed to find anyone who can look at this > future work now, given where things are with the JDK 9 release schedule. > > Cheers, > David > > > On 11/09/2016 9:42 AM, Jonathan Bluett-Duncan wrote: > >

Fwd: Make iterators cloneable?

2016-09-11 Thread Jonathan Bluett-Duncan
I think O(N^2)-like performance is unavoidable here Dave. However, although Peter's algorithm is indeed O(N^2), it should be faster than Tagir's and reasonable(-ish) in practice. This is because the inner loop starts off not executing at all in the outer loop's first iteration; and each time the o

Re: [PATCH] JDK-8134373: explore potential uses of convenience factories within the JDK

2016-09-10 Thread Jonathan Bluett-Duncan
Sorry, it seems Gmail is not cooperating with me... If anyone does need to see the patches in-body, then I'd be happy to inline them directly in a reply, but that wouldn't be ideal since there are 18 of them in total... :/ On 11 September 2016 at 00:54, Jonathan Bluett-Duncan &l

Re: [PATCH] JDK-8134373: explore potential uses of convenience factories within the JDK

2016-09-10 Thread Jonathan Bluett-Duncan
Oops, it didn't fully register for me that I actually needed to include attachments in the body! So here they are again, this time in the body (hopefully).

[PATCH] JDK-8134373: explore potential uses of convenience factories within the JDK

2016-09-10 Thread Jonathan Bluett-Duncan
Hi all, Would you kindly review this patch to replace existing uses of Collections.unmodifiable*(*Arrays.asList(*)) and plain Arrays.asList(*) with (List|Set|Map).of(*). You may find the patch files in the attachments. My rationale for replacing uses of Collections.unmodifiable*... with (List|Set

Re: Make iterators cloneable?

2016-09-10 Thread Jonathan Bluett-Duncan
trying to do? Best, Jonathan On 10 September 2016 at 23:36, Jonathan Bluett-Duncan < jbluettdun...@gmail.com> wrote: > Hi Dave, > > Rather than using Iterator.clone(), how about you just call > collection.iterator() 2 times to return 2 unique, non-same iterators; >

Re: Make iterators cloneable?

2016-09-10 Thread Jonathan Bluett-Duncan
Hi Dave, Rather than using Iterator.clone(), how about you just call collection.iterator() 2 times to return 2 unique, non-same iterators; something like the following: import java.util.Collections; import java.util.Iterator; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; p

Re: Participating on https://bugs.openjdk.java.net/browse/JDK-8156070

2016-09-10 Thread Jonathan Bluett-Duncan
pilev wrote: > On 09/06/2016 01:49 AM, Jonathan Bluett-Duncan wrote: > > I decided to have a crack at "JDK-8134373 explore potential uses of > > convenience factories within the JDK" today. I recognise it's only a P4 > bug > > and most likely won't b

Re: Participating on https://bugs.openjdk.java.net/browse/JDK-8156070

2016-09-05 Thread Jonathan Bluett-Duncan
Hi Stuart, Thank you for the very detailed response. I decided to have a crack at "JDK-8134373 explore potential uses of convenience factories within the JDK" today. I recognise it's only a P4 bug and most likely won't be prioritised for Java 9, but I believe I found a number of places where uses

Re: Participating on https://bugs.openjdk.java.net/browse/JDK-8156070

2016-09-02 Thread Jonathan Bluett-Duncan
269 <http://openjdk.java.net/jeps/269>? Kind regards, Jonathan On 28 August 2016 at 17:25, Jonathan Bluett-Duncan wrote: > Hi all, > > My name is Jonathan, and it's my first time posting to this mailing list. > > I'm writing to you all as I'm rather interested

Participating on https://bugs.openjdk.java.net/browse/JDK-8156070

2016-08-28 Thread Jonathan Bluett-Duncan
the ball rolling as soon as possible. Kind regards, Jonathan Bluett-Duncan