Skip to content

equals() generation is broken with a field named other #1345

@anthonyvdotbe

Description

@anthonyvdotbe

If a class contains a field named other, the generated equals() method will be broken

Environment
  • Operating System: Windows 10
  • JDK version: 13.0.1
  • Visual Studio Code version: 1.43.2
  • Java extension version: 0.58.0
Steps To Reproduce
  1. do Source Action... -> Generate hashCode() and equals()... in the class below
class Issues {
    private String other;
}
Current Result
return Objects.equals(other, other.other);
Expected Result
return Objects.equals(this.other, other.other);

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions