Documentation enhancement for injecting Logger (make clear when static is required)
-----------------------------------------------------------------------------------
Key: JBSEAM-1075
URL:
http://jira.jboss.com/jira/browse/JBSEAM-1075
Project: JBoss Seam
Issue Type: Feature Request
Components: Documentation
Affects Versions: 1.2.0.GA
Environment: All
Reporter: Arjan van Bentem
Priority: Optional
The documentation of @Logger in "3.6 Logging" states at
http://fisheye.jboss.com/browse/JBoss/jboss-seam/doc/reference/en/modules...
It doesn't matter if you declare the log variable static or not—it will work
either way.
I think this should be enhanced to read, for example:
It doesn't matter if you declare the log variable static or not—it will work
either way,
except for entity beans which needs the logger to be static.
...maybe followed by an example:
@Entity
@Name("member")
@Table(uniqueConstraints = @UniqueConstraint(columnNames = "membername"))
public class Member implements Serializable
{
@Logger private static Log log;
:
public void setMemberName(String memberName)
{
log.info("setting memberName");
this.memberName = memberName;
}
:
}
At least, that's what I've found; when not declaring it static it will not get
injected or is lost (I'm not sure which), and thus would yield a NullPointerException
upon usage.
Likewise, "22.2. Annotations for bijection" at
http://fisheye.jboss.com/browse/JBoss/jboss-seam/doc/reference/en/modules...
now states
Specifies that a component field is to be injected with an instance of
org.jboss.seam.log.Log.
...but maybe this could be extended to read:
Specifies that a component field is to be injected with an instance of
org.jboss.seam.log.Log.
Remember that for entity beans the actual variable needs to be declared static.
Cheers,
Arjan.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira