Skip to content

Commit cce20d4

Browse files
committed
Rename FileSignature.RoundTrippable to FileSignature.Promised to match JarState's naming convention.
1 parent 9fa1da3 commit cce20d4

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

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

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,13 @@ private FileSignature(final List<File> files) throws IOException {
9797
}
9898

9999
/** A view of `FileSignature` which can be safely roundtripped. */
100-
public static class RoundTrippable implements Serializable {
100+
public static class Promised implements Serializable {
101101
private static final long serialVersionUID = 1L;
102102
private final List<File> files;
103103
@SuppressFBWarnings("SE_TRANSIENT_FIELD_NOT_RESTORED")
104104
private transient @Nullable FileSignature cached;
105105

106-
private RoundTrippable(List<File> files, FileSignature cached) {
106+
private Promised(List<File> files, FileSignature cached) {
107107
this.files = files;
108108
this.cached = cached;
109109
}
@@ -117,19 +117,23 @@ public FileSignature stripAbsolutePaths() throws IOException {
117117
}
118118
}
119119

120-
public RoundTrippable roundTrippable() {
121-
return new RoundTrippable(files, this);
120+
public static Promised promise(Iterable<File> files) {
121+
return new Promised(MoreIterables.toNullHostileList(files), null);
122122
}
123123

124-
public static @Nullable RoundTrippable roundTrippableNullable(@Nullable FileSignature signature) {
124+
public Promised roundTrippable() {
125+
return new Promised(files, this);
126+
}
127+
128+
public static @Nullable Promised roundTrippableNullable(@Nullable FileSignature signature) {
125129
if (signature != null) {
126130
return signature.roundTrippable();
127131
} else {
128132
return null;
129133
}
130134
}
131135

132-
public static @Nullable FileSignature stripAbsolutePathsNullable(@Nullable RoundTrippable roundTrippable) throws IOException {
136+
public static @Nullable FileSignature stripAbsolutePathsNullable(@Nullable Promised roundTrippable) throws IOException {
133137
if (roundTrippable != null) {
134138
return roundTrippable.stripAbsolutePaths();
135139
} else {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public final class JarState implements Serializable {
4141
public static class Promised implements Serializable {
4242
private static final long serialVersionUID = 1L;
4343
private final transient ThrowingEx.Supplier<JarState> supplier;
44-
private FileSignature.RoundTrippable cached;
44+
private FileSignature.Promised cached;
4545

4646
public Promised(ThrowingEx.Supplier<JarState> supplier) {
4747
this.supplier = supplier;

lib/src/main/java/com/diffplug/spotless/kotlin/DiktatStep.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public class DiktatStep extends FormatterStepEqualityOnStateSerialization<Diktat
2929
private static final long serialVersionUID = 1L;
3030
private final JarState.Promised jarState;
3131
private final boolean isScript;
32-
private final @Nullable FileSignature.RoundTrippable config;
32+
private final @Nullable FileSignature.Promised config;
3333

3434
private DiktatStep(JarState.Promised jarState, boolean isScript, @Nullable FileSignature config) {
3535
this.jarState = jarState;

0 commit comments

Comments
 (0)