Skip to content

refactor: remove useless cast and check in EnvironmentPreparedEventForPropertiesLogging#50

Merged
FBibonne merged 1 commit into
masterfrom
refactor/remove-useless-cast-in-environment-prepared-event
Apr 23, 2026
Merged

refactor: remove useless cast and check in EnvironmentPreparedEventForPropertiesLogging#50
FBibonne merged 1 commit into
masterfrom
refactor/remove-useless-cast-in-environment-prepared-event

Conversation

@FBibonne

Copy link
Copy Markdown
Owner

Summary

  • ApplicationEnvironmentPreparedEvent.getEnvironment() retourne déjà un ConfigurableEnvironment : le check instanceof et le cast dans abstractEnvironment() étaient inutiles
  • La méthode abstractEnvironment() est inlinée dans onApplicationEvent() et supprimée
  • L'import java.util.Optional devenu inutilisé est retiré
  • La Javadoc est mise à jour pour ne plus mentionner la vérification de type

Closes #49

Test plan

  • mvn test : 29 tests, 0 échec

🤖 Generated with Claude Code

…rPropertiesLogging

ApplicationEnvironmentPreparedEvent.getEnvironment() already returns a
ConfigurableEnvironment, so the instanceof check and cast were unnecessary.
Inline the abstractEnvironment() method and drop the unused Optional import.

Closes #49

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@FBibonne FBibonne merged commit 3f8c32d into master Apr 23, 2026
1 check passed
@FBibonne FBibonne deleted the refactor/remove-useless-cast-in-environment-prepared-event branch April 23, 2026 06:08
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.

Do not cast as ConfigurableEnvironment the result of applicationEnvironmentPreparedEvent.getEnvironment

1 participant