Skip to content

Security Manager API Removal #713

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

Merged
merged 7 commits into from
May 2, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions src/main/resources/META-INF/rewrite/java-version-25.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#
# Copyright 2024 the original author or authors.
# <p>
# Licensed under the Moderne Source Available License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# <p>
# https://docs.moderne.io/licensing/moderne-source-available-license
# <p>
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

---
type: specs.openrewrite.org/v1beta/recipe
name: org.openrewrite.java.migrate.UpgradeToJava25
displayName: Migrate to Java 25
description: >-
This recipe will apply changes commonly needed when migrating to Java 25. This recipe will also replace deprecated API
with equivalents when there is a clear migration strategy. Build files will also be updated to use Java 25 as the
target/source and plugins will be also be upgraded to versions that are compatible with Java 25.
tags:
- java25
recipeList:
- org.openrewrite.java.migrate.RemoveSecurityManagerAPI

---
type: specs.openrewrite.org/v1beta/recipe
name: org.openrewrite.java.migrate.RemoveSecurityManagerAPI
displayName: Remove Security Manager API
description: The Security Manager API is unsupported in Java 24. This recipe will remove the API and any usages of it.
tags:
- java25
preconditions:
- org.openrewrite.java.migrate.search.FindJavaVersion:
version: 24
recipeList:
- org.openrewrite.java.RemoveMethodInvocations:
methodPattern: java.security.AccessController#checkPermission(*)
- org.openrewrite.java.RemoveMethodInvocations:
methodPattern: import java.security.Policy#setPolicy(*)
- org.openrewrite.java.RemoveMethodInvocations:
methodPattern: import java.lang.SecurityManager#check*(*)
- org.openrewrite.staticanalysis.UnnecessaryCatch
- org.openrewrite.staticanalysis.UnnecessaryThrows
Loading