Skip to content

Commit f3fd6e2

Browse files
authored
Fix #5052: Minor bug in FirstCharBasedValidator.forFirstNameRule(): returns null in non-default case (#5053)
1 parent d0a8330 commit f3fd6e2

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

release-notes/VERSION-2.x

+2
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ Project: jackson-databind
7676
failure of `java.util.Optional` (de)serialization without Java 8 module
7777
#5014: Add `java.lang.Runnable` as unsafe base type in `DefaultBaseTypeLimitingValidator`
7878
#5020: Support new `@JsonProperty.isRequired` for overridable definition of "required-ness"
79+
#5052: Minor bug in `FirstCharBasedValidator.forFirstNameRule()`: returns `null`
80+
in non-default case
7981
8082
2.18.3 (28-Feb-2025)
8183

src/main/java/com/fasterxml/jackson/databind/introspect/DefaultAccessorNamingStrategy.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -504,11 +504,11 @@ protected FirstCharBasedValidator(boolean allowLowerCaseFirstChar,
504504
* consider difference between "setter-methods" {@code setValue()} and {@code set_value()}.
505505
*
506506
* @return Validator instance to use, if any; {@code null} to indicate no additional
507-
* rules applied (case when both arguments are {@code false})
507+
* rules applied (case when both arguments are {@code true})
508508
*/
509509
public static BaseNameValidator forFirstNameRule(boolean allowLowerCaseFirstChar,
510510
boolean allowNonLetterFirstChar) {
511-
if (!allowLowerCaseFirstChar && !allowNonLetterFirstChar) {
511+
if (allowLowerCaseFirstChar && allowNonLetterFirstChar) {
512512
return null;
513513
}
514514
return new FirstCharBasedValidator(allowLowerCaseFirstChar,

0 commit comments

Comments
 (0)