eclipse-jdt / eclipse-jdt/eclipse.jdt.ui

The Move Method refactoring caused an error related to "The declared type of the explicit 'this' parameter".

Open
#2,308 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
59
Forks
127
Avg merge
1d 8h
Merged PRs (30d)
37

Description

Select the method "m" , then click "refactor" -> "move" and move to the target class "TargetClass".
Error: "The declared type of the explicit 'this' parameter is expected to be TargetClass"

 class SourceClass {
     TargetClass t;
     void m(SourceClass this) {}
}
class TargetClass{}
 class SourceClass {
       TargetClass t;
}
class TargetClass{
	void m(SourceClass this) {}
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue through the Refactor -> Move action using the SourceClass and TargetClass examples in the report. Trace the Move Method refactoring path and verify that moving m no longer produces the explicit-this type error while preserving the method declaration shown in the expected result.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.