Skip to content

Fix bean field naming conflict in SpringServletXmlBeansConfiguration#3836

Open
mortenrie wants to merge 1 commit intocloudfoundry:developfrom
mortenrie:fix_minor_sonar
Open

Fix bean field naming conflict in SpringServletXmlBeansConfiguration#3836
mortenrie wants to merge 1 commit intocloudfoundry:developfrom
mortenrie:fix_minor_sonar

Conversation

@mortenrie
Copy link
Copy Markdown

In SpringServletXmlBeansConfiguration, two @Autowired fields had the same names as the @bean methods they were used in:

  • globalClientSecretPolicy (field) clashed with globalClientSecretPolicy() (bean method)
  • defaultClientSecretPolicy (field) clashed with defaultUaaClientSecretPolicy() (bean method)

This naming conflict is flagged by SonarQube as a code smell, since the field name shadows the method name within the same class, which can cause confusion and potential Spring wiring issues.

The fix renames the two injected fields to globalClientSecretPolicyConfig and defaultClientSecretPolicyConfig respectively, making them clearly distinct from the @bean factory methods and resolving the Sonar warning.

@linux-foundation-easycla
Copy link
Copy Markdown

CLA Not Signed

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

Projects

Development

Successfully merging this pull request may close these issues.

2 participants