Skip to content

refactor: fix FieldMayBeFinal warnings across modules - #1435

Open
akenra wants to merge 1 commit into
spring-cloud:mainfrom
akenra:refactor/final-fields
Open

refactor: fix FieldMayBeFinal warnings across modules#1435
akenra wants to merge 1 commit into
spring-cloud:mainfrom
akenra:refactor/final-fields

Conversation

@akenra

@akenra akenra commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Hi @olegz!

I wanted to give the project a bit more love and hopefully help revive the somewhat stalled maintenance pace, starting with simple cosmetic changes.

Specifically, I went through the IntelliJ FieldMayBeFinal inspection warnings and fixed them across the codebase. Most changes are straightforward final additions, though a few required a bit more care:

  • SimpleFunctionRegistry.wrappedFunctionDefinitionsCacheSize - removed the field entirely. The value is only used in the anonymous LinkedHashMap.removeEldestEntry(), so the constructor parameter is captured directly
  • Made cache size configurable via spring.cloud.function.registry.cache-size property (default 1000) since the old test used reflection on a now-removed field
  • Renamed private static final fields that didn't follow UPPER_CASE convention (breeds→BREEDS, names→NAMES, results→RESULTS, webflux→WEBFLUX, errorAttributes→ERROR_ATTRIBUTES, headers→HEADERS)

Let me know if anything needs adjustments!

- Mark fields as final where applicable (FieldMayBeFinal inspection)
- Remove unnecessary wrappedFunctionDefinitionsCacheSize field in
  SimpleFunctionRegistry; constructor parameter captured by anonymous class
- Make wrappedFunctionDefinitionsCacheSize configurable via property
  spring.cloud.function.registry.cache-size (default 1000)
- Rename private static final fields to UPPER_CASE convention
  (BREEDS, NAMES, RESULTS, WEBFLUX, ERROR_ATTRIBUTES, HEADERS)

Signed-off-by: akenra <37288280+akenra@users.noreply.github.com>
@akenra
akenra force-pushed the refactor/final-fields branch from eb93fa3 to 8fca5e1 Compare July 30, 2026 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant