Bill Roper (billroper) wrote,
Bill Roper
billroper

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.

*sigh*

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

  • Binge Away

    We finished our trip through the first five seasons of "The Expanse" last night. We started out slowly watching this, as Gretchen found it extremely…

  • More Tired Than I Can Account For

    I am more tired today than seems reasonable. I think it's just mental exhaustion more than anything else. I'll get some sleep tonight and tomorrow…

  • Moving Forward, Into the Cold

    The fellow from the granite company came by today and took measurements for the new countertops. He used a laser measuring device that was…

  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 1 comment