Skip to content

Commit 47f1b37

Browse files
committed
Apply OpenRewrite Java 11 migration
Apply OpenRewrite's "Migrate from Java 8 to Java 11" recipe. This is part of #1706.
1 parent 2fa005c commit 47f1b37

File tree

1 file changed

+2
-2
lines changed
  • log4j-core/src/main/java/org/apache/logging/log4j/core/tools/picocli

1 file changed

+2
-2
lines changed

log4j-core/src/main/java/org/apache/logging/log4j/core/tools/picocli/CommandLine.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2891,12 +2891,12 @@ private Collection<Object> createCollection(final Class<?> collectionClass) thro
28912891
return new ArrayList<Object>();
28922892
}
28932893
// custom Collection implementation class must have default constructor
2894-
return (Collection<Object>) collectionClass.newInstance();
2894+
return (Collection<Object>) collectionClass.getDeclaredConstructor().newInstance();
28952895
}
28962896

28972897
private Map<Object, Object> createMap(final Class<?> mapClass) throws Exception {
28982898
try { // if it is an implementation class, instantiate it
2899-
return (Map<Object, Object>) mapClass.newInstance();
2899+
return (Map<Object, Object>) mapClass.getDeclaredConstructor().newInstance();
29002900
} catch (final Exception ignored) {
29012901
}
29022902
return new LinkedHashMap<Object, Object>();

0 commit comments

Comments
 (0)