On Tue, 7 Dec 2021 00:08:03 GMT, Valerie Peng <[email protected]> wrote:
>> src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11AEADCipher.java
>> line 405:
>>
>>> 403: private void cancelOperation() {
>>> 404: // cancel operation by finishing it; avoid killSession as some
>>> 405: // hardware vendors may require re-login
>>
>> The new `cancelOperation()` methods seems identical everywhere. Is it
>> possible to consolidate it to a helper method like `trySessionCancel(token,
>> session, flags)`? It can return true if canceled successfully, false if
>> needs a fallback, and can still throw a `ProviderException`.
>
> I assume you mean the if-() block of code? I can move the code into a helper
> method inside the P11Util class.
Yes, just keep duplicated lines as few as possible.
-------------
PR: https://git.openjdk.java.net/jdk/pull/6655