Skip to main content



      Home
Home » Newcomers » Newcomers » Customizing the Arguments
Customizing the Arguments [message #112039] Tue, 25 October 2005 19:28 Go to next message
Eclipse UserFriend
Originally posted by: jollykh.yahoo.com

Hello,

When I create in new class in Eclipse and enter a new Superclass name,
Eclipse generates a new class for me with no problems. However, when the
superclass has an abstract method, this abstract method is included in my
new class but return argument names that I dislike. For example, here is
a class that Eclipse generated:

public class Z_TestAction extends BaseAction {
public ActionForward doPerform(ActionMapping arg1, ActionForm arg2,
HttpServletRequest arg2, HttpServletResponse arg4)
throws IOException, ServletException {

return null;
}

}

As you can see, Eclipse provides some standard parameter names such as
"arg1", "arg2", "arg3", etc. Is it possible to CHANGE this so that
whenever it sees ActionMapping, the parameter name is "mapping" instead of
"arg1"?
Re: Customizing the Arguments [message #112209 is a reply to message #112039] Wed, 26 October 2005 10:03 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: wojtek.a.com

Jolly wrote:
> Hello,
>
> When I create in new class in Eclipse and enter a new Superclass name,
> Eclipse generates a new class for me with no problems. However, when
> the superclass has an abstract method, this abstract method is included
> in my new class but return argument names that I dislike. For example,
> here is a class that Eclipse generated:
>
> public class Z_TestAction extends BaseAction {
> public ActionForward doPerform(ActionMapping arg1, ActionForm arg2,
> HttpServletRequest arg2, HttpServletResponse arg4)
> throws IOException, ServletException {
>
> return null;
> }
>
> }
>
> As you can see, Eclipse provides some standard parameter names such as
> "arg1", "arg2", "arg3", etc. Is it possible to CHANGE this so that
> whenever it sees ActionMapping, the parameter name is "mapping" instead
> of "arg1"?
>
AFAIK the argument names are taken from the abstract method signature.
Your super class defined the argument names as arg1, etc, so that is
what is generated.
Re: Customizing the Arguments [message #116152 is a reply to message #112209] Thu, 10 November 2005 14:01 Go to previous message
Eclipse UserFriend
Originally posted by: eclipse3.rizzoweb.com

Wojtek wrote:
> Jolly wrote:
>
>> Hello,
>>
>> When I create in new class in Eclipse and enter a new Superclass name,
>> Eclipse generates a new class for me with no problems. However, when
>> the superclass has an abstract method, this abstract method is
>> included in my new class but return argument names that I dislike.
>> For example, here is a class that Eclipse generated:
>>
>> public class Z_TestAction extends BaseAction {
>> public ActionForward doPerform(ActionMapping arg1, ActionForm arg2,
>> HttpServletRequest arg2, HttpServletResponse arg4)
>> throws IOException, ServletException {
>>
>> return null;
>> }
>>
>> }
>>
>> As you can see, Eclipse provides some standard parameter names such as
>> "arg1", "arg2", "arg3", etc. Is it possible to CHANGE this so that
>> whenever it sees ActionMapping, the parameter name is "mapping"
>> instead of "arg1"?
>>
> AFAIK the argument names are taken from the abstract method signature.
> Your super class defined the argument names as arg1, etc, so that is
> what is generated.

That is what it does if there is source available for the super class
(it uses the names in the super class' source). But the arg1, arg2,...
names usually result when extending a class for which there is no source
available.
If you're extending a class from a JAR, attach the source to the JAR and
you'll get better names in your generated code.

HTH,
Eric
Previous Topic:Fatal Error when starting Eclipse
Next Topic:Eclipse for Modeling Databases
Goto Forum:
  


Current Time: Wed Jul 23 19:35:42 EDT 2025

Powered by FUDForum. Page generated in 0.07455 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top