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

Remove unnecessary parameter. #3828

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hgh1472
Copy link

@hgh1472 hgh1472 commented Apr 4, 2025

Closes #3827

	private void checkHasNamedParameter(String query, boolean expected, String label, boolean nativeQuery) {

		List<ParameterBinding> bindings = new ArrayList<>();
		StringQuery.ParameterBindingParser.INSTANCE.parseParameterBindingsOfQueryIntoBindingsAndReturnCleanedQuery(query,
				bindings, new StringQuery.Metadata());

		assertThat(bindings.stream().anyMatch(it -> it.getIdentifier().hasName())) //
				.describedAs(String.format("<%s> (%s)", query, label)) //
				.isEqualTo(expected);
	}

Looking at the code, I noticed that the boolean nativeQuery parameter in the checkHasNamedParameter method was not being used.

-	private void checkHasNamedParameter(String query, boolean expected, String label, boolean nativeQuery) {
+	private void checkHasNamedParameter(String query, boolean expected, String label) {

So, I tried to remove this unused parameter and updated the methods that use it accordingly.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Apr 4, 2025
Remove unnecessary boolean nativeQuery from checkHasNamedParameter of StringQueryUnitTests class.

Signed-off-by: hgh1472 <hgh1472@naver.com>
@hgh1472 hgh1472 force-pushed the remove-unnecessary-parameter branch from c6f7ca6 to e79563a Compare April 4, 2025 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-triage An issue we've not yet triaged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unused boolean nativeQuery parameter in checkHasNamedParameter method of StringQueryUnitTests
2 participants