Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8146725

Issues with SignatureAndHashAlgorithm.getSupportedAlgorithms

XMLWordPrintable

        The synchronization in the SignatureAndHashAlgorithm.getSupportedAlgorithms() method is not necessary:
        -------------------
            static Collection<SignatureAndHashAlgorithm>
                    getSupportedAlgorithms(AlgorithmConstraints constraints) {

                Collection<SignatureAndHashAlgorithm> supported = new ArrayList<>();
                synchronized (priorityMap) {
                    for (SignatureAndHashAlgorithm sigAlg : priorityMap.values()) {
                        if (sigAlg.priority <= SUPPORTED_ALG_PRIORITY_MAX_NUM &&
                                constraints.permits(SIGNATURE_PRIMITIVE_SET,
                                        sigAlg.algorithm, null)) {
                            supported.add(sigAlg);
                        }
                    }
                }

                return supported;
            }
        -------------------

              xuelei Xuelei Fan
              xuelei Xuelei Fan
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: