1
1
/*
2
- * Copyright 2016-2022 DiffPlug
2
+ * Copyright 2016-2023 DiffPlug
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
15
15
*/
16
16
package com .diffplug .spotless ;
17
17
18
- import java .nio .Buffer ;
19
18
import java .nio .ByteBuffer ;
20
19
import java .nio .CharBuffer ;
21
20
import java .nio .charset .Charset ;
@@ -116,8 +115,8 @@ private static void addIfAvailable(Collection<Charset> charsets, String name) {
116
115
}
117
116
118
117
private void appendExample (Charset charset , boolean must ) {
119
- java8fix ( byteBuf ) .clear ();
120
- java8fix ( charBuf ) .clear ();
118
+ byteBuf .clear ();
119
+ charBuf .clear ();
121
120
122
121
CharsetDecoder decoder = charset .newDecoder ();
123
122
if (!must ) {
@@ -135,7 +134,7 @@ private void appendExample(Charset charset, boolean must) {
135
134
.onUnmappableCharacter (CodingErrorAction .REPLACE )
136
135
.decode (byteBuf , charBuf , true );
137
136
}
138
- java8fix ( charBuf ) .flip ();
137
+ charBuf .flip ();
139
138
140
139
int start = Math .max (unrepresentable - CONTEXT , 0 );
141
140
int end = Math .min (charBuf .limit (), unrepresentable + CONTEXT + 1 );
@@ -147,9 +146,4 @@ private void appendExample(Charset charset, boolean must) {
147
146
message .append (" <- " );
148
147
message .append (charset .name ());
149
148
}
150
-
151
- /** Fixes https://jira.mongodb.org/browse/JAVA-2559, as reported in https://github.com/diffplug/spotless/issues/1081 */
152
- private static Buffer java8fix (Buffer b ) {
153
- return b ;
154
- }
155
149
}
0 commit comments