Skip to content

Commit 7390911

Browse files
committed
[chore] Fix deprecated use of Java API
(cherry picked from commit f5e390c)
1 parent c1884c6 commit 7390911

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
@@ -184,8 +184,8 @@ protected RackLogger createLogger(final String loggerClass) {
184184
Constructor<?> ctor = klass.getConstructor(String.class);
185185
return (RackLogger) ctor.newInstance( getLoggerName() );
186186
}
187-
catch (NoSuchMethodException | IllegalAccessException retry) {
188-
return newLoggerInstance(klass, retry);
187+
catch (NoSuchMethodException | IllegalAccessException ignore) {
188+
return newLoggerInstance(klass);
189189
}
190190
catch (InstantiationException e) {
191191
throw new RackException("could not create logger: '" + loggerClass + "'", e);
@@ -203,9 +203,9 @@ protected RackLogger createLogger(final String loggerClass) {
203203
return null;
204204
}
205205

206-
private static RackLogger newLoggerInstance(final Class<?> klass, final Exception retry) {
206+
private static RackLogger newLoggerInstance(final Class<?> klass) {
207207
try {
208-
return (RackLogger) klass.newInstance();
208+
return (RackLogger) klass.getDeclaredConstructor().newInstance();
209209
}
210210
catch (Exception e) { // InstantiationException, IllegalAccessException
211211
throw new RackException("could not create logger: '" + klass.getName() +

0 commit comments

Comments
 (0)