Skip to content

refactor: split ClassUtils into cache resolvers - #1099

Draft
nkuprins wants to merge 5 commits into
apache:mainfrom
nkuprins:refactor/extract-classutils
Draft

refactor: split ClassUtils into cache resolvers#1099
nkuprins wants to merge 5 commits into
apache:mainfrom
nkuprins:refactor/extract-classutils

Conversation

@nkuprins

Copy link
Copy Markdown
Contributor

DRAFT

Closed: #989

Purpose of the pull request

As title

What's changed?

  • Extracted column-layout resolution (declaredFields and its helpers) into a package-private SheetHeadFieldResolver.
  • Extracted per-field formatting resolution (declaredExcelContentProperty and its helpers) into a package-private SheetContentPropertyResolver.
  • Replaced the three switches with a MetadataCacheStrategy per CacheLocationEnum constant (InMemoryCache, ThreadLocalCache, NoOpCache), selected through MetadataCaches, which owns the caches for one kind of metadata and picks the tier from the ConfigurationHolder. CacheLocationEnum is now referenced in one class instead of three switches.
  • ClassUtils keeps getAllInterfaces, both key classes, and every public entry point, delegating to the resolvers.
  • Deprecated FIELD_CACHE, CLASS_CONTENT_CACHE and CONTENT_CACHE in favour of getFieldCache() / getClassContentCache() / getContentCache() (immutable views) and a new removeInMemoryCache(). The fields still alias the same live, mutable maps, so downstream reads and writes behave exactly as today - only a deprecation warning is added.

Checklist

  • I have read the Contributor Guide.
  • I have written the necessary doc or comment.
  • I have added the necessary unit tests and all cases have passed.

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.

[Enhancement] Split ClassUtils into per-concern classes and de-duplicate the cache-location switch

1 participant