Navigation Menu

Skip to content

Commit

Permalink
8255729: com.sun.tools.javac.processing.JavacFiler.FilerOutputStream …
Browse files Browse the repository at this point in the history
…is inefficient

Reviewed-by: clanger
Backport-of: 526c000
  • Loading branch information
lgxbslgx authored and RealCLanger committed Jul 18, 2022
1 parent a9c27da commit 8486da7
Showing 1 changed file with 9 additions and 1 deletion.
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -275,6 +275,13 @@ private class FilerOutputStream extends FilterOutputStream {
this.fileObject = fileObject;
}

@Override
public void write(byte b[], int off, int len) throws IOException {
Objects.checkFromIndexSize(off, len, b.length);
out.write(b, off, len);
}

@Override
public synchronized void close() throws IOException {
if (!closed) {
closed = true;
Expand Down Expand Up @@ -312,6 +319,7 @@ private class FilerWriter extends FilterWriter {
this.fileObject = fileObject;
}

@Override
public synchronized void close() throws IOException {
if (!closed) {
closed = true;
Expand Down

1 comment on commit 8486da7

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.