Skip to content

HierarchicalUriComponents.equals() incorrectly returns false when other object is not an instance of OpaqueUriComponents [SPR-10088] #14721

@spring-projects-issues

Description

@spring-projects-issues

Vasily Ivanov opened SPR-10088 and commented

org.springframework.web.util.HierarchicalUriComponents.equals(Object) method incorrectly returns false when other object is not an instance of OpaqueUriComponents:

final class HierarchicalUriComponents extends UriComponents {

public boolean equals(Object obj) {
...
   if (!(obj instanceof OpaqueUriComponents)) {
      return false;
   }
...
}

I believe it meant to be:

final class HierarchicalUriComponents extends UriComponents {

public boolean equals(Object obj) {
...
   if (!(obj instanceof HierarchicalUriComponents)) {
      return false;
   }
...
}

Affects: 3.1.3

Referenced from: commits b0fce78, 7af92b4

Backported to: 3.1.4

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)status: backportedAn issue that has been backported to maintenance branchestype: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions