Skip to content

Commit

Permalink
apacheGH-15187: Change class instantiation
Browse files Browse the repository at this point in the history
  • Loading branch information
rtadepalli committed Jun 14, 2023
1 parent 7f73e3c commit fe52705
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,8 @@ public FieldReader getReader() {
synchronized (this) {
if (fieldReader == null) {
try {
fieldReader =
(FieldReader) Class.forName(getReaderImplClass().getName()).getConstructor(getClass())
.newInstance(this);
} catch (ClassNotFoundException | NoSuchMethodException | InstantiationException | IllegalAccessException |
fieldReader = getReaderImplClass().getDeclaredConstructor(getClass()).newInstance(this);
} catch (NoSuchMethodException | InstantiationException | IllegalAccessException |
InvocationTargetException e) {
logger.error("Unable to instantiate FieldReader for {} because of: ", getClass().getSimpleName(), e);
throw new RuntimeException(e);
Expand Down

0 comments on commit fe52705

Please sign in to comment.