Re: RFR: 8258422: Cleanup unnecessary null comparison before instanceof check in java.base [v4]

2021-01-08 Thread Chris Hegarty
On Fri, 8 Jan 2021 13:20:38 GMT, Aleksei Efimov  wrote:

>> This issue is blocked by [8258657][1]. It should not be integrated until 
>> after 8258657 has been resolved. The JIRA issues have been linked up to 
>> reflect this.
>> 
>> [1]: https://bugs.openjdk.java.net/browse/JDK-8258657
>
> [JDK-8258657](https://bugs.openjdk.java.net/browse/JDK-8258657) has been 
> resolved. The changes reverted by 
> [JDK-8258696](https://bugs.openjdk.java.net/browse/JDK-8258696) could also be 
> re-applied to `HttpClientImpl` class.

@AlekseiEfimov Yes please. Whatever is easier, include the changes to 
HttpClientImpl in this PR, or followup separately. Otherwise, I see no reason 
why this PR cannot proceed.

-

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


Re: RFR: 8258422: Cleanup unnecessary null comparison before instanceof check in java.base [v4]

2021-01-08 Thread Aleksei Efimov
On Sat, 19 Dec 2020 10:29:23 GMT, Chris Hegarty  wrote:

>> Thank you for checking `HttpURLConnection` and `Socket`.
>> The latest version looks good to me.
>
> This issue is blocked by [8258657][1]. It should not be integrated until 
> after 8258657 has been resolved. The JIRA issues have been linked up to 
> reflect this.
> 
> [1]: https://bugs.openjdk.java.net/browse/JDK-8258657

[JDK-8258657](https://bugs.openjdk.java.net/browse/JDK-8258657) has been 
resolved. The changes reverted by 
[JDK-8258696](https://bugs.openjdk.java.net/browse/JDK-8258696) could also be 
re-applied to `HttpClientImpl` class.

-

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


Re: RFR: 8258422: Cleanup unnecessary null comparison before instanceof check in java.base [v4]

2020-12-19 Thread Chris Hegarty
On Thu, 17 Dec 2020 13:16:31 GMT, Aleksei Efimov  wrote:

>> Andrey Turbanov has updated the pull request incrementally with one 
>> additional commit since the last revision:
>> 
>>   8258422: Cleanup unnecessary null comparison before instanceof check in 
>> java.base
>>   take advantage of "flow scoping" to eliminate casts
>
> Thank you for checking `HttpURLConnection` and `Socket`.
> The latest version looks good to me.

This issue is blocked by [8258657][1]. It should not be integrated until after 
8258657 has been resolved. The JIRA issues have been linked up to reflect this.

[1]: https://bugs.openjdk.java.net/browse/JDK-8258657

-

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


Re: RFR: 8258422: Cleanup unnecessary null comparison before instanceof check in java.base [v4]

2020-12-17 Thread Alan Bateman
On Thu, 17 Dec 2020 13:32:06 GMT, Daniel Fuchs  wrote:

>> Actually, I'm not sure if `oth` is better name for variable than `other1`.
>> I would say they have the same rank :)
>
> I believe Alan is suggesting to do:
> 
> /**
>  * Compares the equality of two Signal objects.
>  *
>  * @param obj the object to compare with.
>  * @return whether two Signal objects are equal.
>  */
> public boolean equals(Object obj) {
> if (this == obj) {
> 
> this leaves the variable name `other` free for later use inside the method.

> Actually, I'm not sure if `oth` is better name for variable than `other1`.
> I would say they have the same rank :)

Sorry, I should have been clearer, the comment was about equals(Object other). 
If you rename "other" then it will avoid "other1"

-

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


Re: RFR: 8258422: Cleanup unnecessary null comparison before instanceof check in java.base [v4]

2020-12-17 Thread Daniel Fuchs
On Thu, 17 Dec 2020 11:35:26 GMT, Andrey Turbanov 
 wrote:

>> src/java.base/share/classes/jdk/internal/misc/Signal.java line 102:
>> 
>>> 100:  */
>>> 101: public boolean equals(Object other) {
>>> 102: if (this == other) {
>> 
>> It might be a bit cleaner to rename Object other to "obj" to avoid having 
>> Object other and Signal other1.
>
> Actually, I'm not sure if `oth` is better name for variable than `other1`.
> I would say they have the same rank :)

I believe Alan is suggesting to do:

/**
 * Compares the equality of two Signal objects.
 *
 * @param obj the object to compare with.
 * @return whether two Signal objects are equal.
 */
public boolean equals(Object obj) {
if (this == obj) {

this leaves the variable name `other` free for later use inside the method.

-

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


Re: RFR: 8258422: Cleanup unnecessary null comparison before instanceof check in java.base [v4]

2020-12-17 Thread Aleksei Efimov
On Wed, 16 Dec 2020 10:32:12 GMT, Andrey Turbanov 
 wrote:

>> 8258422: Cleanup unnecessary null comparison before instanceof check in 
>> java.base
>
> Andrey Turbanov has updated the pull request incrementally with one 
> additional commit since the last revision:
> 
>   8258422: Cleanup unnecessary null comparison before instanceof check in 
> java.base
>   take advantage of "flow scoping" to eliminate casts

Thank you for checking `HttpURLConnection` and `Socket`.
The latest version looks good to me.

-

Marked as reviewed by aefimov (Committer).

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


Re: RFR: 8258422: Cleanup unnecessary null comparison before instanceof check in java.base [v4]

2020-12-17 Thread Andrey Turbanov
On Thu, 17 Dec 2020 10:29:50 GMT, Alan Bateman  wrote:

>> Andrey Turbanov has updated the pull request incrementally with one 
>> additional commit since the last revision:
>> 
>>   8258422: Cleanup unnecessary null comparison before instanceof check in 
>> java.base
>>   take advantage of "flow scoping" to eliminate casts
>
> src/java.base/share/classes/jdk/internal/misc/Signal.java line 102:
> 
>> 100:  */
>> 101: public boolean equals(Object other) {
>> 102: if (this == other) {
> 
> It might be a bit cleaner to rename Object other to "obj" to avoid having 
> Object other and Signal other1.

Actually, I'm not sure if `oth` is better name for variable than `other1`.
I would say they have the same rank :)

-

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


Re: RFR: 8258422: Cleanup unnecessary null comparison before instanceof check in java.base [v4]

2020-12-17 Thread Alan Bateman
On Wed, 16 Dec 2020 10:32:12 GMT, Andrey Turbanov 
 wrote:

>> 8258422: Cleanup unnecessary null comparison before instanceof check in 
>> java.base
>
> Andrey Turbanov has updated the pull request incrementally with one 
> additional commit since the last revision:
> 
>   8258422: Cleanup unnecessary null comparison before instanceof check in 
> java.base
>   take advantage of "flow scoping" to eliminate casts

src/java.base/share/classes/jdk/internal/misc/Signal.java line 102:

> 100:  */
> 101: public boolean equals(Object other) {
> 102: if (this == other) {

It might be a bit cleaner to rename Object other to "obj" to avoid having 
Object other and Signal other1.

-

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


Re: RFR: 8258422: Cleanup unnecessary null comparison before instanceof check in java.base [v4]

2020-12-17 Thread Chris Hegarty
On Wed, 16 Dec 2020 10:32:12 GMT, Andrey Turbanov 
 wrote:

>> 8258422: Cleanup unnecessary null comparison before instanceof check in 
>> java.base
>
> Andrey Turbanov has updated the pull request incrementally with one 
> additional commit since the last revision:
> 
>   8258422: Cleanup unnecessary null comparison before instanceof check in 
> java.base
>   take advantage of "flow scoping" to eliminate casts

Looks good to me.

-

Marked as reviewed by chegar (Reviewer).

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


Re: RFR: 8258422: Cleanup unnecessary null comparison before instanceof check in java.base [v4]

2020-12-16 Thread Andrey Turbanov
> 8258422: Cleanup unnecessary null comparison before instanceof check in 
> java.base

Andrey Turbanov has updated the pull request incrementally with one additional 
commit since the last revision:

  8258422: Cleanup unnecessary null comparison before instanceof check in 
java.base
  take advantage of "flow scoping" to eliminate casts

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/20/files
  - new: https://git.openjdk.java.net/jdk/pull/20/files/0d2ac405..f5727ca9

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk=20=03
 - incr: https://webrevs.openjdk.java.net/?repo=jdk=20=02-03

  Stats: 42 lines in 12 files changed: 1 ins; 10 del; 31 mod
  Patch: https://git.openjdk.java.net/jdk/pull/20.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/20/head:pull/20

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