Re: RFR: 8263358: Update java.lang to use instanceof pattern variable [v8]

2021-03-22 Thread Mandy Chung
On Mon, 22 Mar 2021 17:47:10 GMT, Patrick Concannon wrote: >> Hi, >> >> Could someone please review my code for updating the code in the `java.lang` >> package to make use of the `instanceof` pattern variable? >> >> Kind regards, >> Patrick > > Patrick Concannon has updated the pull request w

Re: RFR: 8263358: Update java.lang to use instanceof pattern variable [v8]

2021-03-22 Thread Daniel Fuchs
On Mon, 22 Mar 2021 17:47:10 GMT, Patrick Concannon wrote: >> Hi, >> >> Could someone please review my code for updating the code in the `java.lang` >> package to make use of the `instanceof` pattern variable? >> >> Kind regards, >> Patrick > > Patrick Concannon has updated the pull request w

Re: RFR: 8263358: Update java.lang to use instanceof pattern variable [v8]

2021-03-22 Thread Patrick Concannon
> Hi, > > Could someone please review my code for updating the code in the `java.lang` > package to make use of the `instanceof` pattern variable? > > Kind regards, > Patrick Patrick Concannon has updated the pull request with a new target base due to a merge or a rebase. The incremental webre

Re: RFR: 8263358: Update java.lang to use instanceof pattern variable [v5]

2021-03-22 Thread Patrick Concannon
On Mon, 15 Mar 2021 13:49:56 GMT, Pavel Rappo wrote: >> yes, >> javac should emit a warning in that case, that also the answer of Brian. >> >> https://mail.openjdk.java.net/pipermail/amber-spec-experts/2021-March/002925.html > > Then we should use an unbounded wildcard here and in similar places

Re: RFR: 8263358: Update java.lang to use instanceof pattern variable [v5]

2021-03-22 Thread Patrick Concannon
On Tue, 16 Mar 2021 19:26:35 GMT, Daniel Fuchs wrote: >> `declaringClass` is a string representing the class name (not the `Class` >> object). The variable name indeed causes confusion. > > Doh. My mistake. Was thinking about `StackFrame`. Thanks Mandy! I've reordered the checks as suggested

Re: RFR: 8263358: Update java.lang to use instanceof pattern variable [v7]

2021-03-22 Thread Patrick Concannon
> Hi, > > Could someone please review my code for updating the code in the `java.lang` > package to make use of the `instanceof` pattern variable? > > Kind regards, > Patrick Patrick Concannon has updated the pull request incrementally with one additional commit since the last revision: 826

Re: RFR: 8263358: Update java.lang to use instanceof pattern variable [v6]

2021-03-22 Thread Patrick Concannon
> Hi, > > Could someone please review my code for updating the code in the `java.lang` > package to make use of the `instanceof` pattern variable? > > Kind regards, > Patrick Patrick Concannon has updated the pull request with a new target base due to a merge or a rebase. The incremental webre

Re: RFR: 8263358: Update java.lang to use instanceof pattern variable [v5]

2021-03-16 Thread Daniel Fuchs
On Tue, 16 Mar 2021 17:24:56 GMT, Mandy Chung wrote: >> Hi Rémi, >> There seems to be a deeper issue here - Patrick pointed that out to me - the >> specification of equals above speaks of comparing class names where the >> actual implementation compares classes. Maybe the specification should b

Re: RFR: 8263358: Update java.lang to use instanceof pattern variable [v5]

2021-03-16 Thread Mandy Chung
On Tue, 16 Mar 2021 11:13:50 GMT, Daniel Fuchs wrote: >> src/java.base/share/classes/java/lang/StackTraceElement.java line 413: >> >>> 411: && Objects.equals(moduleName, e.moduleName) >>> 412: && Objects.equals(moduleVersion, e.moduleVersion) >>> 413:

Re: RFR: 8263358: Update java.lang to use instanceof pattern variable [v5]

2021-03-16 Thread Daniel Fuchs
On Mon, 15 Mar 2021 09:35:27 GMT, Rémi Forax wrote: >> Patrick Concannon has updated the pull request incrementally with one >> additional commit since the last revision: >> >> 8263358: Refactored missed equals method > > src/java.base/share/classes/java/lang/StackTraceElement.java line 413:

Re: RFR: 8263358: Update java.lang to use instanceof pattern variable [v5]

2021-03-15 Thread Iris Clark
On Mon, 15 Mar 2021 09:21:22 GMT, Patrick Concannon wrote: >> Hi, >> >> Could someone please review my code for updating the code in the `java.lang` >> package to make use of the `instanceof` pattern variable? >> >> Kind regards, >> Patrick > > Patrick Concannon has updated the pull request i

Re: RFR: 8263358: Update java.lang to use instanceof pattern variable [v5]

2021-03-15 Thread Mandy Chung
On Mon, 15 Mar 2021 09:21:22 GMT, Patrick Concannon wrote: >> Hi, >> >> Could someone please review my code for updating the code in the `java.lang` >> package to make use of the `instanceof` pattern variable? >> >> Kind regards, >> Patrick > > Patrick Concannon has updated the pull request i

Re: RFR: 8263358: Update java.lang to use instanceof pattern variable [v5]

2021-03-15 Thread Pavel Rappo
On Mon, 15 Mar 2021 13:34:45 GMT, Rémi Forax wrote: >> I don't think that cast from `Object` to a raw type is unchecked, so as >> error does not seem warranted to me. >> >> However, I agree javac should produce the rawtype warning for rawtypes in >> pattern matching instanceof, because we are

Re: RFR: 8263358: Update java.lang to use instanceof pattern variable [v5]

2021-03-15 Thread Rémi Forax
On Mon, 15 Mar 2021 11:39:20 GMT, Jan Lahoda wrote: >> We have considered generics, that why parameterized generics with another >> type arguments are forbidden, but i think we have forgotten raw types. > > I don't think that cast from `Object` to a raw type is unchecked, so as error > does not

Re: RFR: 8263358: Update java.lang to use instanceof pattern variable [v5]

2021-03-15 Thread Jan Lahoda
On Mon, 15 Mar 2021 11:09:45 GMT, Rémi Forax wrote: >>> I think it's a bug in javac, it should not even raise a warning but an >>> error. >>> But the spec is not fully clear. >> >> If you think that it's a bug, consider providing feedback to authors of JEP >> 394: >> >>> Other refinements ma

Re: RFR: 8263358: Update java.lang to use instanceof pattern variable [v5]

2021-03-15 Thread Rémi Forax
On Mon, 15 Mar 2021 11:01:48 GMT, Pavel Rappo wrote: >> The problem is that `desc` is a raw type and raw types doesn't play well >> with the rest of the language (in particular with inference). >> >> I think it's a bug in javac, it should not even raise a warning but an error. >> But the spec i

Re: RFR: 8263358: Update java.lang to use instanceof pattern variable [v5]

2021-03-15 Thread Pavel Rappo
On Mon, 15 Mar 2021 10:47:10 GMT, Rémi Forax wrote: > I think it's a bug in javac, it should not even raise a warning but an error. > But the spec is not fully clear. If you think that it's a bug, consider providing feedback to authors of JEP 394: > Other refinements may be incorporated based

Re: RFR: 8263358: Update java.lang to use instanceof pattern variable [v5]

2021-03-15 Thread Rémi Forax
On Mon, 15 Mar 2021 10:18:26 GMT, Pavel Rappo wrote: >> src/java.base/share/classes/java/lang/constant/DynamicConstantDesc.java line >> 360: >> >>> 358: public final boolean equals(Object o) { >>> 359: if (this == o) return true; >>> 360: return (o instanceof DynamicConstant

Re: RFR: 8263358: Update java.lang to use instanceof pattern variable [v5]

2021-03-15 Thread Pavel Rappo
On Mon, 15 Mar 2021 09:32:33 GMT, Rémi Forax wrote: >> Patrick Concannon has updated the pull request incrementally with one >> additional commit since the last revision: >> >> 8263358: Refactored missed equals method > > src/java.base/share/classes/java/lang/constant/DynamicConstantDesc.jav

Re: RFR: 8263358: Update java.lang to use instanceof pattern variable [v5]

2021-03-15 Thread Rémi Forax
On Mon, 15 Mar 2021 09:21:22 GMT, Patrick Concannon wrote: >> Hi, >> >> Could someone please review my code for updating the code in the `java.lang` >> package to make use of the `instanceof` pattern variable? >> >> Kind regards, >> Patrick > > Patrick Concannon has updated the pull request i

Re: RFR: 8263358: Update java.lang to use instanceof pattern variable [v5]

2021-03-15 Thread Rémi Forax
On Mon, 15 Mar 2021 09:21:22 GMT, Patrick Concannon wrote: >> Hi, >> >> Could someone please review my code for updating the code in the `java.lang` >> package to make use of the `instanceof` pattern variable? >> >> Kind regards, >> Patrick > > Patrick Concannon has updated the pull request i

Re: RFR: 8263358: Update java.lang to use instanceof pattern variable [v5]

2021-03-15 Thread Chris Hegarty
On Mon, 15 Mar 2021 09:21:22 GMT, Patrick Concannon wrote: >> Hi, >> >> Could someone please review my code for updating the code in the `java.lang` >> package to make use of the `instanceof` pattern variable? >> >> Kind regards, >> Patrick > > Patrick Concannon has updated the pull request i

Re: RFR: 8263358: Update java.lang to use instanceof pattern variable [v3]

2021-03-15 Thread Patrick Concannon
On Fri, 12 Mar 2021 17:38:30 GMT, Chris Hegarty wrote: >> Patrick Concannon has updated the pull request incrementally with one >> additional commit since the last revision: >> >> 8263358: Refactored equals methods > > src/java.base/share/classes/java/lang/ProcessHandleImpl.java line 525: >

Re: RFR: 8263358: Update java.lang to use instanceof pattern variable [v5]

2021-03-15 Thread Patrick Concannon
> Hi, > > Could someone please review my code for updating the code in the `java.lang` > package to make use of the `instanceof` pattern variable? > > Kind regards, > Patrick Patrick Concannon has updated the pull request incrementally with one additional commit since the last revision: 826

Re: RFR: 8263358: Update java.lang to use instanceof pattern variable [v4]

2021-03-15 Thread Patrick Concannon
> Hi, > > Could someone please review my code for updating the code in the `java.lang` > package to make use of the `instanceof` pattern variable? > > Kind regards, > Patrick Patrick Concannon has updated the pull request with a new target base due to a merge or a rebase. The incremental webre

Re: RFR: 8263358: Update java.lang to use instanceof pattern variable [v3]

2021-03-12 Thread Chris Hegarty
On Thu, 11 Mar 2021 16:42:24 GMT, Patrick Concannon wrote: >> Hi, >> >> Could someone please review my code for updating the code in the `java.lang` >> package to make use of the `instanceof` pattern variable? >> >> Kind regards, >> Patrick > > Patrick Concannon has updated the pull request i

Re: RFR: 8263358: Update java.lang to use instanceof pattern variable [v3]

2021-03-11 Thread Iris Clark
On Thu, 11 Mar 2021 16:42:24 GMT, Patrick Concannon wrote: >> Hi, >> >> Could someone please review my code for updating the code in the `java.lang` >> package to make use of the `instanceof` pattern variable? >> >> Kind regards, >> Patrick > > Patrick Concannon has updated the pull request i

Re: RFR: 8263358: Update java.lang to use instanceof pattern variable [v3]

2021-03-11 Thread Patrick Concannon
On Thu, 11 Mar 2021 08:56:00 GMT, Alan Bateman wrote: >> Patrick Concannon has updated the pull request incrementally with one >> additional commit since the last revision: >> >> 8263358: Refactored equals methods > > src/java.base/share/classes/java/lang/module/ModuleDescriptor.java line 313

Re: RFR: 8263358: Update java.lang to use instanceof pattern variable [v3]

2021-03-11 Thread Patrick Concannon
> Hi, > > Could someone please review my code for updating the code in the `java.lang` > package to make use of the `instanceof` pattern variable? > > Kind regards, > Patrick Patrick Concannon has updated the pull request incrementally with one additional commit since the last revision: 826

Re: RFR: 8263358: Update java.lang to use instanceof pattern variable

2021-03-11 Thread Patrick Concannon
On Wed, 10 Mar 2021 15:08:53 GMT, Claes Redestad wrote: >> Hi, >> >> Could someone please review my code for updating the code in the `java.lang` >> package to make use of the `instanceof` pattern variable? >> >> Kind regards, >> Patrick > > Great. I included some of these in #2300 - @mlchung

Re: RFR: 8263358: Update java.lang to use instanceof pattern variable [v2]

2021-03-11 Thread Patrick Concannon
> Hi, > > Could someone please review my code for updating the code in the `java.lang` > package to make use of the `instanceof` pattern variable? > > Kind regards, > Patrick Patrick Concannon has updated the pull request with a new target base due to a merge or a rebase. The incremental webre

Re: RFR: 8263358: Update java.lang to use instanceof pattern variable

2021-03-11 Thread Alan Bateman
On Wed, 10 Mar 2021 12:59:18 GMT, Patrick Concannon wrote: > Hi, > > Could someone please review my code for updating the code in the `java.lang` > package to make use of the `instanceof` pattern variable? > > Kind regards, > Patrick src/java.base/share/classes/java/lang/module/ModuleDescrip

Re: RFR: 8263358: Update java.lang to use instanceof pattern variable

2021-03-10 Thread Claes Redestad
On Wed, 10 Mar 2021 12:59:18 GMT, Patrick Concannon wrote: > Hi, > > Could someone please review my code for updating the code in the `java.lang` > package to make use of the `instanceof` pattern variable? > > Kind regards, > Patrick Great. I included some of these in #2300 - @mlchung has as

Re: RFR: 8263358: Update java.lang to use instanceof pattern variable

2021-03-10 Thread Brian Goetz
These patches are obviously minimally correct.  However, for equals methods at least, I would take them one step further, from:     if (!(o instanceof Key that)) return false;     //noinspection StringEquality (guaranteed interned String(s))     return name == that.name &

RFR: 8263358: Update java.lang to use instanceof pattern variable

2021-03-10 Thread Patrick Concannon
Hi, Could someone please review my code for updating the code in the `java.lang` package to make use of the `instanceof` pattern variable? Kind regards, Patrick - Commit messages: - 8263358: Update java.lang to use instanceof pattern variable Changes: https://git.openjdk.java.net