# Change signature

> **TL;DR**
> Shortcut for the action: `Ctrl+F6` (Windows), `⌘ F6` (macOS), `⌘ F6` (IntelliJ IDEA Classic (macOS)), `⌘ ⌥ S` (macOS System Shortcuts), `Ctrl+F6` (XWin), `Ctrl+F6` (GNOME), `Ctrl+6` (KDE), `Ctrl+F6` (Emacs), `Ctrl+F6` (Sublime Text), `Ctrl+F6` (Sublime Text (macOS)), `Ctrl+F6` (NetBeans), `Ctrl+R, S` (Visual Studio), `⌘ R, S` (Visual Studio (macOS)), `Alt+Shift+C` (Eclipse), `⌘ ⌥ C` (Eclipse (macOS))
>
>
>
> General refactoring settings: `Settings | Editor | General`
>
>
>
> Access from [UML Class diagram](class-diagram.html) is available
>
>
>
> [In-place](#inplace_change_signature)  refactoring is available
>
>
>
> Shortcut: `Ctrl+F6` (Windows), `⌘ F6` (macOS), `⌘ F6` (IntelliJ IDEA Classic (macOS)), `⌘ ⌥ S` (macOS System Shortcuts), `Ctrl+F6` (XWin), `Ctrl+F6` (GNOME), `Ctrl+6` (KDE), `Ctrl+F6` (Emacs), `Ctrl+F6` (Sublime Text), `Ctrl+F6` (Sublime Text (macOS)), `Ctrl+F6` (NetBeans), `Ctrl+R, S` (Visual Studio), `⌘ R, S` (Visual Studio (macOS)), `Alt+Shift+C` (Eclipse), `⌘ ⌥ C` (Eclipse (macOS))
>
>
>
> Refactoring settings: `Settings | Editor | General`
>
>
>
> Access from [UML Class diagram](class-diagram.html) is available
>
>
>
> [In-place](#inplace_change_signature)  refactoring is available

The Change Signature refactoring combines several modifications that can be applied to a method signature or a class signature.

For a class, this refactoring can turn a class into a generic and manipulate its type parameters. It automatically corrects all calls, implementations and overriding of the class.

For a method, this refactoring can change the method name, add, remove, reorder, and rename parameters and exceptions, and propagate new parameters and exceptions through the hierarchy of calls.

Procedure: Change signature in place

1. In the editor, start adding or editing the parameter of a class or a method. IntelliJ IDEA will display the Change Signature inlay hint in the editor.

![In-place change signature refactoring](https://resources.jetbrains.com.cn/help/img/idea/2026.2/inplace_change_signature_refactoring.png)

2. Click the inlay hint or press `Alt+Enter` (Windows), `⌥ ⏎` (macOS), `⌥ ⏎` (IntelliJ IDEA Classic (macOS)), `⌥ ⏎` (macOS System Shortcuts), `Alt+Enter` (XWin), `Alt+Enter` (GNOME), `Alt+Enter` (KDE), `Alt+Enter` (Emacs), `Alt+Enter` (Sublime Text), `⌥ ⏎` (Sublime Text (macOS)), `Alt+Enter` (NetBeans), `Alt+Enter` (Visual Studio), `⌥ ⏎` (Visual Studio (macOS)), `Ctrl+1` (Eclipse), `⌘ 1` (Eclipse (macOS)).

If you are editing a parameter, IntelliJ IDEA will offer to update the usages for you. Click Next  to apply suggestions.

![Update usages for parameter](https://resources.jetbrains.com.cn/help/img/idea/2026.2/edit_parameter.png)

If you are adding a new parameter, IntelliJ IDEA will offer you to add a default value for it as well as update the usages. Click Update to apply default values.

![Add default value for a parameter](https://resources.jetbrains.com.cn/help/img/idea/2026.2/add_a_new_parameter.png)

Procedure: Invoke the Change Signature dialog

1. Select method or a class for which you want to change signature.

2. From the context menu, select `Refactor | Change Signature` (`Ctrl+F6` (Windows), `⌘ F6` (macOS), `⌘ F6` (IntelliJ IDEA Classic (macOS)), `⌘ ⌥ S` (macOS System Shortcuts), `Ctrl+F6` (XWin), `Ctrl+F6` (GNOME), `Ctrl+6` (KDE), `Ctrl+F6` (Emacs), `Ctrl+F6` (Sublime Text), `Ctrl+F6` (Sublime Text (macOS)), `Ctrl+F6` (NetBeans), `Ctrl+R, S` (Visual Studio), `⌘ R, S` (Visual Studio (macOS)), `Alt+Shift+C` (Eclipse), `⌘ ⌥ C` (Eclipse (macOS))).

3. In the dialog that opens depending on what you're changing signature for, specify the appropriate options and click Refactor. If you want to see a preview of your potential changes, click Preview.

## Change Class Signature example

Let's add type parameters `Param1, Param2` to a class `MyClass`.

> **Note:**
> For [Kotlin](https://kotlinlang.org/docs/reference/), this refactoring works the same as for Java. You can press `Ctrl+Alt+Shift+K` (Windows), `⌘ ⌥ ⇧ K` (macOS), `⌘ ⌥ ⇧ K` (IntelliJ IDEA Classic (macOS)), `⌘ ⌥ ⇧ K` (macOS System Shortcuts), `Ctrl+Alt+Shift+K` (XWin), `Ctrl+Alt+Shift+K` (GNOME), `Ctrl+Alt+Shift+K` (KDE), `Ctrl+Alt+Shift+K` (Emacs), `Ctrl+Alt+Shift+K` (Sublime Text), `⌘ ⌥ ⇧ K` (Sublime Text (macOS)), `Ctrl+Alt+Shift+K` (NetBeans), `Ctrl+Alt+Shift+K` (Visual Studio), `⌘ ⌥ ⇧ K` (Visual Studio (macOS)), `Ctrl+Alt+Shift+K` (Eclipse), `⌘ ⌥ ⇧ K` (Eclipse (macOS)) to convert your Java code to Kotlin.

String and Integer are default values that were specified in the Change Class Signature dialog for `Param1` and `Param2` respectively.

You can also add a bounded value for a parameter to put some restrictions on what gets passed to the type parameter. For example, add `Param3` with default value `List` and bounded value `Collection`

![Change a class signature](https://resources.jetbrains.com.cn/help/img/idea/2026.2/change_class_signature.png)

| Before | After |
| --- | --- |
|     ```JAVA  public class MyClass {      public class MyOtherClass {         MyClass myClass;          void myMethod(MyClass myClass) {          }     } } ```    |     ```JAVA  public class MyClass<Param1, Param2, Param3 extends Collection> {      public class MyOtherClass {         MyClass<String, Integer> myClass;          void myMethod(MyClass<String, Integer, List> myClass) {         }      } } ```    |

> **Tip:**
> The refactoring may be useful for changing the parameter order in the class signature as well as in all its usages.

## Change Method Signature example

You can add parameters to a method and specify different options in the Change Method Signature dialog to have different results.

You can also add exceptions to a method, and they will be propagated in a call hierarchy.

> **Note:**
> The Change Method Signature refactoring is applicable to a constructor. In this case, however, the name and the return type cannot be changed.

> **Note:**
> If the method contract is specified by the `@Contract` annotation, the Change Method Signature refactoring also tries to convert such methods. Yet, in some cases the refactoring might fail, and you will need to adjust the contract manually.

![Change a method signature](https://resources.jetbrains.com.cn/help/img/idea/2026.2/change_method_signature.png)

### Add parameters

Let's add a parameter with a name `price`, type `double`, and a default value `0.0`.

IntelliJ IDEA adds parameters to the method, updates method calls and specifies the default parameter value.

| Before | After |
| --- | --- |
|     ```JAVA  public class MyClass {      public void myMethod(int value) {      }      public class MyOtherClass {         public void myMethodCall(MyClass myClass) {             double d = 0.5;              myClass.myMethod(1);         }     } } ```    |     ```JAVA public class MyClass {      public void myMethod(int i, double price) {      }      public class MyOtherClass {         public void myMethodCall(MyClass myClass) {             double d = 0.5;              myClass.myMethod(1, 0.0);         }     } }   ```    |

### Use any variable

Let's update all the method calls and look for a variable of the appropriate type near the method call and pass it to the method. To achieve that check the Use Any Var option.

As a result, IntelliJ IDEA finds the variable d which has the same type as the new parameter and uses it in the method call.

| Before | After |
| --- | --- |
|     ```JAVA public class MyClass {      public void myMethod(int value) {      }      public class MyOtherClass {         public void myMethodCall(MyClass myClass) {             double d = 0.5;             myClass.myMethod(1);         }     } } ```    |     ```JAVA public class MyClass {      public void myMethod(int i, double price) {      }      public class MyOtherClass {         public void myMethodCall(MyClass myClass) {             double d = 0.5;             myClass.myMethod(1, d);         }     } } ```    |

### Overloading method

Let's ask IntelliJ IDEA to keep the method calls unchanged but create a new overloading method which will call the method with the new signature. To achieve that use the Delegate via overloading method option.

Note that the new overloading method has the old signature. However, it calls the method with the new signature. `0.0` was specified as the default parameter value when performing the refactoring.

| Before | After |
| --- | --- |
|     ```JAVA public class MyClass {     public void myMethod(int value) {      }      public class MyOtherClass {         public void myMethodCall(MyClass myClass) {             double d = 0.5;             myClass.myMethod(1);         }     } } ```    |     ```JAVA public class MyClass {     public void myMethod(int i) {         myMethod(i, 0.0);     }      public void myMethod(int i, double price) {      }      public class MyOtherClass {         public void myMethodCall(MyClass myClass) {             double d = 0.5;             myClass.myMethod(1);         }     } } ```    |

### Propagate parameters

Let's propagate ![Propagate parameters](https://resources.jetbrains.com.cn/help/img/idea/2026.2/propagateParameters.png) `Alt+G` the new parameter to the method call through the calling method `myMethodCall()`.

As a result, the new parameter `price` propagates to the method call through the calling method and changes the method call accordingly.

| Before | After |
| --- | --- |
|     ```JAVA public class MyClass {     public void myMethod(int value) {      }      public class MyOtherClass {         public void myMethodCall(MyClass myClass) {             double d = 0.5;             myClass.myMethod(1);         }     } } ```    |     ```JAVA public class MyClass {     public void myMethod(int i, double price) {      }       public class MyOtherClass {         public void myMethodCall(MyClass myClass, double price) {             double d = 0.5;             myClass.myMethod(1, price);         }     } } ```    |

### Propagate exceptions

Let's add a method `read` that throws an exception `IOException` to a class `MyClass`.

Then let's create a new class `ExtendsMyClass` that will extend `MyClass` and override the original `read` method.

Now if we go back to `MyClass` and decide to add another exception, for example, `TimeOutException` through this refactoring, the method `read` will be updated the sub class as well.

| Before | After |
| --- | --- |
|     ```JAVA                             public class MyClass {                                 public void read() throws IOException {                                 }                                  public void myMethod(int value) {                                  }                                  public class MyOtherClass {                                     public void myMethodCall(MyClass myClass) {                                         double d = 0.5;                                         myClass.myMethod(1);                                     }                                 }                             } //Let's create a new class "ExtendsMyClass".                              public class ExtendsMyClass extends MyClass {                                 @Override                                 public void read() throws IOException {                                     super.read();                                 }                             }  ```    |     ```JAVA                             public class MyClass {                                 public void read() throws IOException, TimeOutException {                                 }                                  public void myMethod(int value) {                                 }                                  public class MyOtherClass {                                     public void myMethodCall(MyClass myClass) {                                         double d = 0.5;                                         myClass.myMethod(1);                                     }                                 }                             }  //As you see, "TimeOutException" was added.                              public class ExtendsMyClass extends MyClass {                                 @Override                                 public void read() throws IOException, TimeOutException {                                     super.read();                                 }                             }  ```    |

> **Tip:**
> To see the Change Method Signature refactoring examples for languages other than Java, refer to the following topics:
>
>
>
> [Change Signature for PHP](https://www.jetbrains.com.cn/en-us/help/phpstorm/change-signature.html)
>
>
>
> [Change
> Signature for TypeScript](specific-typescript-refactorings.html#typescript_change_signature_proc)
>
>
>
> [Change
> Signature for JavaScript](specific-javascript-refactorings.html#javascript_change_signature_code_example)

Procedure: Add parameters

1. Click the `return` value that is highlighted in red color.

2. Press `Alt+Enter` (Windows), `⌥ ⏎` (macOS), `⌥ ⏎` (IntelliJ IDEA Classic (macOS)), `⌥ ⏎` (macOS System Shortcuts), `Alt+Enter` (XWin), `Alt+Enter` (GNOME), `Alt+Enter` (KDE), `Alt+Enter` (Emacs), `Alt+Enter` (Sublime Text), `⌥ ⏎` (Sublime Text (macOS)), `Alt+Enter` (NetBeans), `Alt+Enter` (Visual Studio), `⌥ ⏎` (Visual Studio (macOS)), `Ctrl+1` (Eclipse), `⌘ 1` (Eclipse (macOS)) and select Create parameter '<parameter_name>'.

3. In the Change Signature dialog, adjust parameter settings or accept suggested settings.

4. Click Refactor.

## Change signature dialog

> **TL;DR**
> Shortcut for the action: `Ctrl+F6` (Windows), `⌘ F6` (macOS), `⌘ F6` (IntelliJ IDEA Classic (macOS)), `⌘ ⌥ S` (macOS System Shortcuts), `Ctrl+F6` (XWin), `Ctrl+F6` (GNOME), `Ctrl+6` (KDE), `Ctrl+F6` (Emacs), `Ctrl+F6` (Sublime Text), `Ctrl+F6` (Sublime Text (macOS)), `Ctrl+F6` (NetBeans), `Ctrl+R, S` (Visual Studio), `⌘ R, S` (Visual Studio (macOS)), `Alt+Shift+C` (Eclipse), `⌘ ⌥ C` (Eclipse (macOS))
>
>
>
> General refactoring settings: `Settings | Editor | General`
>
>
>
> Access from [UML Class diagram](class-diagram.html) is available
>
>
>
> [In-place](#inplace_change_signature)  refactoring is available
>
>
>
> Shortcut: `Ctrl+F6` (Windows), `⌘ F6` (macOS), `⌘ F6` (IntelliJ IDEA Classic (macOS)), `⌘ ⌥ S` (macOS System Shortcuts), `Ctrl+F6` (XWin), `Ctrl+F6` (GNOME), `Ctrl+6` (KDE), `Ctrl+F6` (Emacs), `Ctrl+F6` (Sublime Text), `Ctrl+F6` (Sublime Text (macOS)), `Ctrl+F6` (NetBeans), `Ctrl+R, S` (Visual Studio), `⌘ R, S` (Visual Studio (macOS)), `Alt+Shift+C` (Eclipse), `⌘ ⌥ C` (Eclipse (macOS))
>
>
>
> Refactoring settings: `Settings | Editor | General`
>
>
>
> Access from [UML Class diagram](class-diagram.html) is available
>
>
>
> [In-place](#inplace_change_signature)  refactoring is available

| Item | Description |
| --- | --- |
|  Name | Name of a function, method, or a method specification. |
|  Parameters |    List of parameters in the signature. In the Parameters field, you can perform the following actions with parameters:        * Add ![The Add icon](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.expui.general.add.svg): Adds a new parameter. You can specify properties of the new parameter in the corresponding table row (a name, type, and a default value).    * Remove ![The Remove icon](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.expui.general.remove.svg): Removes a parameter.    * Up ![The Up icon](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.expui.general.moveUp.svg) and Down ![The Down icon](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.expui.general.moveDown.svg) icons: Reorders parameters.    |

[Java specific](change-class-signature-dialog.html) and [Scala specific](change-signature-for-scala.html) dialogs are available.

## See also

