< prev index next >

src/java.base/share/classes/sun/security/util/DisabledAlgorithmConstraints.java

Print this page
rev 51919 : 8215281: Use String.isEmpty() when applicable in java.base
Reviewed-by: dfuchs, alanb

*** 133,143 **** */ @Override public final boolean permits(Set<CryptoPrimitive> primitives, String algorithm, Key key, AlgorithmParameters parameters) { ! if (algorithm == null || algorithm.length() == 0) { throw new IllegalArgumentException("No algorithm name specified"); } return checkConstraints(primitives, algorithm, key, parameters); } --- 133,143 ---- */ @Override public final boolean permits(Set<CryptoPrimitive> primitives, String algorithm, Key key, AlgorithmParameters parameters) { ! if (algorithm == null || algorithm.isEmpty()) { throw new IllegalArgumentException("No algorithm name specified"); } return checkConstraints(primitives, algorithm, key, parameters); }
*** 186,196 **** if (key == null) { throw new IllegalArgumentException("The key cannot be null"); } // check the signature algorithm with parameters ! if (algorithm != null && algorithm.length() != 0) { if (!permits(primitives, algorithm, parameters)) { return false; } } --- 186,196 ---- if (key == null) { throw new IllegalArgumentException("The key cannot be null"); } // check the signature algorithm with parameters ! if (algorithm != null && !algorithm.isEmpty()) { if (!permits(primitives, algorithm, parameters)) { return false; } }
< prev index next >