debugger behaviour different to execution behaviour

Discussion in 'Java' started by Andy Chambers, May 14, 2007.

  1. Hi,

    I've got a program that runs fine when run from the debugger in
    Eclipse, but when you execute it outwith the debugger the program
    throws a ConcurrentModificationException. It doesn't seem to be a
    simple case of http://mindprod.com/jgloss/runerrormessages.html#CONCURRENTMOD
    since, the iterator's underlying collection is not being altered at
    all.

    The bug (presumably in our program) has been uncovered by moving from
    Java 1.4.2 to Java 6 (I know, that seems like asking for trouble but
    I'm only following orders). Has anyone experienced similar problems
    with an upgrade like this?

    Cheers,
    Andy
    Andy Chambers, May 14, 2007
    #1
    1. Advertising

  2. Andy Chambers

    Daniel Dyer Guest

    On Mon, 14 May 2007 10:19:57 +0100, Andy Chambers
    <> wrote:

    > Hi,
    >
    > I've got a program that runs fine when run from the debugger in
    > Eclipse, but when you execute it outwith the debugger the program
    > throws a ConcurrentModificationException. It doesn't seem to be a
    > simple case of
    > http://mindprod.com/jgloss/runerrormessages.html#CONCURRENTMOD
    > since, the iterator's underlying collection is not being altered at
    > all.


    Sounds like a threading problem. The fact that it works in the debugger
    is probably because it slows things down sufficiently that two threads
    don't try to access the collection at the same time. I'd review
    everywhere the collection is accessed and ensure that it is properly
    synchronised.

    Dan.

    --
    Daniel Dyer
    http://www.uncommons.org
    Daniel Dyer, May 14, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. omission9
    Replies:
    3
    Views:
    334
    Ziaran
    Feb 23, 2004
  2. R. Bernstein
    Replies:
    18
    Views:
    564
  3. __PaTeR
    Replies:
    7
    Views:
    467
    Barry Schwarz
    Jan 1, 2009
  4. Robert Oschler
    Replies:
    1
    Views:
    213
    Mcginkel
    Sep 5, 2005
  5. aflat362
    Replies:
    7
    Views:
    210
    naixn
    Dec 7, 2006
Loading...

Share This Page