Skip to content

Remove unnecessary parameter. #3828

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

Closed

Conversation

hgh1472
Copy link
Contributor

@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 <[email protected]>
@hgh1472 hgh1472 force-pushed the remove-unnecessary-parameter branch from c6f7ca6 to e79563a Compare April 4, 2025 15:30
@mp911de mp911de self-assigned this Apr 14, 2025
@mp911de mp911de added type: task A general task and removed status: waiting-for-triage An issue we've not yet triaged labels Apr 15, 2025
@mp911de mp911de added this to the 3.4.5 (2024.1.5) milestone Apr 15, 2025
mp911de pushed a commit that referenced this pull request Apr 15, 2025
Remove unnecessary boolean nativeQuery from checkHasNamedParameter of StringQueryUnitTests class.

Signed-off-by: hgh1472 <[email protected]>

Closes #3827
Original pull request: #3828
mp911de pushed a commit that referenced this pull request Apr 15, 2025
Remove unnecessary boolean nativeQuery from checkHasNamedParameter of StringQueryUnitTests class.

Signed-off-by: hgh1472 <[email protected]>

Closes #3827
Original pull request: #3828
mp911de pushed a commit that referenced this pull request Apr 15, 2025
Remove unnecessary boolean nativeQuery from checkHasNamedParameter of StringQueryUnitTests class.

Signed-off-by: hgh1472 <[email protected]>

Closes #3827
Original pull request: #3828
@mp911de
Copy link
Member

mp911de commented Apr 15, 2025

Thank you for your contribution. That's merged and backported now.

@mp911de mp911de closed this Apr 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: task A general task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unused boolean nativeQuery parameter in checkHasNamedParameter method of StringQueryUnitTests
3 participants