Skip to content

Better fix for security manager test on Java 24#7699

Merged
jkwatson merged 2 commits into
open-telemetry:mainfrom
trask:security-manager-test
Sep 27, 2025
Merged

Better fix for security manager test on Java 24#7699
jkwatson merged 2 commits into
open-telemetry:mainfrom
trask:security-manager-test

Conversation

@trask

@trask trask commented Sep 23, 2025

Copy link
Copy Markdown
Member

Follow-up to #7679

@trask trask requested a review from a team as a code owner September 23, 2025 22:22
SunMiscProhibitedSecurityManager sm = new SunMiscProhibitedSecurityManager();
assertThatThrownBy(() -> sm.checkPackageAccess("sun.misc"))
.isInstanceOf(SecurityException.class);
.isInstanceOf(AccessControlException.class)

@breedx-splk breedx-splk Sep 23, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The javadoc for AccessControlException class say it was deprecated since 17 and is marked for removal, so we'll have to revisit eventually.

For other reviewers -- The AccessControlException is a more specific type of SecurityException.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

ya, this PR effectively rolls back the change I made in #7679

and is more explicit about when and why it fails

@breedx-splk breedx-splk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hmmm, it's failing on 21.

@codecov

codecov Bot commented Sep 24, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.12%. Comparing base (1e763b2) to head (40cde54).
⚠️ Report is 12 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #7699   +/-   ##
=========================================
  Coverage     90.12%   90.12%           
  Complexity     7187     7187           
=========================================
  Files           814      814           
  Lines         21700    21700           
  Branches       2123     2123           
=========================================
  Hits          19557    19557           
  Misses         1477     1477           
  Partials        666      666           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jkwatson jkwatson merged commit bc02a83 into open-telemetry:main Sep 27, 2025
29 checks passed
@trask trask deleted the security-manager-test branch October 20, 2025 17:27
the-clam pushed a commit to the-clam/opentelemetry-java that referenced this pull request Nov 6, 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.

4 participants