playframework / playframework/play1
[Template] avoid thousands of MissingPropertyExceptions
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.6k
- Forks
- 671
- Avg merge
- 12d 15h
- Merged PRs (30d)
- 1
Description
From @angryziber in #1039:
Binding can only contain variables (basically, a Map), not properties.
If groovy doesn't find a variable, it throws a MissingPropertyException populating the stacktrace.
GroovyTemplate.getProperty() first calls the getVariable(), if it throws (happens very often if you have optional bindings), then it catches and delegates to getProperty(), that does some slow work itself again.
This small change avoids these excessive exceptions with stacktraces on every missing variable access.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing GroovyTemplate.getProperty(), getVariable(), and the fallback getProperty() behavior described in the issue and referenced issue #1039. Confirm how missing optional bindings are handled, then verify that the change avoids repeated MissingPropertyException stack traces without breaking property lookup.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- groovy
- Domain
- web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100