Add TCK coverage for Section 1.6 when `expr-a` is the `null` literal (`${null.prop}`, `${null['prop']}`, `${null.method()}`)
Maintainers usually reply within 7 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
Research direction
Start by locating the TCK tests for Section 1.6 operators [] and . and read nearby cases for null property resolution. Add coverage for ${null.prop}, ${null['prop']}, and ${null.method()} following the issue's stated expected result. Run the relevant TCK tests; done when all three cases pass consistently.
Written by the indexing model from the issue text.
Description
In Section 1.6 ("Operators [] and .") of the Jakarta Expression Language 6.1 specification:
To evaluate
expr-a[expr-b]orexpr-a[expr-b](params):
- Evaluate
expr-aintovalue-a.- If
value-aisnull:
- If
expr-a[expr-b]is the last property being resolved:
- If the expression is a value expression and
ValueExpression.getValue(context)was called to initiate this expression evaluation, returnnull.- Otherwise, throw
PropertyNotFoundException. [trying to de-reference null for an lvalue]- Otherwise, return
null.
Section 1.6 makes no distinction between expr-a evaluating to null via an identifier/property (e.g. ${person.nullAddress.street}) versus expr-a being the null literal itself (e.g. ${null.prop}, ${null['prop']}, or ${null.method()}).
However, because the TCK currently only tests value-a == null when resolved from a bean/variable and does not test a literal null base, implementations behave differently:
- Eclipse Expressly: Returns
null(conforming to Section 1.6). - Apache Tomcat Jasper EL: Throws
jakarta.el.PropertyNotFoundException: ELResolver did not handle type: [null] with property of [null].
Steps to Reproduce
import jakarta.el.ELProcessor;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertNull;
public class NullLiteralBaseTest {
@Test
void testNullLiteralPropertyAndMethod() {
ELProcessor processor = new ELProcessor();
// Expressly returns null; Jasper EL throws PropertyNotFoundException
assertNull(processor.eval("null.prop"));
assertNull(processor.eval("null['prop']"));
assertNull(processor.eval("null.method()"));
}
}
Request
Please add TCK tests for ${null.prop}, ${null['prop']}, and ${null.method()} to ensure all certified implementations consistently follow Section 1.6 when expr-a is a null literal.
- Dominant language
- Java
- Stars
- 86
- Forks
- 54
- Avg merge
- 6d 9h
- Merged PRs (30d)
- 11
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing 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.
More from jakartaee/expression-language
-
ELProcessor.defineFunction() fails for valid method signaturesPossibly taken @RaphaelFakhri claimed this 7 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
jakartaee/expression-language#492 ·
Maintainers usually reply within 7 days
-
Difficulty 4/5 3-5 days Newbie friendliness 46/100
jakartaee/expression-language#503 ·
Maintainers usually reply within 7 days
-
Difficulty 4/5 3-5 days Newbie friendliness 57/100
jakartaee/expression-language#502 ·
Maintainers usually reply within 7 days
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
jakartaee/expression-language#500 ·
Maintainers usually reply within 7 days
-
certification
Difficulty 1/5 Under an hour Newbie friendliness 20/100
jakartaee/expression-language#494 · 2 reactions ·
Maintainers usually reply within 7 days
All issues in jakartaee/expression-language
Similar issues
-
desktop edt not responding
Difficulty 1/5 1-3 hours Newbie friendliness 86/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
physical
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
antonyrag/ragleap-core#1339 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
rezelyn/Wathe-Extended#116 ·