Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SpEL fails to compile expression indexing into boolean array #32400

Closed
sbrannen opened this issue Mar 8, 2024 · 0 comments
Closed

SpEL fails to compile expression indexing into boolean array #32400

sbrannen opened this issue Mar 8, 2024 · 0 comments
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: bug A general bug
Milestone

Comments

@sbrannen
Copy link
Member

sbrannen commented Mar 8, 2024

While working on #29847, I noticed that the SpEL Indexer omits support for compiling an expression that indexes into a primitive boolean array.

For example, the following test fails at the assertCanCompile() line.

@Test
void indexIntoPrimitiveBooleanArray() {
	boolean[] booleans = { true, false, true };

	expression = parser.parseExpression("[1]");

	assertThat(expression.getValue(booleans)).isEqualTo(false);
	assertCanCompile(expression);
	assertThat(expression.getValue(booleans)).isEqualTo(false);
	assertThat(getAst().getExitDescriptor()).isEqualTo("Z");
}
@sbrannen sbrannen added type: bug A general bug in: core Issues in core modules (aop, beans, core, context, expression) labels Mar 8, 2024
@sbrannen sbrannen added this to the 6.1.5 milestone Mar 8, 2024
@sbrannen sbrannen self-assigned this Mar 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: bug A general bug
Projects
None yet
Development

No branches or pull requests

1 participant