Skip to content

Conversation

@lahodaj
Copy link
Contributor

@lahodaj lahodaj commented Aug 18, 2025

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.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Change requires CSR request JDK-8366419 to be approved
  • Commit message must refer to an issue

Issues

  • JDK-8365060: Historical data for JDK 8 should include the jdk.net package (Bug - P4)
  • JDK-8366419: Historical data for JDK 8 should include the jdk.net package (CSR)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/26817/head:pull/26817
$ git checkout pull/26817

Update a local copy of the PR:
$ git checkout pull/26817
$ git pull https://git.openjdk.org/jdk.git pull/26817/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 26817

View PR using the GUI difftool:
$ git pr show -t 26817

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/26817.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Aug 18, 2025

👋 Welcome back jlahoda! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Aug 18, 2025

@lahodaj This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8365060: Historical data for JDK 8 should include the jdk.net package

Reviewed-by: shade, liach

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 660 new commits pushed to the master branch:

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk
Copy link

openjdk bot commented Aug 18, 2025

@lahodaj The following label will be automatically applied to this pull request:

  • compiler

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the compiler compiler-dev@openjdk.org label Aug 18, 2025
+com/sun/management/
+com/sun/nio/sctp/
+jdk/
+jdk/net/
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is one of the main changes - whitelisting jdk.net for JDK 8.

field name TAKRI descriptor Ljava/lang/Character$UnicodeBlock; flags 19
field name MIAO descriptor Ljava/lang/Character$UnicodeBlock; flags 19
field name ARABIC_MATHEMATICAL_ALPHABETIC_SYMBOLS descriptor Ljava/lang/Character$UnicodeBlock; flags 19
field name CJK_UNIFIED_IDEOGRAPHS_EXTENSION_E descriptor Ljava/lang/Character$UnicodeBlock; flags 19
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This field has been added as part of Java SE 8, MR 5.

method name clear descriptor ()V flags 1
method name isEnqueued descriptor ()Z flags 1
method name enqueue descriptor ()Z flags 1
method name clone descriptor ()Ljava/lang/Object; thrownTypes java/lang/CloneNotSupportedException flags 4
Copy link
Contributor Author

Choose a reason for hiding this comment

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

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).

field name NaN descriptor F constantValue NaN flags 19
field name MAX_VALUE descriptor F constantValue 3.4028235E38 flags 19
field name MIN_NORMAL descriptor F constantValue 1.17549435E-38 flags 19
field name MIN_NORMAL descriptor F constantValue 1.1754944E-38 flags 19
Copy link
Contributor Author

Choose a reason for hiding this comment

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

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.

field name ANATOLIAN_HIEROGLYPHS descriptor Ljava/lang/Character$UnicodeBlock; flags 19
field name SUTTON_SIGNWRITING descriptor Ljava/lang/Character$UnicodeBlock; flags 19
field name SUPPLEMENTAL_SYMBOLS_AND_PICTOGRAPHS descriptor Ljava/lang/Character$UnicodeBlock; flags 19
field name CJK_UNIFIED_IDEOGRAPHS_EXTENSION_E descriptor Ljava/lang/Character$UnicodeBlock; flags 19
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The field is now part of JDK 8's data, but was not part of JDK 9, so it is removed.

method name <init> descriptor (Ljavax/swing/JSpinner;Ljava/lang/String;)V flags 1
method name getFormat descriptor ()Ljava/text/DecimalFormat; flags 1
method name getModel descriptor ()Ljavax/swing/SpinnerNumberModel; flags 1
method name setComponentOrientation descriptor (Ljava/awt/ComponentOrientation;)V flags 1
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe this is only a new override of an existing method in the parent class.

method name isThreadAllocatedMemorySupported descriptor ()Z flags 401
method name isThreadAllocatedMemoryEnabled descriptor ()Z flags 401
method name setThreadAllocatedMemoryEnabled descriptor (Z)V flags 401
method name getCurrentThreadAllocatedBytes descriptor ()J flags 1
Copy link
Contributor Author

Choose a reason for hiding this comment

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

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.


class name com/sun/management/ThreadMXBean
header extends java/lang/Object implements java/lang/management/ThreadMXBean flags 601
-method name getCurrentThreadAllocatedBytes descriptor ()J
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The methods were not part of JDK 9, so are removed here.

class name jdk/net/ExtendedSocketOptions
header extends java/lang/Object flags 31 classAnnotations @Ljdk/Profile+Annotation;(value=I1) runtimeAnnotations @Ljdk/Exported;
field name SO_FLOW_SLA descriptor Ljava/net/SocketOption; flags 19 signature Ljava/net/SocketOption<Ljdk/net/SocketFlow;>;
field name TCP_KEEPIDLE descriptor Ljava/net/SocketOption; flags 19 signature Ljava/net/SocketOption<Ljava/lang/Integer;>;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The TCP_* have been added in u272.

@@ -0,0 +1,76 @@
#
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the main change here - adding jdk.net package for JDK 8 data.

@lahodaj lahodaj marked this pull request as ready for review August 18, 2025 09:31
@openjdk openjdk bot added the rfr Pull request is ready for review label Aug 18, 2025
@mlbridge
Copy link

mlbridge bot commented Aug 18, 2025

Webrevs

JavaFileObject file = new ByteArrayJavaFileObject(data.toByteArray());
try (InputStream in = new ByteArrayInputStream(data.toByteArray())) {
String name = ClassFile.of().parse(in.readAllBytes()).thisClass().name().stringValue();
String name = ClassFile.of().parse(in.readAllBytes()).thisClass().name().stringValue().replace("/", ".");
Copy link
Member

Choose a reason for hiding this comment

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

Good fix for lastIndexOf('.') below 👍

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Aug 18, 2025
Copy link
Member

@shipilev shipilev left a comment

Choose a reason for hiding this comment

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

(not an expert in this area at all, drive-by review)

Feels a bit awkward that lines jump within the single file, looks like the order is not stable? Can it be stabilized, or would it incur even more change in the symbol files?

out.write(Float.toHexString((Float) value));
} else {
out.write(String.valueOf(value));
if (value instanceof Character ch && Character.isSurrogate(ch)) {
Copy link
Member

Choose a reason for hiding this comment

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

Looks like one would want to match the style, and of else if, joining the if-chain above?

@lahodaj
Copy link
Contributor Author

lahodaj commented Aug 28, 2025

(not an expert in this area at all, drive-by review)

Feels a bit awkward that lines jump within the single file, looks like the order is not stable? Can it be stabilized, or would it incur even more change in the symbol files?

The problem is that these files are generated by a version of the tool that (lets say) more lenient in ordering. More specifically, it was willing to mix removals and additions, as long as the order of removals and additions for the same signature was correct (i.e. first removal and then addition). At some point, I think, it was causing unwelcome diffs, so we changed the tool to first do all removals, and then all additions. But, we didn't update existing files, as that would be unnecessary churn.

I.e., I'm afraid there are not too many sensible options.

@openjdk openjdk bot removed the ready Pull request is ready to be integrated label Aug 28, 2025
@shipilev
Copy link
Member

shipilev commented Aug 28, 2025

I.e., I'm afraid there are not too many sensible options.

Yeah. Just checking if anything easy was on the table, because this patch is going to be backported to at least some LTSes. I tried to patch --dry-run the current diff, and this was the result:

  • JDK 25u: Applies cleanly
  • JDK 21u: Applies with minor conflicts in src/jdk.compiler/share/data/symbols/symbols and test/langtools/tools/javac/sym/ElementStructureTest.java
  • JDK 17u: All the hunks fail, because JDK-8257733 moved stuff around
  • JDK 11u: Have not tried, I assume it is at least as bad as JDK 17u

So "superfluous" changes in data/symbols do not look like the practical problem, AFAICS.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Aug 28, 2025
@jddarcy
Copy link
Member

jddarcy commented Aug 29, 2025

/csr needed

@openjdk openjdk bot added the csr Pull request needs approved CSR before integration label Aug 29, 2025
@openjdk
Copy link

openjdk bot commented Aug 29, 2025

@jddarcy has indicated that a compatibility and specification (CSR) request is needed for this pull request.

@lahodaj please create a CSR request for issue JDK-8365060 with the correct fix version. This pull request cannot be integrated until the CSR request is approved.

@openjdk openjdk bot removed the ready Pull request is ready to be integrated label Aug 29, 2025
@openjdk openjdk bot added ready Pull request is ready to be integrated and removed csr Pull request needs approved CSR before integration labels Sep 25, 2025
@bridgekeeper
Copy link

bridgekeeper bot commented Sep 26, 2025

@lahodaj This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply issue a /touch or /keepalive command to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@lahodaj
Copy link
Contributor Author

lahodaj commented Sep 30, 2025

/integrate

@openjdk
Copy link

openjdk bot commented Sep 30, 2025

Going to push as commit 8606d3f.
Since your change was applied there have been 710 commits pushed to the master branch:

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Sep 30, 2025
@openjdk openjdk bot closed this Sep 30, 2025
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Sep 30, 2025
@openjdk
Copy link

openjdk bot commented Sep 30, 2025

@lahodaj Pushed as commit 8606d3f.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

compiler compiler-dev@openjdk.org integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

4 participants