dev@glassfish.java.net

LogDomains.getLogger errors

From: Bill Shannon <bill.shannon_at_oracle.com>
Date: Fri, 08 Apr 2011 16:42:51 -0700

I was converting some code to use LogDomains.getLogger. I was copying
the code from elsewhere when I noticed what looks like some bugs.

Normal usage in Foo.java is:

        private static final logger = LogDomains.getLogger(Foo.class, whatever);
or
        private final logger = LogDomains.getLogger(this.getClass(), whatever);

But in some classes they pass some other class that's not the one containing
the code. Now, I suppose in some rare cases that may be what's intended
(and those cases probably deserver a comment to that effect), but in most cases
I suspect it's a copy/paste error.

I wrote a simple script to find such cases. (It really should be a FindBugs
detector.) Attached are the cases I found that look suspicious. Some of you
might want to look into these...