Skip to content

Commit 3bf31a3

Browse files
committed
Add support for Java 12 and 13; fix reading deprecated signatures for Java 13+ (simplify JRT FS usage)
1 parent 493a323 commit 3bf31a3

File tree

8 files changed

+1245
-3
lines changed

8 files changed

+1245
-3
lines changed

build.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@
6060
<equals arg1="${-cleaned.specification.version}" arg2="9"/>
6161
<equals arg1="${-cleaned.specification.version}" arg2="10"/>
6262
<equals arg1="${-cleaned.specification.version}" arg2="11"/>
63+
<equals arg1="${-cleaned.specification.version}" arg2="12"/>
64+
<equals arg1="${-cleaned.specification.version}" arg2="13"/>
6365
</or>
6466
</condition>
6567

@@ -153,6 +155,8 @@
153155
<equals arg1="${build.java.runtime}" arg2="9"/>
154156
<equals arg1="${build.java.runtime}" arg2="10"/>
155157
<equals arg1="${build.java.runtime}" arg2="11"/>
158+
<equals arg1="${build.java.runtime}" arg2="12"/>
159+
<equals arg1="${build.java.runtime}" arg2="13"/>
156160
</or>
157161
</condition>
158162

src/main/resources/de/thetaphi/forbiddenapis/signatures/jdk-deprecated-12.txt

Lines changed: 589 additions & 0 deletions
Large diffs are not rendered by default.

src/main/resources/de/thetaphi/forbiddenapis/signatures/jdk-deprecated-13.txt

Lines changed: 591 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# This file contains API signatures that are marked as internal in Java.
2+
# It is provided here for reference, but can easily regenerated by executing from the source folder of forbidden-apis:
3+
# $ ant generate-internal
4+
5+
# This file contains all internal packages listed in Security.getProperty("package.access") of Java version 12 (extracted from build 12).
6+
7+
@defaultMessage non-public internal runtime class in Java 12
8+
9+
sun.misc.**
10+
sun.reflect.**
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# This file contains API signatures that are marked as internal in Java.
2+
# It is provided here for reference, but can easily regenerated by executing from the source folder of forbidden-apis:
3+
# $ ant generate-internal
4+
5+
# This file contains all internal packages listed in Security.getProperty("package.access") of Java version 13 (extracted from build 13).
6+
7+
@defaultMessage non-public internal runtime class in Java 13
8+
9+
sun.misc.**
10+
sun.reflect.**
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# (C) Copyright Uwe Schindler (Generics Policeman) and others.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# These methods and classes should not be used by server classes (unsafe, no charset, no locale,...):
16+
17+
# We only include 11 for now.
18+
# TODO: Scan Java 12 API for additional locale/charset/... violations!
19+
@includeBundled jdk-unsafe-11
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# (C) Copyright Uwe Schindler (Generics Policeman) and others.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# These methods and classes should not be used by server classes (unsafe, no charset, no locale,...):
16+
17+
# We only include 12 for now.
18+
# TODO: Scan Java 13 API for additional locale/charset/... violations!
19+
@includeBundled jdk-unsafe-12

src/tools/groovy/generate-deprecated-java9.groovy

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ import java.nio.file.PathMatcher;
2424
import java.nio.file.SimpleFileVisitor;
2525
import java.nio.file.attribute.BasicFileAttributes;
2626

27-
new DeprecatedGen<URI>(properties['build.java.runtime'], URI.create("jrt:/modules/"), properties['deprecated.output.file'] as File) {
27+
new DeprecatedGen<URI>(properties['build.java.runtime'], URI.create("jrt:/"), properties['deprecated.output.file'] as File) {
2828
@Override
2929
protected void collectClasses(URI uri) throws IOException {
3030
Path modules = Paths.get(uri);
31-
PathMatcher fileMatcher = modules.getFileSystem().getPathMatcher("glob:java.**/*.class");
31+
PathMatcher fileMatcher = modules.getFileSystem().getPathMatcher("glob:/modules/java.**/*.class");
3232
Files.walkFileTree(modules, new SimpleFileVisitor<Path>() {
3333
@Override
3434
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
35-
if (fileMatcher.matches(modules.relativize(file))) {
35+
if (fileMatcher.matches(file)) {
3636
// System.out.println(file);
3737
Files.newInputStream(file).withStream { parseClass(it) };
3838
}

0 commit comments

Comments
 (0)