playframework / playframework/play1

[Template] avoid thousands of MissingPropertyExceptions

Open
#1,067 6 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.