Bill Roper (billroper) wrote,
Bill Roper

The Invisible Bug

It was one of those days, at least in some respects.

I had fixed a number of bugs and ported a bunch of code fixes from C++ to Java. But there was an intractable bug that turned out to be due to corrupted data in one of my classes. In fact, what I was seeing was that the child class was pointing back to the wrong parent as its owner.

So it seemed that something had to be wrong with either the copy constructor or the clone() method in my Java code. And I stared at them. And stared at them.

And about a half-hour after I'd started staring, I suddenly realized that I was setting the parent of the children incorrectly when I was cloning the parent class. Because you don't set the parent to this, you set the parent to the newly created parent.

I could easily have stared at that for a lot longer before figuring out that I had typed something witless.


On the other hand, the bug appears to have gone away now.
Tags: java, musings, work

  • Happy Birthday, Gretchen!

    And here it is, Gretchen's birthday again. Most of the festivities were last night, due to K's being in the school play tonight, so we had a good…


    I am in a maze of twisting JARs, all alike, except that some work and some don't.

  • Putting Things To Bed

    I think I managed to put a lot of things to bed today at work, which means that I should be able to go work on something else. Except for the…

  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 1 comment