Skip to content

Commit 55481fa

Browse files
committed
FileSignature.Promised and JarState.Promised should both have get() as their method.
1 parent 44b3126 commit 55481fa

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,10 @@ private Promised(List<File> files, @Nullable FileSignature cached) {
108108
this.cached = cached;
109109
}
110110

111-
public FileSignature stripAbsolutePaths() throws IOException {
111+
public FileSignature get() {
112112
if (cached == null) {
113113
// null when restored via serialization
114-
cached = new FileSignature(files);
114+
cached = ThrowingEx.get(() -> new FileSignature(files));
115115
}
116116
return cached;
117117
}
@@ -135,7 +135,7 @@ public Promised roundTrippable() {
135135

136136
public static @Nullable FileSignature stripAbsolutePathsNullable(@Nullable Promised roundTrippable) throws IOException {
137137
if (roundTrippable != null) {
138-
return roundTrippable.stripAbsolutePaths();
138+
return roundTrippable.get();
139139
} else {
140140
return null;
141141
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public JarState get() {
5454
cached = result.fileSignature.roundTrippable();
5555
return result;
5656
}
57-
return new JarState(cached.stripAbsolutePaths());
57+
return new JarState(cached.get());
5858
} catch (Exception e) {
5959
throw ThrowingEx.asRuntime(e);
6060
}

0 commit comments

Comments
 (0)