semperfiona: (dilbert)
No one but another Java programmer is likely to understand this, but since one way I learn things for good is by writing them down, I'm doing it anyway.

The last three days I've been trying to figure out a NullPointerException when calling the constructor of a new class I'd made. "But there's no objects being accessed *on* that line other than the one I'm building!" I kept thinking. "Why isn't the debugger even *going* to the constructor?"

I've just finally figured it out. There was an object access on that line. A very sneaky one: I created the constructor to take an int primitive...and I was passing in an Integer object, relying on the automatic unboxing of primitive wrapper objects that has been part of Java since Java 5. And my Integer object...was null. Heh. I'd have gotten it in 1/2 second if the line throwing the NPE had read

     MyObject obj = new MyObject(someInteger.intValue());


but since it read

     MyObject obj = new MyObject(someInteger);


it went right past me. FOR DAYS.

I tried everything I could think of. I googled and read all the documents on constructors and NullPointerExceptions I could find, all of which were either oriented to beginners or specific to older versions of Java, I moved the class definition around in its containing class, and because I simply could not believe there was a problem I ran and reran the same error-filled code. BAH.

So now I know. And now you-all also know that even with over 10 years experience doing Java, I can still miss things.
semperfiona: (work motto)
\.setObject *\([a-zA-Z0-9, "\.]*biFormatName[ "]*\)

Finds all calls of .setObject where the element was biFormatName, no matter what resultset or how the element name was expressed (explicit reference to BiReposConstants or not, quoted string or not).

Regular expressions syntax reference
semperfiona: (tigger)
I have just checked in code against a CR that has been hanging over my head for five months!!!!!!!!

I had been poking at it every week or so but just could never get a purchase on it. I was convinced I had to finagle my requirements into a massive, messy, incomprehensible, already-existing method--without breaking it for everyone else.

This week, I finally realized that I could do some checking for my conditions and just write a new method for my stuff and let the rest fall through to the old method. But even that didn't quite do it.

Finally, this morning, I moved the new code into a different class, leapfrogging the old messy one altogether. And it works like a champ.

Yay me!

Jan. 17th, 2002 04:25 pm
semperfiona: (Default)
I've gotten two pats on the back today for figuring out stuff in the new Java project. It feels good to be digging into something and learning new ways to use it, especially when I can solve a problem that's been troubling even the "experts" around here.

Java

Jan. 16th, 2002 04:50 pm
semperfiona: (Default)
This makes two weeks that I've been working on the big new Java project here at work.

I'm finding that my days are going much faster and I'm feeling much more productive. Even though there are not many results to show for my work, yet, I feel like I'm doing more, learning more, and enjoying it more than I was previously. I really prefer new development, particularly at this early stage of setting the standards, trying things out to see whether they work, and playing with new ideas. Even though I was on the new development team before, it was always constrained within the existing products. This is fun!
semperfiona: (Default)
Something changed on my work computer since yesterday and now I can't run AIMExpress or AIM Quick Buddy. Sorry friends, I may no longer be able to IM from work. :-(

It keeps telling me I don't have Java enabled, which is bullshit, because I've got Java programs running locally all over the place. I think it's something to do with the fact that I had to install Java 1.4 for my new work assignments, and Java on the 'net is usually 1.0 or 1.1. But it keeps trying to download the Microsoft virtual machine, even though it's already supposedly active, and then telling me I have security set too high to run ActiveX controls, which is also not true.

::sigh:: No applets work. None at all. Now how am I going to entertain myself when I get bored with working?

Not that I'll have a lot of time to be bored, because I'm starting a brand-new project doing Java development, and I have absolutely no experience with Java beyond a summer school class.

Profile

semperfiona: (Default)
semperfiona

September 2024

S M T W T F S
1234567
891011121314
15161718192021
2223242526 2728
2930     

Syndicate

RSS Atom

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jul. 28th, 2025 02:03 am
Powered by Dreamwidth Studios