Skip to content

HttpSecurityLambdaDslReconciler marks more than required #1141

Closed

Description

@BoykoAlex
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

Activity

  1. self-assigned this
    on Nov 8, 2023
  2. added this to the 4.21.0.RELEASE milestone on Nov 8, 2023
  3. added
    for: eclipse
    for: vscode
    and removed on Nov 8, 2023
  4. BoykoAlex commented on Nov 8, 2023

    @BoykoAlex
    ContributorAuthor

    Fixed with bef47f0. Reconcilers marked more than required

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

for: eclipsefor: vscodetheme: validationtype: bug

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions