commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niall Pemberton (JIRA)" <>
Subject [jira] Updated: (IO-214) Inconsistent synchronization of fields
Date Wed, 19 Aug 2009 21:43:14 GMT


Niall Pemberton updated IO-214:

    Attachment: IO-214-Counting-Stream-Sync.patch

The *private* toBufferedInputStream() method that uses the count field is only ever called
by the public *static* toBufferedInputStream() method and is a local variable only ever accessed
within that static method so I can't see how it would ever need to be synchronized.

Looks like the counting OutputStream issue was introduced recently in IO-211 - and the same
applies to counting InputStream

> Inconsistent synchronization of fields
> --------------------------------------
>                 Key: IO-214
>                 URL:
>             Project: Commons IO
>          Issue Type: Bug
>          Components: Streams/Writers
>            Reporter: Sebb
>         Attachments: IO-214-Counting-Stream-Sync.patch
> The field ByteArrayOutputStream.count is always accessed in a synchronised block, apart
from when the user calls toBufferedInputStream().
> This seems wrong.
> Similarly for the count field in CountingOutputStream.beforeWrite(int n)

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message