PageParameters.hashCode is inconsistent with equals for named parameters in a different order
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
在 Java 源代码中找到 PageParameters.equals 和 PageParameters.hashCode,然后阅读它们的实现和附近的测试。为以不同顺序插入的相同命名参数添加或更新测试,并验证它们的哈希码是否匹配;issue 将对参数对的哈希码求和描述为一种可行方案。
由索引模型根据 Issue 内容生成。
描述
PageParameters.equals and PageParameters.hashCode disagree about the named parameters, so two PageParameters that are equal can have different hash codes. That breaks the contract of Object.hashCode.
equals compares the named parameters regardless of their order: the lists must hold the same pairs, each the same number of times. hashCode uses namedParameters.hashCode(), the order-sensitive hash of the List<NamedPair>.
PageParameters a = new PageParameters().add("a", "1").add("b", "2");
PageParameters b = new PageParameters().add("b", "2").add("a", "1");
a.equals(b); // true
a.hashCode() == b.hashCode(); // false
Anything that puts PageParameters in a hash-based collection, or in a key that includes them, can treat these two as different. The fix is to make hashCode order-insensitive for the named parameters, for example by summing the hash codes of the pairs.
- 主要语言
- Java
- 星标
- 799
- 派生
- 420
- 平均合并
- 18 小时 37 分钟
- 30 天内合并 PR
- 140
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
apache/wicket 的其他 Issue
-
Document and enforce pull request review guidelines可能已有人在做 @dashorst 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
COOP and COEP exemptions compare with the context path, so page exemptions never match可能已有人在做 @asvanberg 于 18 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 67/100
apache/wicket#1661 · 1 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
The CSP report-uri is lost in development mode because strict() clears it可能重新可做 @VelpulaGangavardhan 于 23 天前认领,目前没有进行中的 PR。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
相似的 Issue
-
`Time.at(t, in: nil)` returns UTC instead of the local time (or the time zone of `t`), unlike CRuby未关闭
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
hermes-queue
难度 1/5 1 小时以内 新手友好度 72/100
chrisalunlloyd2-sudo/mindpalace#349 ·
维护者通常 1 天内回复
-
Retry-After parser accepts invalid delay-seconds values可能已有人在做 @Dhruvraj-Rana 今天认领。 未关闭Bug
难度 2/5 1-3 小时 新手友好度 82/100
open-telemetry/opentelemetry-java#9018 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
dropwizard/dropwizard#11410 ·
维护者通常 1 天内回复
-
bug priority: medium Review effort [1-5]: 2 status: needs-triage type: bug
难度 2/5 1-3 小时 新手友好度 78/100
carlos-emr/carlos#5818 ·
维护者通常 1 天内回复