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

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 [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

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

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

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

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

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

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

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

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

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 > >

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

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

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

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: