?

Log in

No account? Create an account
Bill Roper's Journal
The Invisible Bug 
5th-Apr-2016 11:11 pm
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.
Comments 
6th-Apr-2016 04:27 pm (UTC)
Setting the parent to this sounds like it would involve temporal paradoxes.
This page was loaded Sep 26th 2018, 12:43 am GMT.