Skip to content

Error on JDT configuration ignoring OSGi restrictions#2339

Merged
HannesWell merged 1 commit into
eclipse-pde:masterfrom
HannesWell:check-classpath-access-rules
May 18, 2026
Merged

Error on JDT configuration ignoring OSGi restrictions#2339
HannesWell merged 1 commit into
eclipse-pde:masterfrom
HannesWell:check-classpath-access-rules

Conversation

@HannesWell
Copy link
Copy Markdown
Member

As described in #2244 (comment), a value of the org.eclipse.jdt.core.compiler.problem.forbiddenReference preference other than error effectively disables the enforcement of almost all OSGi access rules. This potentially leads to classloading errors at runtime because access rule violations are not detected anymore at compile-time/in the IDE.

With this change, users are now informed about such misconfiguration of PDE projects, by an error on the build.properties file.
Alternatively the error marker could be added to the org.eclipse.jdt.core.prefs file of a project, but I think this is unusual.

For those that really want to ignore OSGi access rules at compile-time, I'm considering to add yet another preference to degrade this check to warning, info or to ignore. It's currently missing, but I plan to add it this evening.

I know we're now late in the development cycle, but in the context of #2218, I think it's important to have this for the upcoming release.

@HannesWell HannesWell requested review from laeubi and merks May 18, 2026 08:03
Copy link
Copy Markdown
Contributor

@merks merks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just nits. Looks fine. Would be good for the current cycle given the PDE changes to the classpath.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 18, 2026

Test Results

  126 files  ±0    126 suites  ±0   38m 42s ⏱️ + 3m 37s
3 510 tests ±0  3 456 ✅ ±0   54 💤 ±0  0 ❌ ±0 
9 333 runs  ±0  9 203 ✅ ±0  130 💤 ±0  0 ❌ ±0 

Results for commit 06ca7b2. ± Comparison against base commit 4f1f320.

♻️ This comment has been updated with latest results.

Copy link
Copy Markdown
Contributor

@laeubi laeubi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit doubtful this brings much value but it would also not harm.

@HannesWell HannesWell force-pushed the check-classpath-access-rules branch from a18fc9b to 06ca7b2 Compare May 18, 2026 18:51
@HannesWell
Copy link
Copy Markdown
Member Author

I'm a bit doubtful this brings much value but it would also not harm.

Usually not, but since we saw also in the Eclipse SDK some projects being configured with compiler.problem.forbiddenReference!=error I assume there are some more such project out there. And since that configuration is now even more dangerous, users should be informed about it.

Thanks for your reviews.

I'll submit this once the build is ready to have this included in tonight's I-build.

@HannesWell HannesWell merged commit 0c81951 into eclipse-pde:master May 18, 2026
19 checks passed
@HannesWell HannesWell deleted the check-classpath-access-rules branch May 18, 2026 19:38
hazendaz pushed a commit to spotbugs/spotbugs that referenced this pull request May 19, 2026
* Fix PDE "OSGi access" error introduced in 4.40 Eclipse

See eclipse-pde/eclipse.pde#2339

Fixes #4052

* Fix plugin build error in IDE on missing jakarta annotations

See 579746b change.

Fixes #4052

* Updated changelog for #4052
akurtakov added a commit to akurtakov/chemclipse that referenced this pull request May 21, 2026
PDE has a new warning
eclipse-pde/eclipse.pde#2339 that shows errors in the workspace.
akurtakov added a commit to akurtakov/chemclipse that referenced this pull request May 21, 2026
PDE has a new warning
eclipse-pde/eclipse.pde#2339 that shows errors in the workspace.
Mailaender pushed a commit to eclipse-chemclipse/chemclipse that referenced this pull request May 21, 2026
PDE has a new warning
eclipse-pde/eclipse.pde#2339 that shows errors in the workspace.
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