Copilot/fix type hierarchy sorting#2779
Closed
carstenartur wants to merge 38 commits into
Closed
Conversation
* Bump codacy/codacy-analysis-cli-action from 1.1.0 to 4.4.0 (#19) * Formaster3 (#20) * Update maven.yml (#9) * Formaster4 (#8) * Create dependabot.yml * Update dependabot.yml * Update dependabot.yml * Update dependabot.yml * Create codacy.yml * Update pom.xml * Bump tycho.version from 2.3.0 to 2.7.3 Bumps `tycho.version` from 2.3.0 to 2.7.3. Updates `tycho-surefire-plugin` from 2.3.0 to 2.7.3 Updates `tycho-source-plugin` from 2.3.0 to 2.7.3 - [Release notes](https://github.com/eclipse/tycho/releases) - [Changelog](https://github.com/eclipse/tycho/blob/master/RELEASE_NOTES.md) - [Commits](eclipse-tycho/tycho@tycho-2.3.0...tycho-2.7.3) Updates `tycho-p2-plugin` from 2.3.0 to 2.7.3 --- updated-dependencies: - dependency-name: org.eclipse.tycho:tycho-surefire-plugin dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: org.eclipse.tycho:tycho-source-plugin dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: org.eclipse.tycho:tycho-p2-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * Create codeql.yml * Create maven.yml * Update README.md * Update README.md * Update README.md * Bump tycho.version from 2.7.3 to 2.7.4 Bumps `tycho.version` from 2.7.3 to 2.7.4. Updates `tycho-surefire-plugin` from 2.7.3 to 2.7.4 Updates `tycho-source-plugin` from 2.7.3 to 2.7.4 - [Release notes](https://github.com/eclipse/tycho/releases) - [Changelog](https://github.com/eclipse/tycho/blob/tycho-2.7.4/RELEASE_NOTES.md) - [Commits](eclipse-tycho/tycho@tycho-2.7.3...tycho-2.7.4) Updates `tycho-p2-plugin` from 2.7.3 to 2.7.4 --- updated-dependencies: - dependency-name: org.eclipse.tycho:tycho-surefire-plugin dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.eclipse.tycho:tycho-source-plugin dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.eclipse.tycho:tycho-p2-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * Bump tycho.version from 2.7.4 to 2.7.5 Bumps `tycho.version` from 2.7.4 to 2.7.5. Updates `tycho-surefire-plugin` from 2.7.4 to 2.7.5 Updates `tycho-source-plugin` from 2.7.4 to 2.7.5 - [Release notes](https://github.com/eclipse/tycho/releases) - [Changelog](https://github.com/eclipse-tycho/tycho/blob/tycho-2.7.5/RELEASE_NOTES.md) - [Commits](eclipse-tycho/tycho@tycho-2.7.4...tycho-2.7.5) Updates `tycho-p2-plugin` from 2.7.4 to 2.7.5 --- updated-dependencies: - dependency-name: org.eclipse.tycho:tycho-surefire-plugin dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.eclipse.tycho:tycho-source-plugin dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.eclipse.tycho:tycho-p2-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * Update README.md * Update maven.yml * Update codeql.yml * Update README.md * Update README.md * Update README.md * Update README.md * Update dependabot.yml Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Update maven.yml * Update maven.yml (#10) * Update maven.yml for java 20 (#11) * Update codeql.yml (#12) * Update maven.yml * Update codeql.yml * Update codeql.yml * Bump actions/setup-java from 2 to 4 (#17) Bumps [actions/setup-java](https://github.com/actions/setup-java) from 2 to 4. - [Release notes](https://github.com/actions/setup-java/releases) - [Commits](actions/setup-java@v2...v4) --- updated-dependencies: - dependency-name: actions/setup-java dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump github/codeql-action from 2 to 3 (#16) Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2 to 3. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](github/codeql-action@v2...v3) --- updated-dependencies: - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump codacy/codacy-analysis-cli-action from 1.1.0 to 4.3.0 (#15) Bumps [codacy/codacy-analysis-cli-action](https://github.com/codacy/codacy-analysis-cli-action) from 1.1.0 to 4.3.0. - [Release notes](https://github.com/codacy/codacy-analysis-cli-action/releases) - [Commits](codacy/codacy-analysis-cli-action@d840f88...5cc54a7) --- updated-dependencies: - dependency-name: codacy/codacy-analysis-cli-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump cirrus-actions/rebase from 1.7 to 1.8 (#14) Bumps [cirrus-actions/rebase](https://github.com/cirrus-actions/rebase) from 1.7 to 1.8. - [Release notes](https://github.com/cirrus-actions/rebase/releases) - [Commits](cirrus-actions/rebase@1.7...1.8) --- updated-dependencies: - dependency-name: cirrus-actions/rebase dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Update codeql.yml * Update codacy.yml * Bump actions/checkout from 3 to 4 (#13) * Update codacy.yml --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump stCarolas/setup-maven from 4.5 to 5 (#22) --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…pe enabled Co-authored-by: carstenartur <3164220+carstenartur@users.noreply.github.com>
…d refactoring, not Type Hierarchy sorting Co-authored-by: carstenartur <3164220+carstenartur@users.noreply.github.com>
…ing (issue eclipse-jdt#1865) Co-authored-by: carstenartur <3164220+carstenartur@users.noreply.github.com>
… error handling Co-authored-by: carstenartur <3164220+carstenartur@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements a fix for issue #1865 to detect when moving a method would change which overloaded method gets called due to method resolution changes.
Problem
When moving a method to a class that has a superclass with a method of the same name but different parameter types, the refactoring could silently change which method gets called, leading to incorrect behavior.
Example from issue #1865:
m(Object)m(String)to be moved to Bm("1")currently resolves to A.m(Object)This is a semantic change that should be detected and reported as an error.
Solution Implemented
Added a new check method
checkOverloadResolutionChanges()inMoveInstanceMethodProcessorthat:Changes Made
MoveInstanceMethodProcessor.java:
checkOverloadResolutionChanges()method with progress monitoringcheckFinalConditions()with proper progress trackingRefactoringCoreMessages.java & refactoring.properties:
MoveInstanceMethodProcessor_overload_resolution_changeMoveInstanceMethodProcessor_hierarchy_not_availableTest Resources:
testFailOverloadResolutionwith the exact scenario from issue “Move method refactoring” causes the method call relationship to change #1865The fix now correctly prevents the move method refactoring when it would change which overloaded method gets called, addressing the exact scenario described in issue #1865.
What it does
How to test
Author checklist