Skip to content

Commit 8486da7

Browse files
lgxbslgxRealCLanger
authored andcommitted
8255729: com.sun.tools.javac.processing.JavacFiler.FilerOutputStream is inefficient
Reviewed-by: clanger Backport-of: 526c000
1 parent a9c27da commit 8486da7

File tree

1 file changed

+9
-1
lines changed
  • src/jdk.compiler/share/classes/com/sun/tools/javac/processing

1 file changed

+9
-1
lines changed

src/jdk.compiler/share/classes/com/sun/tools/javac/processing/JavacFiler.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2005, 2020, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -275,6 +275,13 @@ private class FilerOutputStream extends FilterOutputStream {
275275
this.fileObject = fileObject;
276276
}
277277

278+
@Override
279+
public void write(byte b[], int off, int len) throws IOException {
280+
Objects.checkFromIndexSize(off, len, b.length);
281+
out.write(b, off, len);
282+
}
283+
284+
@Override
278285
public synchronized void close() throws IOException {
279286
if (!closed) {
280287
closed = true;
@@ -312,6 +319,7 @@ private class FilerWriter extends FilterWriter {
312319
this.fileObject = fileObject;
313320
}
314321

322+
@Override
315323
public synchronized void close() throws IOException {
316324
if (!closed) {
317325
closed = true;

0 commit comments

Comments
 (0)