Skip to content

Update VersionInfoUtils - Fix deprecation message logic to use OR instead of AND #3185

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

maxpdr96
Copy link

Fix deprecation message logic to use OR instead of AND

Motivation

The deprecation warning message was previously suppressed only if both the environment variable and the system property were set to 'true', due to the use of &&.

This PR corrects the condition to use ||, so the warning is suppressed if either the environment variable or the system property is explicitly set to 'true'.

Changes

  • Replaced && with || in the deprecation announcement check.

Fix deprecation message logic to use OR instead of AND
@debora-ito
Copy link
Member

HI @maxpdr96 the current check logic is:

boolean printDeprecationAnnouncement = 
        !isTrue(disableAnnouncementEnvVar) && !isTrue(disableAnnouncementSysProp);

So the deprecation message will be printed if, and only if, both DISABLE_DEPRECATION_ANNOUNCEMENT_ENV_VAR and DISABLE_DEPRECATION_ANNOUNCEMENT_SYS_PROP returns false.

If either the environment variable or the system property is set to true, printDeprecationAnnouncement will be false and the announcement won't be printed, and this is the behavior we want.

With the change you're proposing, if either environment variable or the system property are set to true, printDeprecationAnnouncement will be true, but this isn't the intended behavior.

Hope this helps. I'll close this PR, but we appreciate you reaching out.

Note that Java SDK 1.x is in Maintenance Mode, we are only releasing critical fixes.

@debora-ito debora-ito closed this Jul 15, 2025
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.

2 participants