Skip to content

Commit 3a0ec3f

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

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

gradle/spotless.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ spotless {
55
java {
66
bumpThisNumberIfACustomStepChanges(1)
77
eclipse().configFile rootProject.file('gradle/spotless.eclipseformat.xml')
8-
expandWildcardImports()
8+
// expandWildcardImports()
99
forbidRegex('ForbidGradleInternal', 'import org\\.gradle\\.api\\.internal\\.(.*)', "Don't use Gradle's internal API")
1010
formatAnnotations()
1111
importOrderFile rootProject.file('gradle/spotless.importorder')

lib-extra/src/main/java/com/diffplug/spotless/extra/GitRatchet.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
*/
1616
package com.diffplug.spotless.extra;
1717

18+
import static com.diffplug.spotless.FileSignature.pathNativeToUnix;
19+
import static org.eclipse.jgit.treewalk.TreeWalk.forPath;
20+
1821
import java.io.File;
1922
import java.io.IOException;
2023
import java.util.HashMap;
@@ -45,10 +48,6 @@
4548
import com.diffplug.common.base.Errors;
4649
import com.diffplug.common.collect.HashBasedTable;
4750
import com.diffplug.common.collect.Table;
48-
import com.diffplug.spotless.FileSignature;
49-
50-
import static com.diffplug.spotless.FileSignature.pathNativeToUnix;
51-
import static org.eclipse.jgit.treewalk.TreeWalk.forPath;
5251

5352
/**
5453
* How to use:

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import java.io.File;
1919
import java.io.Serial;
2020
import java.io.Serializable;
21-
import java.lang.reflect.Constructor;
2221
import java.lang.reflect.InvocationTargetException;
2322
import java.util.Collection;
2423
import java.util.Objects;
@@ -74,7 +73,7 @@ FormatterFunc toFormatter() {
7473
try {
7574
return (FormatterFunc) jarState.getClassLoader()
7675
.loadClass("com.diffplug.spotless.glue.javaparser.ExpandWildcardsFormatterFunc")
77-
.getConstructor(Collection.class).newInstance(typeSolverClasspath);
76+
.getConstructor(Collection.class).newInstance(typeSolverClasspath);
7877
} catch (ClassNotFoundException | NoSuchMethodException | InvocationTargetException
7978
| InstantiationException | IllegalAccessException | NoClassDefFoundError cause) {
8079
throw new IllegalStateException(INCOMPATIBLE_ERROR_MESSAGE, cause);

0 commit comments

Comments
 (0)