Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for extracting method to outer class #1479

Merged
merged 1 commit into from
Jun 27, 2024

Conversation

jjohnstn
Copy link
Contributor

  • add new findFieldReferencesForType() method to ExtractMethodAnalyzer to find field references in the inner type where selection is made
  • add new logic to ExtractMethodRefactoring to recognize a move to an outer class where fields are referenced in inner in which case pass an extra parameter of the inner type and qualify any field references using this extra parameter
  • add new test to ExtractMethodTests
  • fixes Minor: Extract method from method in nested static class to outer class looses class variable #1458

What it does

Fixes extracting from an inner class to an outer class method.

How to test

See issue or new test.

Author checklist

@jjohnstn jjohnstn self-assigned this Jun 26, 2024
@jjohnstn jjohnstn added the bug Something isn't working label Jun 26, 2024
@jjohnstn jjohnstn added this to the 4.33 M1 milestone Jun 26, 2024
- add new findFieldReferencesForType() method to ExtractMethodAnalyzer
  to find field references in the inner type where selection is made
- add new logic to ExtractMethodRefactoring to recognize a move to
  an outer class where fields are referenced in inner in which case
  pass an extra parameter of the inner type and qualify any field
  references using this extra parameter
- add new test to ExtractMethodTests
- fixes eclipse-jdt#1458
@jjohnstn jjohnstn merged commit 7e703b9 into eclipse-jdt:master Jun 27, 2024
9 checks passed
@jjohnstn jjohnstn deleted the extracttoouter branch June 27, 2024 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Minor: Extract method from method in nested static class to outer class looses class variable
1 participant