Skip to content

Reduce diffs to OpenJDK. - #186

Merged
cpovirk merged 3 commits into
mainfrom
undiff
Nov 19, 2026
Merged

cpovirk merged 3 commits into
mainfrom
undiff

Conversation

@cpovirk

@cpovirk cpovirk commented Nov 12, 2026

Copy link
Copy Markdown
Collaborator

The primary goal here is to make future merges easier. (I have had trouble in past merges that I traced to spurious diffs.)

Most of the changes are about removing whitespace that I had regrettably left behind when removing Checker-Framework-specific annotations from typetools/checker-framework.

There are other changes, too, including restoring the ThreadGroup.destroy() method that I'd removed in a prior bad merge. (This doesn't matter for nullness purposes, but it, too, could reduce the chances of problems in future merges.)

Gemini (which did the work) elaborates:

Summary of Changes

  1. Top-level files (3 files)

    • Removed Checker Framework leftovers azure-pipelines.yml and README-rewritten-jdk-history (git rm).
    • Reverted .gitignore to match openjdk/master.
  2. Merge-conflict restoration & CF leftovers

    • ThreadGroup.java: Restored the broken/commented-out destroy() Javadoc, @Deprecated(since="16", forRemoval=true), and public final void destroy() {} from openjdk/master, and removed its 3 @SuppressWarnings("index:array.access.unsafe.high") annotations.
    • Removed all remaining 38 leftover @SuppressWarnings(...) annotations across 14 files, reverted the modified @SuppressWarnings in EnumMap.java back to @SuppressWarnings("unchecked"), reverted the temporary result variable in ResourceBundle.java back to return sb.toString();, and removed the 2 CF comments in HashMap.java and ListIterator.java.
    • Removed all 18 leftover @Override annotations (AbstractCollection.java, PrimitiveIterator.java, and Thread.java).
    • Reverted all 7 explicit diamond type arguments in TemporalQueries.java back to new TemporalQuery<>().
  3. Unused & duplicate imports

    • Removed 98 unused org.jspecify.annotations imports (95 Nullable, 3 NonNull) while keeping the placement/surrounding blank lines of retained JSpecify imports unchanged.
    • Removed the duplicate import org.jspecify.annotations.Nullable; (and its extra blank line) at the top of AbstractChronology.java (keeping the grouped JSpecify imports further down the import block).
    • Removed the 4 unused non-JSpecify imports in InheritableThreadLocal.java, Reference.java, and UUID.java, and removed the duplicate import java.lang.ref.WeakReference; in WeakHashMap.java (restoring upstream import order).
  4. SQL postfix array annotations & CompletableFuture wraps & whitespace normalization

Verification

  • Exact token & whitespace verification vs openjdk/master across all 879 modified .java files:
    • 0 unchanged-token whitespace diffs
    • 0 inserted-region whitespace anomalies (outside kept JSpecify import placement)
    • 0 unused JSpecify imports
    • 0 non-JSpecify annotations added or removed (exact preserved counts: 4038 @Nullable, 578 @NullMarked, 43 @NonNull, 8 @NullUnmarked)
    • Only remaining non-annotation / non-import / non-extends Object hunks are the 25 intentional ones: module-info.java, Provider.java (3 ?>), Objects.java (J2CL overload), and the 20 intentional JSpecify comments.
  • Build: make jdk completed with exit code 0 (Finished building target 'jdk' in configuration 'linux-x86_64-server-release').

I tested the results with the same Javadoc-based methodology as in #179. I saw some changes in "auxiliary" files like the class-use files, but the only change to "actual Javadoc" I saw was in ThreadGroup, where destroy() returns, as expected.

The primary goal here is to make future merges easier. (I have had trouble in past merges that I traced to spurious diffs.)

Most of the changes are about removing whitespace that I had regrettably left behind when removing Checker-Framework-specific annotations from typetools/checker-framework.

There are other changes, too, including restoring the `ThreadGroup.destroy()` method that I'd removed in a prior bad merge. (This doesn't matter for nullness purposes, but it, too, could reduce the chances of problems in future merges.)

Gemini (which did the work) elaborates:

> ### Summary of Changes
>
> 1. **Top-level files (3 files)**
>    - Removed Checker Framework leftovers `azure-pipelines.yml` and `README-rewritten-jdk-history` (`git rm`).
>    - Reverted [.gitignore](https://github.com/jspecify/jdk/blob/main/.gitignore) to match `openjdk/master`.
>
> 2. **Merge-conflict restoration & CF leftovers**
>    - [ThreadGroup.java](https://github.com/jspecify/jdk/blob/main/src/java.base/share/classes/java/lang/ThreadGroup.java): Restored the broken/commented-out `destroy()` Javadoc, `@Deprecated(since="16", forRemoval=true)`, and `public final void destroy() {}` from `openjdk/master`, and removed its 3 `@SuppressWarnings("index:array.access.unsafe.high")` annotations.
>    - Removed all remaining 38 leftover `@SuppressWarnings(...)` annotations across 14 files, reverted the modified `@SuppressWarnings` in [EnumMap.java](https://github.com/jspecify/jdk/blob/main/src/java.base/share/classes/java/util/EnumMap.java) back to `@SuppressWarnings("unchecked")`, reverted the temporary `result` variable in [ResourceBundle.java](https://github.com/jspecify/jdk/blob/main/src/java.base/share/classes/java/util/ResourceBundle.java) back to `return sb.toString();`, and removed the 2 CF comments in [HashMap.java](https://github.com/jspecify/jdk/blob/main/src/java.base/share/classes/java/util/HashMap.java) and [ListIterator.java](https://github.com/jspecify/jdk/blob/main/src/java.base/share/classes/java/util/ListIterator.java).
>    - Removed all 18 leftover `@Override` annotations ([AbstractCollection.java](https://github.com/jspecify/jdk/blob/main/src/java.base/share/classes/java/util/AbstractCollection.java), [PrimitiveIterator.java](https://github.com/jspecify/jdk/blob/main/src/java.base/share/classes/java/util/PrimitiveIterator.java), and [Thread.java](https://github.com/jspecify/jdk/blob/main/src/java.base/share/classes/java/lang/Thread.java)).
>    - Reverted all 7 explicit diamond type arguments in [TemporalQueries.java](https://github.com/jspecify/jdk/blob/main/src/java.base/share/classes/java/time/temporal/TemporalQueries.java) back to `new TemporalQuery<>()`.
>
> 3. **Unused & duplicate imports**
>    - Removed 98 unused `org.jspecify.annotations` imports (95 `Nullable`, 3 `NonNull`) while keeping the placement/surrounding blank lines of retained JSpecify imports unchanged.
>    - Removed the duplicate `import org.jspecify.annotations.Nullable;` (and its extra blank line) at the top of [AbstractChronology.java](https://github.com/jspecify/jdk/blob/main/src/java.base/share/classes/java/time/chrono/AbstractChronology.java#L62-L64) (keeping the grouped JSpecify imports further down the import block).
>    - Removed the 4 unused non-JSpecify imports in [InheritableThreadLocal.java](https://github.com/jspecify/jdk/blob/main/src/java.base/share/classes/java/lang/InheritableThreadLocal.java), [Reference.java](https://github.com/jspecify/jdk/blob/main/src/java.base/share/classes/java/lang/ref/Reference.java), and [UUID.java](https://github.com/jspecify/jdk/blob/main/src/java.base/share/classes/java/util/UUID.java), and removed the duplicate `import java.lang.ref.WeakReference;` in [WeakHashMap.java](https://github.com/jspecify/jdk/blob/main/src/java.base/share/classes/java/util/WeakHashMap.java) (restoring upstream import order).
>
> 4. **SQL postfix array annotations & `CompletableFuture` wraps & whitespace normalization**
>    - Standardized [CallableStatement.java](https://github.com/jspecify/jdk/blob/main/src/java.sql/share/classes/java/sql/CallableStatement.java#L974) (`setBytes`) and [ResultSet.java](https://github.com/jspecify/jdk/blob/main/src/java.sql/share/classes/java/sql/ResultSet.java#L2099) (`updateBytes`) to `byte x @nullable []`.
>    - Undid all 9 line-wrap/unwrap diffs in both directions in [CompletableFuture.java](https://github.com/jspecify/jdk/blob/main/src/java.base/share/classes/java/util/concurrent/CompletableFuture.java).
>    - Normalized 2,776 unchanged-token whitespace gaps, 147 gaps around `@Nullable`/`@NonNull` (including tabs in Swing/AWT parameter lists and trailing-space newlines in [Attributes.java](https://github.com/jspecify/jdk/blob/main/src/java.naming/share/classes/javax/naming/directory/Attributes.java#L102) and [NamespaceContext.java](https://github.com/jspecify/jdk/blob/main/src/java.xml/share/classes/javax/xml/namespace/NamespaceContext.java#L207)), 69 gaps around `@NullMarked`, and `extends  Object` in [ConcurrentHashMap.java](https://github.com/jspecify/jdk/blob/main/src/java.base/share/classes/java/util/concurrent/ConcurrentHashMap.java).
>
> ### Verification
>
> - **Exact token & whitespace verification vs `openjdk/master`** across all 879 modified `.java` files:
>   - `0` unchanged-token whitespace diffs
>   - `0` inserted-region whitespace anomalies (outside kept JSpecify import placement)
>   - `0` unused JSpecify imports
>   - `0` non-JSpecify annotations added or removed (exact preserved counts: `4038` `@Nullable`, `578` `@NullMarked`, `43` `@NonNull`, `8` `@NullUnmarked`)
>   - Only remaining non-annotation / non-import / non-`extends Object` hunks are the 25 intentional ones: [module-info.java](https://github.com/jspecify/jdk/blob/main/src/java.base/share/classes/module-info.java#L138), [Provider.java](https://github.com/jspecify/jdk/blob/main/src/java.base/share/classes/java/security/Provider.java#L573) (3 `?>`), [Objects.java](https://github.com/jspecify/jdk/blob/main/src/java.base/share/classes/java/util/Objects.java#L70) (J2CL overload), and the 20 intentional JSpecify comments.
> - **Build**: `make jdk` completed with exit code `0` (`Finished building target 'jdk' in configuration 'linux-x86_64-server-release'`).

I tested the results with the same Javadoc-based methodology as in #179. I saw some changes in "auxiliary" files like the `class-use` files, but the only change to "actual Javadoc" I saw was in `ThreadGroup`, where `destroy()` returns, as expected.
@cpovirk

cpovirk commented Nov 12, 2026

Copy link
Copy Markdown
Collaborator Author

(Sorry, this wasn't even the PR that I said I had in progress, just something that I thought to run by Gemini yesterday. As usual, no rush at all.)

@cpovirk
cpovirk merged commit 1213cd4 into main Nov 19, 2026
8 checks passed
@cpovirk
cpovirk deleted the undiff branch November 19, 2026 03:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants