On Sun, 10 Jan 2021 04:55:38 GMT, Xue-Lei Andrew Fan <xue...@openjdk.org> wrote:

>> Weijun Wang has refreshed the contents of this pull request, and previous 
>> commits have been removed. The incremental views will show differences 
>> compared to the previous content of the PR.
>
> src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/algorithms/SignatureAlgorithm.java
>  line 196:
> 
>> 194:             @SuppressWarnings("deprecation")
>> 195:             SignatureAlgorithmSpi result = 
>> implementingClass.newInstance();
>> 196:             return result;
> 
> A IDE may have a warning for the result value as it is not really necessary, 
> except for the suppress warnings.  Maybe, the @SuppressWarings could be 
> placed in the method level.  Just for your reference, go ahead with your 
> preference.

I am using IntelliJ and there is not such a warning. I chose this style because 
that exactly where the suppressed warning happens and I don't want a reader to 
search for it.

That said, I'm now thinking of updating the `newInstance()` call with 
`getDeclaredConstructor().newInstance()`, as suggested by the `@deprecated` 
section of `newInstance()`. I'll also update to 2021.

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

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

Reply via email to