星期日, 4月 03, 2005

Eclipse tips on source code

Try to attach source codes for *.jar, then the auto-generated source (such as method) will comes with meaningful name, for example, A generated execute(...) method of Struts Action:

without attach source:
    public ActionForward execute(
ActionMapping arg0,
ActionForm arg1,
HttpServletRequest arg2,
HttpServletResponse arg3
throws Exception {
}
lots of ugly arg0, arg1.... !!!

after attach Struts source codes to struts.jar:
    public ActionForward execute(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {
}
whew! much better !

Another tip is when you attach source codes, you can view java docs without assigning javadoc location. Eclipse will parse javadocs that inside attached source codes for you.

0 Comments:

張貼留言

<< Home