You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ofbiz.apache.org by "Mridul Pathak (Jira)" <ji...@apache.org> on 2026/10/30 04:35:00 UTC
[jira] [Created] (OFBIZ-13771) FlexibleServletAccessor.hashCode throws a NullPointerException when the name is null
Mridul Pathak created OFBIZ-13771:
-------------------------------------
Summary: FlexibleServletAccessor.hashCode throws a NullPointerException when the name is null
Key: OFBIZ-13771
URL: https://issues.apache.org/jira/browse/OFBIZ-13771
Project: OFBiz
Issue Type: Bug
Components: framework/base
Affects Versions: Upcoming Branch, 24.09.08
Reporter: Mridul Pathak
Assignee: Mridul Pathak
FlexibleServletAccessor accepts a null name: the constructors treat it as an empty accessor, and equals compares null names safely. hashCode calls name.hashCode() without a null check, so it throws a NullPointerException for such an accessor, for example when it is put in a HashMap or HashSet. equals and hashCode are inconsistent: two accessors that compare equal cannot both be hashed.
h3. Proposed fix
Use Objects.hashCode(name) in hashCode.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)