Skip to content

Commit

Permalink
Better local var name
Browse files Browse the repository at this point in the history
  • Loading branch information
garydgregory committed Oct 21, 2023
1 parent 1f32f54 commit ad99461
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -184,20 +184,20 @@ public static CryptoRandom getCryptoRandom(final Properties props)
final StringBuilder errorMessage = new StringBuilder();
CryptoRandom random = null;
Exception lastException = null;
for (final String klassName : names) {
for (final String className : names) {
try {
final Class<?> klass = ReflectionUtils.getClassByName(klassName);
final Class<?> klass = ReflectionUtils.getClassByName(className);
random = (CryptoRandom) ReflectionUtils.newInstance(klass, props);
break;
} catch (final ClassCastException e) {
lastException = e;
errorMessage.append("Class: [" + klassName + "] is not a CryptoRandom.");
errorMessage.append("Class: [" + className + "] is not a CryptoRandom.");
} catch (final ClassNotFoundException e) {
lastException = e;
errorMessage.append("CryptoRandom: [" + klassName + "] not found.");
errorMessage.append("CryptoRandom: [" + className + "] not found.");
} catch (final Exception e) {
lastException = e;
errorMessage.append("CryptoRandom: [" + klassName + "] failed with " + e.getMessage());
errorMessage.append("CryptoRandom: [" + className + "] failed with " + e.getMessage());
}
}

Expand Down

0 comments on commit ad99461

Please sign in to comment.