Looks good to me Sean. All other state seems to be accessed when holding zsRef.
-Chris. On 15 Oct 2015, at 10:02, Seán Coffey <sean.cof...@oracle.com> wrote: > bug report : https://bugs.openjdk.java.net/browse/JDK-8038502 > > The len instance variable should be read/written while holding the zsRef lock. > > needsInput() seems to be missing that. Simple change : > > diff --git a/src/java.base/share/classes/java/util/zip/Deflater.java > b/src/java.base/share/classes/java/util/zip/Deflater.java > --- a/src/java.base/share/classes/java/util/zip/Deflater.java > +++ b/src/java.base/share/classes/java/util/zip/Deflater.java > @@ -318,8 +318,10 @@ > * should be called in order to provide more input > */ > public boolean needsInput() { > + synchronized (zsRef) { > return len <= 0; > } > + } > > /** > * When called, indicates that compression should end with the current > > -- > Regards, > Sean. >