Skip to content

(Web)MergedContextConfiguration.equals is not symmetrical [SPR-13951] #18524

@spring-projects-issues

Description

@spring-projects-issues

Phil Webb opened SPR-13951 and commented

Currently MergedContextConfiguration.equals includes the following line:

if (!(other instanceof MergedContextConfiguration)) {
	return false;
}

I think it should be

if (!(other.getClass().equals(getClass())) {
	return false;
}

Since it's used as a cache key, i.e.:

MergedContextConfiguration c = ...
WebMergedContextConfiguration w = ...

w.equals(c); // false
c.equals(w); // true;

Affects: 4.2.4

Referenced from: commits ac44f9e, 659e441

Metadata

Metadata

Assignees

Labels

in: testIssues in the test moduletype: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions