Skip to content

org.springframework.core.Constants fail with NPE dispite method documentations say that it accepts null values [SPR-9608] #14242

@spring-projects-issues

Description

@spring-projects-issues

Diogo Quintela opened SPR-9608 and commented

Hello,

org.springframework.core.Constants

toCodeForSuffix and toCode
methods declare that they accept null as "suffix" and "prefix"
yet they fail to guard it use into String#startsWith and it gloriosly fail.

I've been using the empty string and not the null string to achieve the same
the constants resolution happily - after 2 or 3 years after finding the small bug only today managed to create this issue (two in a row, that's why).

Best regards
Diogo Quintela


No further details from SPR-9608

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions