Apparently since Netbeans 6.9, code templates can insert the current class name, and I just found out now that 7.1 is out. So one template I use all the time I named "logger" and now that I found this feature, I can make the template be:
private static final ${loggerType type="org.slf4j.Logger" default="Logger" editable="false"} logger = ${loggerFactory type="org.slf4j.LoggerFactory" default="LoggerFactory" editable="false"}.getLogger(${classVar editable="false" currClassName default="getClass()"}.class);
Then just by typing "logger[tab]" in inserts:
private static final Logger logger = LoggerFactory.getLogger(CurrentClassName.class);
and it even adds the imports for org.slf4j. Nice!
This is a great little timesaver. They have a couple in there for java.util.Logging already (logr and logr). I need to go through the templates again.
title
fire chief's random developer tidbits
Monday, January 23, 2012
Thursday, January 19, 2012
Glassfish directory deploy
Netbeans has an integration with Glassfish where it can deploy an ear as a directory. This does not currently work with the "skinny war recipe" in maven. Bug 199096 is the source of the trouble. Since the skinny war renames jars and depends on those names and the bug causes the naming to not work, the deploy fails because it can't see the various components of the ear. In our case we've got an ear containing two wars, an ejb jar, and many libraries with a (typical for JEE) ugly interdependency graph.
Found this while trying out JRebel, which is an awesome product. We are buying it today at my work.
Found this while trying out JRebel, which is an awesome product. We are buying it today at my work.
Subscribe to:
Posts (Atom)