Repository navigation
Handle null dynamic keys in lookup helper - #1198
Open
curforever wants to merge 1 commit into
Open
curforever wants to merge 1 commit into
curforever wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1060.
lookup obj person.idcurrently throws aNullPointerExceptionwhen the dynamic key resolves to null.LookupHelperdereferences the parameter withtoString()before checking that case.Treat a null key like an absent lookup parameter: return the original context. This preserves this Java helper's existing fallback for absent parameters and missing/null lookup results. A literal string
"null"still names a property; non-null lookups are unchanged.Validation on Windows / Microsoft OpenJDK 21.0.12 / Maven 3.9.11, with the original Java 17 release target and POM:
mvn -B -ff -ntp clean install: 1192 passing, 3 default skipped, zero failures/errors.mvn -B -ff -ntp clean package: 1192 passing, 3 default skipped, zero failures/errors.The Mustache spec submodule was checked out at its pinned gitlink. No POM/test exclusions or skip flags were added; repeated builds are not additional distinct tests. The 3 existing skips are one Mustache partial Failed Lookup spec case and two opt-in benchmark cases. No benchmark result is claimed.
Core Javadoc generation reports
No source files for package com.github.jknack.handlebars.cache. The unchanged upstream POM already setsmaven.javadoc.failOnError=false, so the default build exits with status 0 and downstream doc-link errors are ignored. Replaying the generated Javadoc arguments against original and fixed sources produced exit status 2 and the same error. Documentation generation is not claimed to pass.Other OS/JDK matrix cells were not run locally.
Prepared with assistance from OpenAI Codex; validation commands above were run locally.