Skip to content
Success

Changes

Summary

  1. Bug 573884 - [refactoring] "Extract superclass" produces compile errors (details)
Commit d594121490e7ece91f116c049ee586f7720074bd by Jeff Johnston
Bug 573884 - [refactoring] "Extract superclass" produces compile errors

- make PullUpRefactoringProcessor.checkFinalFields() method protected
  so it can be overridden
- add new checkFinalFields() method to ExtractSupertypeProcessor
  that doesn't do anything and succeeds
- add new code to ExtractSupertypeProcessor.createNecessaryConstructors
  method to keep track of any uninitialized non-static final fields
  that are being moved and to modify the constructors to pass and
  set these fields
- add new fixConstructorsWithFinalFieldInitialization to modify
  any constructors in the original type that initialize final fields
  that are moved to add the field arguments to a super constructor
  and remove any statements that set the fields
- add new tests to ExtractSupertypeTests and add support for
  extracting fields as well as methods

Change-Id: I9592e0d9a01d764531a88837cdb7a04ac23b30f0
Reviewed-on: https://git.eclipse.org/r/c/jdt/eclipse.jdt.ui/+/183208
Tested-by: JDT Bot <jdt-bot@eclipse.org>
Tested-by: Jeff Johnston <jjohnstn@redhat.com>
Reviewed-by: Jeff Johnston <jjohnstn@redhat.com>
The file was addedorg.eclipse.jdt.ui.tests.refactoring/resources/ExtractSupertype/testBug573884_1/in/A.java
The file was addedorg.eclipse.jdt.ui.tests.refactoring/resources/ExtractSupertype/testBug573884_1/out/A.java
The file was modified org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/ExtractSupertypeTests.java
The file was addedorg.eclipse.jdt.ui.tests.refactoring/resources/ExtractSupertype/testBug573884_3/out/Z.java
The file was addedorg.eclipse.jdt.ui.tests.refactoring/resources/ExtractSupertype/testBug573884_1/out/Z.java
The file was addedorg.eclipse.jdt.ui.tests.refactoring/resources/ExtractSupertype/testBug573884_2/in/A.java
The file was addedorg.eclipse.jdt.ui.tests.refactoring/resources/ExtractSupertype/testBug573884_3/in/A.java
The file was addedorg.eclipse.jdt.ui.tests.refactoring/resources/ExtractSupertype/testBug573884_2/out/A.java
The file was modified org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/ExtractSupertypeProcessor.java
The file was addedorg.eclipse.jdt.ui.tests.refactoring/resources/ExtractSupertype/testBug573884_2/out/Z.java
The file was addedorg.eclipse.jdt.ui.tests.refactoring/resources/ExtractSupertype/testBug573884_3/out/A.java
The file was modified org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/PullUpRefactoringProcessor.java