Skip to content

Commit ae939cd

Browse files
committed
[chore] Fix deprecated use of Java API
1 parent da6870c commit ae939cd

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/main/java/org/jruby/rack/DefaultRackConfig.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,8 @@ protected RackLogger createLogger(final String loggerClass) {
140140
Constructor<?> ctor = klass.getConstructor(String.class);
141141
return (RackLogger) ctor.newInstance( getLoggerName() );
142142
}
143-
catch (NoSuchMethodException | IllegalAccessException retry) {
144-
return newLoggerInstance(klass, retry);
143+
catch (NoSuchMethodException | IllegalAccessException ignore) {
144+
return newLoggerInstance(klass);
145145
}
146146
catch (InstantiationException e) {
147147
throw new RackException("could not create logger: '" + loggerClass + "'", e);
@@ -159,9 +159,9 @@ protected RackLogger createLogger(final String loggerClass) {
159159
return null;
160160
}
161161

162-
private static RackLogger newLoggerInstance(final Class<?> klass, final Exception retry) {
162+
private static RackLogger newLoggerInstance(final Class<?> klass) {
163163
try {
164-
return (RackLogger) klass.newInstance();
164+
return (RackLogger) klass.getDeclaredConstructor().newInstance();
165165
}
166166
catch (Exception e) { // InstantiationException, IllegalAccessException
167167
throw new RackException("could not create logger: '" + klass.getName() +

0 commit comments

Comments
 (0)