Integrated: JDK-6725221 Standardize obtaining boolean properties with defaults

2022-05-24 Thread Mark Powers
On Thu, 5 May 2022 16:49:07 GMT, Mark Powers  wrote:

> JDK-6725221 Standardize obtaining boolean properties with defaults

This pull request has now been integrated.

Changeset: 6cc4bb11
Author:    Mark Powers 
Committer: Bradford Wetmore 
URL:   
https://git.openjdk.java.net/jdk/commit/6cc4bb1169f34bc091cad3e2deec37cd5585e8d5
Stats: 9 lines in 3 files changed: 1 ins; 1 del; 7 mod

6725221: Standardize obtaining boolean properties with defaults

Reviewed-by: prr, rriggs

-

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


Re: RFR: JDK-6725221 Standardize obtaining boolean properties with defaults [v2]

2022-05-24 Thread Mark Powers
On Mon, 23 May 2022 18:58:34 GMT, Mark Powers  wrote:

>> JDK-6725221 Standardize obtaining boolean properties with defaults
>
> Mark Powers has updated the pull request with a new target base due to a 
> merge or a rebase. The pull request now contains six commits:
> 
>  - Alan and Jamil comments
>  - Merge
>  - reverse true.equals and false.equals changes
>  - Merge
>  - Merge
>  - first iteration

Mach5 tier1 and tier2 completed without any failures. I don't know what to make 
of the pre-submit failures - lang and hotspot?

-

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


Re: RFR: JDK-6725221 Standardize obtaining boolean properties with defaults [v2]

2022-05-23 Thread Mark Powers
On Mon, 23 May 2022 18:34:41 GMT, Roger Riggs  wrote:

>> You are right. The old way maps the null string to true, and the new way 
>> maps it to false. I did not notice that. At this point, I see no value in 
>> making the "true".equals and "false".equals changes. Too much can break. 
>> I'll reverse these changes.
>
> This change still needs to be reversed.

The change has been reversed.

We had an internal discussion about IntelliJ's unboxing recommendation, and 
decided to let unboxing be a matter of personal preference. Those changes have 
been reversed too.

-

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


Re: RFR: JDK-6725221 Standardize obtaining boolean properties with defaults [v2]

2022-05-23 Thread Mark Powers
> JDK-6725221 Standardize obtaining boolean properties with defaults

Mark Powers has updated the pull request with a new target base due to a merge 
or a rebase. The pull request now contains six commits:

 - Alan and Jamil comments
 - Merge
 - reverse true.equals and false.equals changes
 - Merge
 - Merge
 - first iteration

-

Changes: https://git.openjdk.java.net/jdk/pull/8559/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk=8559=01
  Stats: 9 lines in 3 files changed: 1 ins; 1 del; 7 mod
  Patch: https://git.openjdk.java.net/jdk/pull/8559.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/8559/head:pull/8559

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


Re: RFR: 8283577: SSLEngine.unwrap on read-only input ByteBuffer

2022-05-10 Thread Mark Powers
On Fri, 29 Apr 2022 03:58:57 GMT, Anthony Scarpino  
wrote:

> Hi,
> 
> I need a review of this fix to allow a read-only 'src' buffer to be used with 
> SSLEngine.unwrap(). A temporary read-write buffer is created in the SSLCipher 
> operation when a read-only buffer is passed. If the 'src' is read-write, 
> there is no effect on the current operation
> 
> The PR also includes a CSR for an API implementation note to the 
> SSLEngine.unwrap. The 'src' buffer may be modified during the decryption 
> operation. 'unwrap()' has had this behavior forever, so there is no 
> compatibility issue with this note. Using the 'src' buffer for in-place 
> decryption was a performance decision.
> 
> Tony

I don't yet count as a reviewer, but your changes look good to me. You might 
want to let IntelliJ check for problems before you integrate.

-

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


Re: RFR: JDK-6725221 Standardize obtaining boolean properties with defaults

2022-05-10 Thread Mark Powers
On Fri, 6 May 2022 17:56:44 GMT, Alan Bateman  wrote:

>> JDK-6725221 Standardize obtaining boolean properties with defaults
>
> src/java.base/share/classes/java/lang/reflect/AccessibleObject.java line 777:
> 
>> 775: if (!printStackPropertiesSet && VM.initLevel() >= 1) {
>> 776: printStackWhenAccessFails = GetBooleanAction.
>> 777: 
>> privilegedGetProperty("sun.reflect.debugModuleAccessChecks");
> 
> Running with `-Dsun.reflect.debugModuleAccessChecks` should set 
> printStackWhenAccessFails to true, not false.

You are right. The old way maps the null string to true, and the new way maps 
it to false. I did not notice that. At this point, I see no value in making the 
"true".equals and "false".equals changes. Too much can break. I'll reverse 
these changes.

-

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


RFR: JDK-6725221 Standardize obtaining boolean properties with defaults

2022-05-06 Thread Mark Powers
JDK-6725221 Standardize obtaining boolean properties with defaults

-

Commit messages:
 - Merge
 - first iteration

Changes: https://git.openjdk.java.net/jdk/pull/8559/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk=8559=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-6725221
  Stats: 27 lines in 10 files changed: 1 ins; 4 del; 22 mod
  Patch: https://git.openjdk.java.net/jdk/pull/8559.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/8559/head:pull/8559

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


Integrated: JDK-8285504 Minor cleanup could be done in javax.net

2022-04-28 Thread Mark Powers
On Mon, 25 Apr 2022 17:40:13 GMT, Mark Powers  wrote:

> https://bugs.openjdk.java.net/browse/JDK-8285504
> 
> JDK-8273046 is the umbrella bug for this bug. The changes were too large for 
> a single code review, so it was decided to split into smaller chunks. This is 
> one such chunk: 
> 
> open/src/java.base/share/classes/java/net

This pull request has now been integrated.

Changeset: 573eacec
Author:Mark Powers 
Committer: Bradford Wetmore 
URL:   
https://git.openjdk.java.net/jdk/commit/573eaceca559a8a0832b1e1a7181b2f21d3978c7
Stats: 129 lines in 20 files changed: 1 ins; 22 del; 106 mod

8285504: Minor cleanup could be done in javax.net

Reviewed-by: wetmore

-

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


Re: RFR: JDK-8285504 Minor cleanup could be done in javax.net [v4]

2022-04-28 Thread Mark Powers
On Thu, 28 Apr 2022 16:23:25 GMT, Bradford Wetmore  wrote:

>> src/java.base/share/classes/javax/net/ssl/TrustManagerFactory.java line 82:
>> 
>>> 80: String type;
>>> 81: type = GetPropertyAction.privilegedGetProperty(
>>> 82: "ssl.TrustManagerFactory.algorithm");
>> 
>> Sorry I got it wrong here, this is a security property.
>
> Similar comment.

Back to the original lambda expression.

-

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


Re: RFR: JDK-8285504 Minor cleanup could be done in javax.net [v5]

2022-04-28 Thread Mark Powers
> https://bugs.openjdk.java.net/browse/JDK-8285504
> 
> JDK-8273046 is the umbrella bug for this bug. The changes were too large for 
> a single code review, so it was decided to split into smaller chunks. This is 
> one such chunk: 
> 
> open/src/java.base/share/classes/java/net

Mark Powers has updated the pull request incrementally with one additional 
commit since the last revision:

  Max and Brad comments round two

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/8384/files
  - new: https://git.openjdk.java.net/jdk/pull/8384/files/6997837f..15a9f3b8

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

  Stats: 14 lines in 3 files changed: 7 ins; 2 del; 5 mod
  Patch: https://git.openjdk.java.net/jdk/pull/8384.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/8384/head:pull/8384

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


Re: RFR: JDK-8285504 Minor cleanup could be done in javax.net [v4]

2022-04-28 Thread Mark Powers
On Thu, 28 Apr 2022 17:29:53 GMT, Bradford Wetmore  wrote:

>> My mistake. It's only the trim that you wanted removed, line 94.
>
> No, the API for Security.getProperty doesn't specify trimming, so suggest 
> leaving the trim() part also.

Okay. Line 94 is back.

-

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


Re: RFR: JDK-8285504 Minor cleanup could be done in javax.net [v4]

2022-04-28 Thread Mark Powers
On Thu, 28 Apr 2022 16:14:01 GMT, Bradford Wetmore  wrote:

>> src/java.base/share/classes/javax/net/ssl/KeyManagerFactory.java line 70:
>> 
>>> 68: String type;
>>> 69: type = GetPropertyAction.privilegedGetProperty(
>>> 70: "ssl.KeyManagerFactory.algorithm");
>> 
>> So sorry I got it wrong here, this is a security property. 
>> `GetPropertyAction.privilegedGetProperty` is for system properties.
>
> I just noticed the same.

Interesting that mach5 tier1 and tier2 tests passed.

-

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


Re: RFR: JDK-8285504 Minor cleanup could be done in javax.net [v2]

2022-04-28 Thread Mark Powers
On Wed, 27 Apr 2022 20:22:42 GMT, Mark Powers  wrote:

>> JDK-6725221 is about obtaining boolean properties, so not an exact match. 
>> The suggested change is so easy, I'm going to do it.
>
> sun.security.action.GetPropertyAction::privilegedGetProperty doesn't trim the 
> return value. Could this be a problem?

Answer is no.

-

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


Re: RFR: JDK-8285504 Minor cleanup could be done in javax.net [v4]

2022-04-27 Thread Mark Powers
> https://bugs.openjdk.java.net/browse/JDK-8285504
> 
> JDK-8273046 is the umbrella bug for this bug. The changes were too large for 
> a single code review, so it was decided to split into smaller chunks. This is 
> one such chunk: 
> 
> open/src/java.base/share/classes/java/net

Mark Powers has updated the pull request with a new target base due to a merge 
or a rebase. The incremental webrev excludes the unrelated changes brought in 
by the merge/rebase. The pull request contains eight additional commits since 
the last revision:

 - Merge
 - Max and Brad comments
 - jaikiran comments
 - Alan Bateman comments
 - second iteration
 - Merge
 - Merge
 - first iteration

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/8384/files
  - new: https://git.openjdk.java.net/jdk/pull/8384/files/7624f4a9..6997837f

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

  Stats: 12840 lines in 345 files changed: 9325 ins; 1407 del; 2108 mod
  Patch: https://git.openjdk.java.net/jdk/pull/8384.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/8384/head:pull/8384

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


Re: RFR: JDK-8285504 Minor cleanup could be done in javax.net [v2]

2022-04-27 Thread Mark Powers
On Tue, 26 Apr 2022 19:09:46 GMT, Weijun Wang  wrote:

>> Mark Powers has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   Alan Bateman comments
>
> src/java.base/share/classes/javax/net/ssl/TrustManagerFactory.java line 81:
> 
>> 79: String type;
>> 80: type = AccessController.doPrivileged((PrivilegedAction) 
>> () ->
>> 81: Security.getProperty( "ssl.TrustManagerFactory.algorithm"));
> 
> Another `GetPropertyAction::privilegedGetProperty` candidate.

Making the change.

-

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


Re: RFR: JDK-8285504 Minor cleanup could be done in javax.net [v2]

2022-04-27 Thread Mark Powers
On Tue, 26 Apr 2022 22:08:42 GMT, Weijun Wang  wrote:

>> Perhaps as part of 
>> [JDK-6725221](https://bugs.openjdk.java.net/browse/JDK-6725221)?
>
> No problem.

JDK-6725221 is about obtaining boolean properties, so not an exact match. The 
suggested change is so easy, I'm going to do it.

-

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


Re: RFR: JDK-8285504 Minor cleanup could be done in javax.net [v2]

2022-04-27 Thread Mark Powers
On Tue, 26 Apr 2022 19:08:50 GMT, Weijun Wang  wrote:

>> Mark Powers has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   Alan Bateman comments
>
> src/java.base/share/classes/javax/net/ssl/SSLSocketFactory.java line 96:
> 
>> 94: s = s.trim();
>> 95: if (s.isEmpty()) {
>> 96: s = null;
> 
> According to the implementation of `Security::getProperty`. The return value 
> is already trimmed.

Removed those lines.

-

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


Re: RFR: JDK-8285504 Minor cleanup could be done in javax.net [v2]

2022-04-27 Thread Mark Powers
On Tue, 26 Apr 2022 18:46:02 GMT, Bradford Wetmore  wrote:

>> Mark Powers has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   Alan Bateman comments
>
> src/java.base/share/classes/javax/net/ssl/SSLSessionBindingEvent.java line 37:
> 
>> 35:  * {@link SSLSession#putValue(String, Object)}
>> 36:  * or {@link SSLSession#removeValue(String)}, objects which
>> 37:  * implement the SSLSessionBindingListener will receive an
> 
> If you're up for it, you could fix the missing ``  or `@link` 
> throughout this small file.  Ignore otherwise.

I'll ignore for now. Javadoc issues are already being tracked for javax.crypto 
with JDK-8284851. This bug could easily be expanded to include javax.net.

-

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


Re: RFR: JDK-8285504 Minor cleanup could be done in javax.net [v2]

2022-04-26 Thread Mark Powers
On Tue, 26 Apr 2022 18:39:33 GMT, Bradford Wetmore  wrote:

>> Mark Powers has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   Alan Bateman comments
>
> src/java.base/share/classes/javax/net/ssl/KeyStoreBuilderParameters.java line 
> 72:
> 
>> 70: 
>> 71: this.parameters = List.copyOf(parameters);
>> 72: }
> 
> If you leave this as is, you can use `<>`

Using <>.

-

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


Re: RFR: JDK-8285504 Minor cleanup could be done in javax.net [v3]

2022-04-26 Thread Mark Powers
> https://bugs.openjdk.java.net/browse/JDK-8285504
> 
> JDK-8273046 is the umbrella bug for this bug. The changes were too large for 
> a single code review, so it was decided to split into smaller chunks. This is 
> one such chunk: 
> 
> open/src/java.base/share/classes/java/net

Mark Powers has updated the pull request incrementally with one additional 
commit since the last revision:

  jaikiran comments

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/8384/files
  - new: https://git.openjdk.java.net/jdk/pull/8384/files/d964c05a..7624f4a9

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

  Stats: 3 lines in 1 file changed: 1 ins; 0 del; 2 mod
  Patch: https://git.openjdk.java.net/jdk/pull/8384.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/8384/head:pull/8384

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


Re: RFR: JDK-8285504 Minor cleanup could be done in javax.net [v2]

2022-04-26 Thread Mark Powers
On Tue, 26 Apr 2022 04:37:58 GMT, Jaikiran Pai  wrote:

>> Mark Powers has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   Alan Bateman comments
>
> src/java.base/share/classes/javax/net/ssl/KeyStoreBuilderParameters.java line 
> 71:
> 
>> 69: }
>> 70: 
>> 71: this.parameters = List.copyOf(parameters);
> 
> Hello Mark, this would actually be a change in behaviour. The `List.copyOf` 
> says:
> 
>> The given Collection must not be null and it must not contain any null 
>> elements.
> 
> The current implementation of the public constructor on the public 
> `KeyStoreBuilderParameters` mandates no such requirement. So if there's some 
> code which currently passes a list with a null element in it, then this 
> change will now end up throwing a `NullPointerException` as per the contract 
> of `List.copyOf`.

You are correct. This is not a good change since it changes behavior. Going 
back to the original. Thanks for your review!

-

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


Re: RFR: JDK-8285504 Minor cleanup could be done in javax.net [v2]

2022-04-25 Thread Mark Powers
> https://bugs.openjdk.java.net/browse/JDK-8285504
> 
> JDK-8273046 is the umbrella bug for this bug. The changes were too large for 
> a single code review, so it was decided to split into smaller chunks. This is 
> one such chunk: 
> 
> open/src/java.base/share/classes/java/net

Mark Powers has updated the pull request incrementally with one additional 
commit since the last revision:

  Alan Bateman comments

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/8384/files
  - new: https://git.openjdk.java.net/jdk/pull/8384/files/5ac7f1ec..d964c05a

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk=8384=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk=8384=00-01

  Stats: 4 lines in 1 file changed: 0 ins; 2 del; 2 mod
  Patch: https://git.openjdk.java.net/jdk/pull/8384.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/8384/head:pull/8384

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


Re: RFR: JDK-8285504 Minor cleanup could be done in javax.net

2022-04-25 Thread Mark Powers
On Mon, 25 Apr 2022 18:48:31 GMT, Alan Bateman  wrote:

>> https://bugs.openjdk.java.net/browse/JDK-8285504
>> 
>> JDK-8273046 is the umbrella bug for this bug. The changes were too large for 
>> a single code review, so it was decided to split into smaller chunks. This 
>> is one such chunk: 
>> 
>> open/src/java.base/share/classes/java/net
>
> src/java.base/share/classes/javax/net/ssl/SSLSessionContext.java line 110:
> 
>> 108:  */
>> 109: void setSessionTimeout(int seconds)
>> 110:  throws IllegalArgumentException;
> 
> IllegalArgumentException is a runtime exception, it's unusual to have "throws 
> IllegalArgumentException". It would not impact compatibility to drop it. The 
> important thing is that the javadoc has the `@throws` describing when it is 
> thrown.

I'll drop it then. Thanks for noticing this.

-

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


RFR: JDK-8285504 Minor cleanup could be done in javax.net

2022-04-25 Thread Mark Powers
https://bugs.openjdk.java.net/browse/JDK-8285504

JDK-8273046 is the umbrella bug for this bug. The changes were too large for a 
single code review, so it was decided to split into smaller chunks. This is one 
such chunk: 

open/src/java.base/share/classes/java/net

-

Commit messages:
 - second iteration
 - Merge
 - Merge
 - first iteration

Changes: https://git.openjdk.java.net/jdk/pull/8384/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk=8384=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8285504
  Stats: 128 lines in 20 files changed: 1 ins; 21 del; 106 mod
  Patch: https://git.openjdk.java.net/jdk/pull/8384.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/8384/head:pull/8384

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