Skip to content
New issue

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

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

Already on GitHub? # to your account

HttpSecurityLambdaDslReconciler marks more than required #1141

Closed
BoykoAlex opened this issue Nov 7, 2023 · 1 comment
Closed

HttpSecurityLambdaDslReconciler marks more than required #1141

BoykoAlex opened this issue Nov 7, 2023 · 1 comment
Assignees
Labels
for: eclipse something that is specific for Eclipse for: vscode something that is specific for VSCode theme: validation type: bug

Comments

@BoykoAlex
Copy link
Contributor

BoykoAlex commented Nov 7, 2023

package net.bohni;

import java.util.stream.Stream;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.security.config.Customizer;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configurers.AuthorizeHttpRequestsConfigurer;
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;

@Configuration
@PropertySource(value= { "classpath:env.properties", "classpath:my-service.properties" }, ignoreResourceNotFound=true)
@EnableAsync
public class MyConfig
{
	@Bean
	Customizer<AuthorizeHttpRequestsConfigurer<HttpSecurity>.AuthorizationManagerRequestMatcherRegistry> authorizeHttpRequestsCustomizer()
	{
		return null;
	}
}

AuthorizeHttpRequestsConfigurer from the method declaration signature is marked. However, it is unlikely needed to be marked. The rewrite recipe seem to only be doing something if there a method call on HttpSecurity detected that could be convrted to the new DSL format. Otherwise the code isn't changed which results in the exception on the IDE side since the edit is empty.

Need to fix either:

  • Reconciler on the STS4 not to mark more than needed
  • HttpSecurityLambdaDsl from rewrite-spring should also replace types not only in the context of method invocations
@BoykoAlex
Copy link
Contributor Author

Fixed with bef47f0. Reconcilers marked more than required

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
for: eclipse something that is specific for Eclipse for: vscode something that is specific for VSCode theme: validation type: bug
Projects
None yet
Development

No branches or pull requests

2 participants