On Wed, 8 Apr 2026 16:18:40 GMT, Mark Powers <[email protected]> wrote:
>> 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.
I'm mainly concerned about what the method is for and what the arguments should
look like. If I understand correctly, it's for short input that has a constant
length, and the input already includes padding bytes for the length.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/29833#discussion_r3053259094