Skip to content

Commit 8da8f55

Browse files
committed
Prevent behavior change: StreamEncoder::append was NOT synchronized implicitly before, so it should NOT be synchronized explicitly now.
1 parent fb503c0 commit 8da8f55

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

src/java.base/share/classes/sun/nio/cs/StreamEncoder.java

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -151,19 +151,15 @@ public void write(CharBuffer cb) throws IOException {
151151
}
152152

153153
public Writer append(CharSequence csq) throws IOException {
154-
synchronized (lock) {
155-
if (csq == null) csq = "null";
156-
implWrite(csq, 0, csq.length());
157-
return this;
158-
}
154+
if (csq == null) csq = "null";
155+
implWrite(csq, 0, csq.length());
156+
return this;
159157
}
160158

161159
public Writer append(CharSequence csq, int start, int end) throws IOException {
162-
synchronized (lock) {
163-
if (csq == null) csq = "null";
164-
implWrite(csq, start, end - start);
165-
return this;
166-
}
160+
if (csq == null) csq = "null";
161+
implWrite(csq, start, end - start);
162+
return this;
167163
}
168164

169165
public void flush() throws IOException {

0 commit comments

Comments
 (0)