How the hell did I miss that?

I’ve been doing Java since 1998, and yet I only just discovered this interesting fact. If you have a class called, say, DBAsset that has a bunch of static methods in it, and you have some static member variables, and you initialize the static member variables, like so:

class DBAsset
{
static PreparedStatement insertStmt = null;
static PreparedStatement deleteStmt = null;

Then calling multiple static methods from within DBAsset’s static main using just the unadorned method name doesn’t do anything to those variables, but each time you call one of those static methods from some other class using DBAsset.methodname, those static variables get reinitialized to null. Huh.

Update: Figured it out. The code that initialized the variables was getting called *before* the code that set it to null, because I had a static DBAsset theAsset = new DBAsset(); before the static initializers. I’m such a slaphead.

And so it begins : personal edition

I spend some time, not nearly enough, during the holiday finishing up my functional spec for the task assigned to me for this release. And during that time, it has been obvious that the isn’t enough time in the schedule to get it done. So I asked for, and received, permission to work overtime. I committed to work at least 60 hours a week for the next two months. And here it is, the eleventh day in a row of billable work, and I’m already tired.

Sigh. At least the money is good.

0wnzord

Vicki asked me to stay home this morning because the furnace guy was coming to do one of the inspections on the hideously expensive maintenance contract we signed up for due to a hard sell sales pitch. She wanted me to stay because she says the furnace guy gives her a real hard sell every time for something that we absolutely must replace or we’re killing babies and torturing puppies. I’m not sure where she’s been for the last 11 years, but by now you’d think she’d realize that I’m no better at resisting those sorts of sales pitches either. But hey, this spreads the blame around for the stupid stuff we get talked into and takes the pressure off her, so I’m willing to do it for her sake.

The guy came, did the usual poking around in the basement, and came up and said “Your ignitor unit is testing at 99 ohms and we recommend replacing it any time it gets to 100 ohms, so you’re due”. I asked for a price, and he showed me it woud be $160 now, or $280 if it was an off-hours call. So I thought I’d outsmart him and ask if he had one in stock, and he said no, he’d checked the truck and he didn’t have one. I figured that would mean that if it *did* fail in middle of the night, we’d have to wait for a day or more while they ordered the part, and we’d risk the birds dying if that happened, so I said to go ahead and order it. A few minutes later, as he’s leaving, I asked when they were coming to install the part, and he said “I had another look around the truck, and found one, so it’s installed already”.

Dammit, he played me for a chump. He must have known that if he’d said they had one in the truck that I would figure they’re easy to come by and so I could afford to wait until it failed, but if they didn’t I’d want to replace it pre-emptively. I’m such a sucker.

Ouch

My back spasmed up in the middle of the night. Actually, it was about 5:30am so I just got up. But because I’m working on my Functional Spec, instead of spending the day lying down to relieve the pain, I’m going from chair to chair trying to find a comfortable position to type.

If life is so good, why am I so sad?

I’m terribly depressed, and I’m not entirely sure why. I mentioned this to Vicki, and she started listing off dozens of reasons why I should be happy with no signs of stopping until I conceded the point. And I have to agree with every one of them. I should be happy. And yet, I am not.

There is one thing hanging over me right now – a Functional Spec that I promised would be done by Wednesday, and which I haven’t done nearly enough work on. The more I’m working on it, the bigger a job it looks. And the more impossible seems the deadlines both for having the Functional Spec and even more important, the code that I’m spec-ing. And with my project manager and my current product manager, that’s not going to go over well. Before, I might have been praised for giving information that would allow the schedule to be adjusted, but with these two I’m not sure. I feel like neither of them trust me, and because of that I don’t entirely trust them.

But I’ve been in bad situations at work here – hell, I survived a year and a half at SunGard without cracking up. Oh wait, I didn’t – I spent two years in therapy around that time. So never mind Sungard. But I did survive a year at Gandalf, where my boss’s boss thought his whole department should be shut down so I had to spend half the time writing long descriptions of what we were doing and how much we were saving the company.

So anyway, I don’t know why I’m so sad. And being sad isn’t helping write the Functional Spec.