description Change Parameter Type Overview
This refactoring changes the expected type of an argument in a method signature (e.g., from `String` to `UUID`). The IDE automatically updates the method body to handle the conversion or throws errors at all call sites that pass the old, incompatible type, forcing the developer to explicitly handle the necessary type conversion logic.
help Change Parameter Type FAQ
What happens to call sites when I use 'Change Parameter Type' in IntelliJ?
When you change a parameter type, such as from String to UUID, the JetBrains IDE will attempt to update the method body to handle the conversion. However, it will immediately highlight any call sites passing the old incompatible type as errors.
How do I safely change a method signature in IntelliJ IDEA?
You can safely alter a parameter type by using the native 'Change Signature' refactoring tool. This forces the developer to manually fix the incompatible call sites, ensuring a safe transition without breaking runtime execution.
Can IntelliJ automatically cast a parameter type during refactoring?
The IDE will do its best to automatically update the method body to handle the new conversion. If it cannot safely wrap or cast the old argument, it will leave compilation errors at the call sites for you to manually resolve.
Does 'Change Parameter Type' affect inherited methods in JetBrains IDEs?
Yes, changing a parameter type fundamentally alters the method signature, which can break implementations of an interface. The IDE will warn you if the refactoring forces the developer to update overriding methods to accept the new type.
explore Explore More
Similar to Change Parameter Type
See all arrow_forwardReviews & Comments
Write a Review
Be the first to review
Share your thoughts with the community and help others make better decisions.