Skip to content

Commit

Permalink
Method encoding should accept java.nio.charset.Charset type (#1140)
Browse files Browse the repository at this point in the history
  • Loading branch information
nedtwigg committed Mar 1, 2022
2 parents c14a6ab + 13ef3fb commit caee82f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 2 additions & 0 deletions plugin-gradle/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (starting after version `3.27.0`).

## [Unreleased]
### Added
* Accept `java.nio.charset.Charset` type when setting the character encoding via `encoding` ([#1128](https://github.com/diffplug/spotless/issues/1128))

## [6.3.0] - 2022-02-15
### Added
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,20 @@ public Charset getEncoding() {
return encoding;
}

/** Sets encoding to use (defaults to UTF_8). */
public void setEncoding(Charset charset) {
encoding = requireNonNull(charset);
}

/** Sets encoding to use (defaults to UTF_8). */
public void setEncoding(String name) {
requireNonNull(name);
setEncoding(Charset.forName(name));
}

/** Sets encoding to use (defaults to UTF_8). */
public void setEncoding(Charset charset) {
encoding = requireNonNull(charset);
public void encoding(Charset charset) {
setEncoding(charset);
}

/** Sets encoding to use (defaults to UTF_8). */
Expand Down

0 comments on commit caee82f

Please sign in to comment.