Skip to content

Commit 83dde0f

Browse files
authored
chore: remove deprecated Class#newInstance() method (#143)
1 parent fe98f46 commit 83dde0f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/main/java/com/google/cloud/logging/logback/LoggingAppender.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ <T> List<T> getEnhancers(Set<String> classNames) {
195195
private <T> T getEnhancer(String enhancerClassName) {
196196
try {
197197
Class<T> clz = (Class<T>) Loader.loadClass(enhancerClassName.trim());
198-
return clz.newInstance();
198+
return clz.getDeclaredConstructor().newInstance();
199199
} catch (Exception ex) {
200200
// If we cannot create the enhancer we fallback to null
201201
}

0 commit comments

Comments
 (0)