Skip to content

Commit 3b9c107

Browse files
author
Vincent Potucek
committed
new step to expand java wildcard imports diffplug#2744 diffplug#2594
1 parent 3b6eb69 commit 3b9c107

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib/src/main/java/com/diffplug/spotless/java/ExpandWildcardImportsStep.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,11 @@ public State(Collection<File> typeSolverClasspath, JarState jarState) {
7272

7373
FormatterFunc toFormatter() {
7474
try {
75-
Class<?> formatterFunc = jarState.getClassLoader()
76-
.loadClass("com.diffplug.spotless.glue.java.parser.ExpandWildcardsFormatterFunc");
77-
Constructor<?> constructor = formatterFunc.getConstructor(Collection.class);
78-
return (FormatterFunc) constructor.newInstance(typeSolverClasspath);
75+
return (FormatterFunc) jarState
76+
.getClassLoader()
77+
.loadClass("com.diffplug.spotless.glue.java.parser.ExpandWildcardsFormatterFunc")
78+
.getConstructor(Collection.class)
79+
.newInstance(typeSolverClasspath);
7980
} catch (ClassNotFoundException | NoSuchMethodException | InvocationTargetException
8081
| InstantiationException | IllegalAccessException | NoClassDefFoundError cause) {
8182
throw new IllegalStateException(INCOMPATIBLE_ERROR_MESSAGE, cause);

0 commit comments

Comments
 (0)