RFR: 8365060: Historical data for JDK 8 should include the jdk.net package
Jan Lahoda
jlahoda at openjdk.org
Mon Aug 18 09:36:32 UTC 2025
On Mon, 18 Aug 2025 08:18:04 GMT, Jan Lahoda <jlahoda at openjdk.org> wrote:
> In JDK 8, the package `jdk.net` was exported and part of `rt.jar`, and hence should have been part of the historical data for `--release`, but it is not. The primary goal of this PR is to add historical data for `jdk.net` for JDK 8.
>
> The changes herein are based on JDK 8u462. I used the Probe running on JDK 8 to dump the classfiles, along these lines:
>
> $ java -classpath .../make/langtools/src/classes/ build.tools.symbolgenerator.Probe /tmp/jdk8-classfiles
>
>
> and then the up-to-date `CreateSymbols` to generate the `sym.txt` files, along these lines:
>
> java --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED CreateSymbols.java build-description-incremental-file .../src/jdk.compiler/share/data/symbols/symbols .../src/jdk.compiler/share/data/symbols/include.list 8 /tmp/jdk8-classfiles '<none>' --normalize-method-flags
>
>
> There are a few APIs that have been added for this release, and a few representational changes.
>
> Most notably - the ordering of "removal" entries (i.e. those that start with `-`) and "add" entries is much more strict in the current `CreateSymbols`, and so there are some changes where the removal entries are moved to the front. I went through those, and they seem OK to me.
>
> I'll add specific comments to the other updates to the files.
src/jdk.compiler/share/data/symbols/include.list line 270:
> 268: +com/sun/nio/sctp/
> 269: +jdk/
> 270: +jdk/net/
This is one of the main changes - whitelisting `jdk.net` for JDK 8.
src/jdk.compiler/share/data/symbols/java.base-8.sym.txt line 1714:
> 1712: field name MIAO descriptor Ljava/lang/Character$UnicodeBlock; flags 19
> 1713: field name ARABIC_MATHEMATICAL_ALPHABETIC_SYMBOLS descriptor Ljava/lang/Character$UnicodeBlock; flags 19
> 1714: field name CJK_UNIFIED_IDEOGRAPHS_EXTENSION_E descriptor Ljava/lang/Character$UnicodeBlock; flags 19
This field has been added as part of Java SE 8, MR 5.
src/jdk.compiler/share/data/symbols/java.base-8.sym.txt line 2082:
> 2080: field name NaN descriptor F constantValue NaN flags 19
> 2081: field name MAX_VALUE descriptor F constantValue 3.4028235E38 flags 19
> 2082: field name MIN_NORMAL descriptor F constantValue 1.1754944E-38 flags 19
I believe this is only a representational difference, without any real change to the value. Using:
public class Rep {
public static void main(String... args) {
System.out.println(Float.floatToIntBits(Float.parseFloat("1.17549435E-38")));
System.out.println(Float.floatToIntBits(Float.parseFloat("1.1754944E-38")));
if (Float.floatToIntBits(Float.parseFloat("1.17549435E-38")) ==
Float.floatToIntBits(Float.parseFloat("1.1754944E-38"))) {
System.out.println("The same.");
} else {
System.out.println("Not the same.");
}
}
}
I get the same on both JDK 8 and JDK 25:
8388608
8388608
The same.
Probably related to [JDK-4511638](https://bugs.openjdk.org/browse/JDK-4511638).
src/jdk.compiler/share/data/symbols/java.base-8.sym.txt line 3578:
> 3576: method name isEnqueued descriptor ()Z flags 1
> 3577: method name enqueue descriptor ()Z flags 1
> 3578: method name clone descriptor ()Ljava/lang/Object; thrownTypes java/lang/CloneNotSupportedException flags 4
This method has been added as part of Java SE 8, MR 4 (although I don't think it should have a real effect on compilation, as it is an override of the `j.l.Object` method).
src/jdk.compiler/share/data/symbols/java.base-9.sym.txt line 232:
> 230: field name SUTTON_SIGNWRITING descriptor Ljava/lang/Character$UnicodeBlock; flags 19
> 231: field name SUPPLEMENTAL_SYMBOLS_AND_PICTOGRAPHS descriptor Ljava/lang/Character$UnicodeBlock; flags 19
> 232: field name CJK_UNIFIED_IDEOGRAPHS_EXTENSION_E descriptor Ljava/lang/Character$UnicodeBlock; flags 19
The field is now part of JDK 8's data, but was not part of JDK 9, so it is removed.
src/jdk.compiler/share/data/symbols/java.desktop-8.sym.txt line 15617:
> 15615: method name getFormat descriptor ()Ljava/text/DecimalFormat; flags 1
> 15616: method name getModel descriptor ()Ljavax/swing/SpinnerNumberModel; flags 1
> 15617: method name setComponentOrientation descriptor (Ljava/awt/ComponentOrientation;)V flags 1
I believe this is only a new override of an existing method in the parent class.
src/jdk.compiler/share/data/symbols/jdk.management-8.sym.txt line 94:
> 92: method name isThreadAllocatedMemoryEnabled descriptor ()Z flags 401
> 93: method name setThreadAllocatedMemoryEnabled descriptor (Z)V flags 401
> 94: method name getCurrentThreadAllocatedBytes descriptor ()J flags 1
There's a handful of methods added in u282 (`getThreadInfo`, `dumpAllThreads` and `getCurrentThreadAllocatedBytes`) and in u412 (`getTotalThreadAllocatedBytes`). Given the other updates, it seems OK to keep those here.
src/jdk.compiler/share/data/symbols/jdk.management-9.sym.txt line 51:
> 49: class name com/sun/management/ThreadMXBean
> 50: header extends java/lang/Object implements java/lang/management/ThreadMXBean flags 601
> 51: -method name getCurrentThreadAllocatedBytes descriptor ()J
The methods were not part of JDK 9, so are removed here.
src/jdk.compiler/share/data/symbols/jdk.net-8.sym.txt line 1:
> 1: #
This is the main change here - adding `jdk.net` package for JDK 8 data.
src/jdk.compiler/share/data/symbols/jdk.net-8.sym.txt line 32:
> 30: header extends java/lang/Object flags 31 classAnnotations @Ljdk/Profile+Annotation;(value=I1) runtimeAnnotations @Ljdk/Exported;
> 31: field name SO_FLOW_SLA descriptor Ljava/net/SocketOption; flags 19 signature Ljava/net/SocketOption<Ljdk/net/SocketFlow;>;
> 32: field name TCP_KEEPIDLE descriptor Ljava/net/SocketOption; flags 19 signature Ljava/net/SocketOption<Ljava/lang/Integer;>;
The `TCP_*` have been added in u272.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26817#discussion_r2281642046
PR Review Comment: https://git.openjdk.org/jdk/pull/26817#discussion_r2281643586
PR Review Comment: https://git.openjdk.org/jdk/pull/26817#discussion_r2281666588
PR Review Comment: https://git.openjdk.org/jdk/pull/26817#discussion_r2281646775
PR Review Comment: https://git.openjdk.org/jdk/pull/26817#discussion_r2281667864
PR Review Comment: https://git.openjdk.org/jdk/pull/26817#discussion_r2281670866
PR Review Comment: https://git.openjdk.org/jdk/pull/26817#discussion_r2281834580
PR Review Comment: https://git.openjdk.org/jdk/pull/26817#discussion_r2281835318
PR Review Comment: https://git.openjdk.org/jdk/pull/26817#discussion_r2281839054
PR Review Comment: https://git.openjdk.org/jdk/pull/26817#discussion_r2281838225
More information about the compiler-dev
mailing list