Skip to content

Commit

Permalink
Remove unused field.
Browse files Browse the repository at this point in the history
  • Loading branch information
nedtwigg committed Sep 28, 2023
1 parent cdc0c7b commit 1a1fbfe
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions lib/src/main/java/com/diffplug/spotless/LineEnding.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,8 @@
import java.io.Serializable;
import java.lang.reflect.Method;
import java.util.Objects;
import java.util.function.BiFunction;
import java.util.function.Supplier;

import javax.annotation.Nullable;

/**
* Represents the line endings which should be written by the tool.
*/
Expand Down Expand Up @@ -76,16 +73,14 @@ public Policy createPolicy(File projectDir, Supplier<Iterable<File>> toFormat) {
}
}

private static volatile @Nullable BiFunction<File, Supplier<Iterable<File>>, Policy> gitAttributesPolicyCreator;

// @formatter:off
/** Should use {@link #createPolicy(File, Supplier)} instead, but this will work iff its a path-independent LineEnding policy. */
public Policy createPolicy() {
switch (this) {
case PLATFORM_NATIVE: return _platformNativePolicy;
case WINDOWS: return WINDOWS_POLICY;
case UNIX: return UNIX_POLICY;
case MAC_CLASSIC: return MAC_CLASSIC_POLICY;
case MAC_CLASSIC: return MAC_CLASSIC_POLICY;
default: throw new UnsupportedOperationException(this + " is a path-specific line ending.");
}
}
Expand Down Expand Up @@ -129,7 +124,7 @@ public String str() {
case PLATFORM_NATIVE: return _platformNative;
case WINDOWS: return "\r\n";
case UNIX: return "\n";
case MAC_CLASSIC: return "\r";
case MAC_CLASSIC: return "\r";
default: throw new UnsupportedOperationException(this + " is a path-specific line ending.");
}
}
Expand Down

0 comments on commit 1a1fbfe

Please sign in to comment.