Note

Enhancement 8372746: Some httpserver files could be improved with formatting cleanup

I have tidied up inconsistent spacing around blank areas in multiple files of jdk.httpserver.

Overview#

There were several inconsistencies related to spaces in the jdk.httpserver package that had been lingering for a while. For example, there were instances where extra spaces appeared between method names and the opening parenthesis in method calls or constructors1.

return create (null, 0);

In most current Java code, these spaces are not included, so as part of this fix, we have adjusted it to look like this2:

return create(null, 0);

Additionally, we also tidied up places where there were no spaces after commas in the argument lists for @link in JavaDoc or after type arguments' commas, such as in Map<String,List<String>>. The changes primarily affected 36 files under com.sun.net.httpserver and sun.net.httpserver, which was a large but straightforward task3.

This PR only includes whitespace and formatting adjustments; there are no functional changes.

Discovered on JBS December 4, 2025#

The issue was discovered through JBS, and I reviewed files under the jdk.httpserver directory. In multiple files such as Authenticator, BasicAuthenticator, Filter, HttpServer, and ServerImpl, similar inconsistencies in spacing were found.

The correction strategy is as follows:

  1. Remove extra spaces between method names or constructor names and (.
  2. Add missing spaces after commas in JavaDoc links and type arguments.
  3. Do not unnecessarily alter intentional formatting that improves readability.

When creating the Pull Request, I clearly stated that it only involved adding/removing whitespace without any functional changes4.

Reviewed on December 9, 2025#

I received reviews from Mikael Vidstedt5, Michael McMahon6, Daniel Jeliński7, and Daniel Fuchs8.

Fuchs8 confirmed that the changes passed CI testing and were green. Both Jeliński7 and Fuchs8 approved the PR.

NOTE

It was fun to work with a team of reviewers like an Avengers squad.

Jaikiran Pai9 pointed out that I needed to update the copyright years for the modified files. Initially, I thought updating the year only happened when non-essential changes occurred, but it was explained to me that updates should reflect any kind of change.

As a result, I updated the copyright years in the affected files to 2025. Some additional missing updates were pointed out and addressed as well.

For files not touched by this PR with outdated copyright years, it was decided they would be updated when those files are modified in the future.

Integration Request on December 12, 2025#

Jaikiran9 approved the changes with "This looks good to me." Following that, /integrate was executed, and the change set b35243510 is now waiting for sponsorship.

Integrated on December 12, 2025#

Jaikiran9 reran CI tests to confirm there were no issues before sponsoring the changes with /sponsor. The final commit was 180d8c111, which integrated these changes into JDK.


Footnotes#

  1. 2
  2. 2 3
  3. 2 3