Re: weakly referenced paged queries

From: Øyvind Harboe (oyvind.harbo..ylin.com)
Date: Fri Jun 20 2008 - 15:41:51 EDT

  • Next message: Scott Anderson: "RE: weakly referenced paged queries"

    On Fri, Jun 20, 2008 at 7:34 PM, Scott Anderson <sanderso..irvana.com> wrote:
    > It looks like the synchronized block is designed to prevent concurrent modification
    > of the list. I don't believe that particular code would suffer the consequences
    > if concurrent modification occurred, but it's generally best to synchronize
    > list access when in doubt, since even a simple iteration can be the offender.

    I find that code that is added because one hasn't defined what the
    interface should be, is trouble waiting to happen.

    I would be much more comfortable, if either:

    - the JavaDoc explained *why* the synchronization is there and what it
    is supposed to do and how the client is supposed to use it.
    - it serves some internal purpose and that purpose was stated as a comment
    in the code
    - the synchronization code was deleted(faster + less chance of deadlock).

    -- 
    Øyvind Harboe
    http://www.zylin.com/zy1000.html
    ARM7 ARM9 XScale Cortex
    JTAG debugger and flash programmer
    



    This archive was generated by hypermail 2.0.0 : Fri Jun 20 2008 - 15:42:26 EDT