| Summary: | [AutoRefactor immigration #31/138] [cleanup & saveaction] Objects.hash() | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Fabrice Tiercelin <fabrice.tiercelin> |
| Component: | UI | Assignee: | Fabrice Tiercelin <fabrice.tiercelin> |
| Status: | VERIFIED FIXED | QA Contact: | Carsten Hammer <carsten.hammer> |
| Severity: | enhancement | ||
| Priority: | P3 | ||
| Version: | 4.17 | ||
| Target Milestone: | 4.18 M3 | ||
| Hardware: | All | ||
| OS: | All | ||
| See Also: |
https://git.eclipse.org/r/c/jdt/eclipse.jdt.ui/+/170468 https://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=64e5a9cab23ee26c331d3fabad5e5c83e09b6f6f https://git.eclipse.org/r/c/www.eclipse.org/eclipse/news/+/172396 https://git.eclipse.org/c/www.eclipse.org/eclipse/news.git/commit/?id=9b83037d76ed2c46000e5c7c26dafc5998e0f01c https://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=29ad95c917b536f9d15b7755ee47f5d166573525 |
||
| Whiteboard: | |||
| Bug Depends on: | |||
| Bug Blocks: | 566539 | ||
|
Description
Fabrice Tiercelin
New Gerrit change created: https://git.eclipse.org/r/c/jdt/eclipse.jdt.ui/+/170468 Gerrit change https://git.eclipse.org/r/c/jdt/eclipse.jdt.ui/+/170468 was merged to [master]. Commit: http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=64e5a9cab23ee26c331d3fabad5e5c83e09b6f6f I found another small change regarding warning generation. Nothing serious and maybe something to be considered in a way that goes beyond this use case:
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((this.name == null) ? 0 : this.name.hashCode());
result = prime * result + ((this.parent == null) ? 0 : this.parent.hashCode());
return result;
}
This code is refactored to
@Override
public int hashCode() {
return Objects.hash(name, parent);
}
After applying it I get warnings "Unqualified access to the field SourceMapper.LocalVariableElementKey.name".
Maybe there is a way to take into account project preferences regarding usage of "this" for fields for all quickfixes.
I think you're right. I will take time to think about it. New Gerrit change created: https://git.eclipse.org/r/c/www.eclipse.org/eclipse/news/+/172396 Gerrit change https://git.eclipse.org/r/c/www.eclipse.org/eclipse/news/+/172396 was merged to [master]. Commit: http://git.eclipse.org/c/www.eclipse.org/eclipse/news.git/commit/?id=9b83037d76ed2c46000e5c7c26dafc5998e0f01c Verified for 4.18M3 using I20201116-1800 build Gerrit change https://git.eclipse.org/r/c/jdt/eclipse.jdt.ui/+/170914 was merged to [master]. Commit: http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=29ad95c917b536f9d15b7755ee47f5d166573525 |