Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,19 @@
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"debugWebviews": true,
"args": ["--extensionDevelopmentPath=${workspaceRoot}" ],
"env": {
"DEBUG_VSCODE_JAVA":"true"
},
"stopOnEntry": false,
"sourceMaps": true,
"outFiles": [ "${workspaceRoot}/dist/**/*.js" ],
"preLaunchTask": "npm: watch"
"preLaunchTask": "npm: watch",
"rendererDebugOptions": {
"urlFilter": "*redhat.java*",
"sourceMaps": true,
}
},
{
"name": "Launch Extension - Remote Server",
Expand All @@ -36,6 +41,7 @@
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"debugWebviews": true,
"args": ["--extensionDevelopmentPath=${workspaceRoot}" ],
"stopOnEntry": false,
"sourceMaps": true,
Expand All @@ -44,7 +50,11 @@
"JDTLS_CLIENT_PORT": "5036",
"DEBUG_VSCODE_JAVA":"true"
},
"preLaunchTask": "npm: watch"
"preLaunchTask": "npm: watch",
"rendererDebugOptions": {
"urlFilter": "*redhat.java*",
"sourceMaps": true,
}
},
{
"name": "Launch Extension - SyntaxLS Client",
Expand Down
39 changes: 38 additions & 1 deletion document/_java.learnMoreAboutRefactorings.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
- [Inline constant](#inline-constant)
- [Inline local variable](#inline-local-variable)
- [Inline method](#inline-method)
- [Introduce Parameter](#introduce-parameter)
- Method signature
- [Introduce Parameter](#introduce-parameter)
- [Change method signature](#change-method-signature)
- Invert boolean
- [Invert conditions](#invert-conditions)
- [Invert local variable](#invert-local-variable)
Expand Down Expand Up @@ -469,6 +471,41 @@ public void addUser(String name) {
}
```

---

## Change Method Signature
Changes the method visibility, return type, name, and updates the parameters and exceptions. The above changes can be applied through the call hierarchy of the method.

### Example
Let's change signature for the method `public void setAddress(String address)`.

#### Before

```java
public void setAddress(String address) {
this.address = address;
}

public void setAddr() {
this.setAddress("Addr");
}
```

#### Refactor configuration

![change_signature](./refactoring_change_signature.png)
#### After
```java
public void setAddress1(Object newParam, String address) {
this.address = address;
}

public void setAddr() {
this.setAddress1(null, "Addr");
}
```
---

## Invert conditions
Inverts the boolean expression in the conditions.

Expand Down
Binary file added document/refactoring_change_signature.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading