Re: RFR: 8282316: Operation before String case conversion [v3]

2022-02-23 Thread Xue-Lei Andrew Fan
> In the SignatureUtil implementation, the checkName() requires 
> case-insensitive input for "OID".  However, the method is called before the 
> case conversion, for example: 
> 
> sigName = checkName(sigName).toUpperCase(Locale.ENGLISH); 
> 
> This update also clean up redundant calls to the checkName() method.

Xue-Lei Andrew Fan has updated the pull request incrementally with one 
additional commit since the last revision:

  udpate summary spec of checkName

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/7598/files
  - new: https://git.openjdk.java.net/jdk/pull/7598/files/4faf3da7..5c6e4275

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

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

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


Re: RFR: 8282316: Operation before String case conversion [v2]

2022-02-23 Thread Xue-Lei Andrew Fan
On Wed, 23 Feb 2022 23:53:39 GMT, Weijun Wang  wrote:

>> Xue-Lei Andrew Fan has updated the pull request incrementally with one 
>> additional commit since the last revision:
>> 
>>   udpate return state as well
>
> src/java.base/share/classes/sun/security/util/SignatureUtil.java line 51:
> 
>> 49: /**
>> 50:  * Convert OID.1.2.3.4 or 1.2.3.4 to its matching stdName, and 
>> literal
>> 51:  * name to upper case.
> 
> It sounds like you only convert literal name to upper case and return stdName 
> for OIDs.

Hm, it makes sense to me.  Updated in the next commit.

-

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


Re: RFR: 8282316: Operation before String case conversion [v2]

2022-02-23 Thread Weijun Wang
On Wed, 23 Feb 2022 23:41:36 GMT, Xue-Lei Andrew Fan  wrote:

>> In the SignatureUtil implementation, the checkName() requires 
>> case-insensitive input for "OID".  However, the method is called before the 
>> case conversion, for example: 
>> 
>> sigName = checkName(sigName).toUpperCase(Locale.ENGLISH); 
>> 
>> This update also clean up redundant calls to the checkName() method.
>
> Xue-Lei Andrew Fan has updated the pull request incrementally with one 
> additional commit since the last revision:
> 
>   udpate return state as well

src/java.base/share/classes/sun/security/util/SignatureUtil.java line 51:

> 49: /**
> 50:  * Convert OID.1.2.3.4 or 1.2.3.4 to its matching stdName, and literal
> 51:  * name to upper case.

It sounds like you only convert literal name to upper case and return stdName 
for OIDs.

-

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


Re: RFR: 8282316: Operation before String case conversion [v2]

2022-02-23 Thread Xue-Lei Andrew Fan
> In the SignatureUtil implementation, the checkName() requires 
> case-insensitive input for "OID".  However, the method is called before the 
> case conversion, for example: 
> 
> sigName = checkName(sigName).toUpperCase(Locale.ENGLISH); 
> 
> This update also clean up redundant calls to the checkName() method.

Xue-Lei Andrew Fan has updated the pull request incrementally with one 
additional commit since the last revision:

  udpate return state as well

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/7598/files
  - new: https://git.openjdk.java.net/jdk/pull/7598/files/e90b7305..4faf3da7

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

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

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


Re: RFR: 8282316: Operation before String case conversion

2022-02-23 Thread Xue-Lei Andrew Fan
On Wed, 23 Feb 2022 22:41:10 GMT, Valerie Peng  wrote:

>> In the SignatureUtil implementation, the checkName() requires 
>> case-insensitive input for "OID".  However, the method is called before the 
>> case conversion, for example: 
>> 
>> sigName = checkName(sigName).toUpperCase(Locale.ENGLISH); 
>> 
>> This update also clean up redundant calls to the checkName() method.
>
> src/java.base/share/classes/sun/security/util/SignatureUtil.java line 54:
> 
>> 52:  *
>> 53:  * @param algName input, could be in any form
>> 54:  * @return the matching stdName, or {@code algName} if it is not in 
>> the
> 
> nit: simplify this return description and emphasize upper case here also? 
> E.g. the matching stdName or the OID string in upper case.

Good point!  I will make this update in this PR.

-

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


Re: RFR: 8282316: Operation before String case conversion

2022-02-23 Thread Valerie Peng
On Wed, 23 Feb 2022 19:25:10 GMT, Xue-Lei Andrew Fan  wrote:

> In the SignatureUtil implementation, the checkName() requires 
> case-insensitive input for "OID".  However, the method is called before the 
> case conversion, for example: 
> 
> sigName = checkName(sigName).toUpperCase(Locale.ENGLISH); 
> 
> This update also clean up redundant calls to the checkName() method.

Looks good. Thanks~

src/java.base/share/classes/sun/security/util/SignatureUtil.java line 54:

> 52:  *
> 53:  * @param algName input, could be in any form
> 54:  * @return the matching stdName, or {@code algName} if it is not in 
> the

nit: simplify this return description and emphasize upper case here also? E.g. 
the matching stdName or the OID string in upper case.

-

Marked as reviewed by valeriep (Reviewer).

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