| <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
| <html> |
| <head> |
| <meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2005. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." > |
| <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> |
| <meta http-equiv="Content-Style-Type" content="text/css"> |
| <meta name="GENERATOR" content="Mozilla/4.75 [en] (Windows NT 5.0; U) [Netscape]"> |
| <title> |
| Renaming method parameters |
| </title> |
| <link rel="stylesheet" href="../book.css" charset="ISO-8859-1" type="text/css"> |
| </head> |
| <body> |
| <h1> |
| Renaming method parameters |
| </h1> |
| <p> |
| You can rename the parameters of a method by renaming the parameter's declaration as well as all references to the parameters inside the method body. |
| </p> |
| <p> |
| Use the <strong>Change Method Signature</strong> command to rename one or more parameters of a method as well as all references to these parameters. |
| </p> |
| <ul> |
| <li> |
| Select the method in a Java view (the Outline view, for example) |
| </li> |
| <li> |
| From the method's pop-up menu, select <strong>Refactor</strong> > <strong>Change Method Signature</strong> or, from the menu bar, select |
| <strong>Refactor</strong> > <strong>Change Method Signature</strong>.<br> |
| <strong>Note:</strong> these menu entries will no be active if the method has no parameters. |
| </li> |
| <li> |
| Select a parameter, press the <strong>Edit</strong> button, enter a new name for the parameter and press <strong>OK</strong> |
| </li> |
| </ul> |
| <p> |
| To rename a single parameter, it is often easier to: |
| </p> |
| <ul> |
| <li> |
| Select the parameter in the Java editor. |
| </li> |
| <li> |
| From the editor's pop-up menu, select <strong>Refactor</strong> > <strong>Rename</strong> to open the Rename refactoring dialog. |
| </li> |
| </ul> |
| <p> |
| <img src="../images/ngrelc.png" alt="Related concepts" border="0" > |
| </p> |
| <p> |
| <a href="../concepts/concepts-1.htm">Java development tools (JDT)</a> |
| </p> |
| <p> |
| <img src="../images/ngrelt.png" alt="Related tasks" border="0" > |
| </p> |
| <p> |
| <a href="tasks-157.htm">Changing method signature</a> |
| </p> |
| <p> |
| <img src="../images/ngrelr.png" alt="Related reference" border="0" > |
| </p> |
| <p> |
| <a href="../reference/ref-menu-refactor.htm">Refactoring actions</a><br> |
| <a href="../reference/ref-117.htm">Refactoring dialogs</a><br> |
| <a href="../reference/ref-13.htm">Java preferences</a> |
| </p> |
| |
| </body> |
| </html> |
| |