Skip to content

Do not export "javax.annotation" packages#2699

Merged
iloveeclipse merged 1 commit intospotbugs:masterfrom
iloveeclipse:javax
Nov 15, 2023
Merged

Do not export "javax.annotation" packages#2699
iloveeclipse merged 1 commit intospotbugs:masterfrom
iloveeclipse:javax

Conversation

@iloveeclipse
Copy link
Copy Markdown
Member

This prevents spotbugs provided "javax.annotation" packages to be consumed by bundles that expect default (not spotbugs) "javax.annotation" packages that were previously shipped with "javax.annotation" bundle with SDK.

The problem appears since 4.30 SDK doesn't ship "javax.annotation" bundle anymore, so spotbugs exported packages are taken as alternative if the application doesn't have other providers and in worst case they are not what applications actually expected to receive or cause dependency cycles (spotbugs requires some bundle that requires some other that imports "javax.annotation" package that is coming from spotbugs).

The packages originally were needed by detectors shipped as bundles for IDE, but this is a very seldom case and in that case spotbugs-annotations is the better alternative. We should not export "wrong" javax packages anymore, it wasn't nice and it can cause only trouble now.

See eclipse-platform/eclipse.platform.releng.aggregator#1056

This prevents spotbugs provided "javax.annotation" packages to be
consumed by bundles that expect default (not spotbugs)
"javax.annotation" packages that were previously shipped with
"javax.annotation" bundle with SDK.

The problem appears since 4.30 SDK doesn't ship "javax.annotation"
bundle anymore, so spotbugs exported packages are taken as alternative
if the application doesn't have other providers and in worst case they
are not what applications actually expected to receive or cause
dependency cycles (spotbugs requires some bundle that requires some
other that imports "javax.annotation" package that is coming from
spotbugs).

The packages originally were needed by detectors shipped as bundles for
IDE, but this is a very seldom case and in that case
spotbugs-annotations is the better alternative. We should not export
"wrong" javax packages anymore, it wasn't nice and it can cause only
trouble now.

See eclipse-platform/eclipse.platform.releng.aggregator#1056
@iloveeclipse iloveeclipse merged commit f839cac into spotbugs:master Nov 15, 2023
@iloveeclipse iloveeclipse deleted the javax branch November 15, 2023 05:44
@hazendaz hazendaz added this to the SpotBugs 4.8.2 milestone Dec 18, 2023
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.

3 participants