On Tue, 7 Apr 2026 16:34:23 GMT, Weijun Wang <[email protected]> wrote:

>> Mark Powers has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   comment from Ferenc
>
> src/java.base/share/classes/sun/security/provider/DigestBase.java line 250:
> 
>> 248:             throws ProviderException {
>> 249:         throw new ProviderException("should not be here");
>> 250:     }
> 
> Usually when we add a new method to an abstract class, the default 
> implementation throws an `UnsupportedOperationException`.
> 
> Also, now that this is put inside a very base class, please add some detailed 
> javadoc explaining the purpose.

/**
     * Digest block-length bytes in a single operation.
     * Subclasses can override this method.
     * You can cast a SHA2 or SHA3 object to DigestBase
     * and call this method without knowing which one
     * (SHA2 or SHA3) will perform the override.
     */

I prefer two lines like the other javadoc comments. The last sentence might 
only be useful for my understanding.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/29833#discussion_r3052706731

Reply via email to