Skip to content

Feature/java26/jep522 - #366

Merged
AloisSeckar merged 5 commits into
AloisSeckar:masterfrom
Shivansh-22866:feature/java26/jep522
Aug 24, 2026
Merged

Feature/java26/jep522#366
AloisSeckar merged 5 commits into
AloisSeckar:masterfrom
Shivansh-22866:feature/java26/jep522

Conversation

@Shivansh-22866

@Shivansh-22866 Shivansh-22866 commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Fixes #359
Add "JEP 522: G1 GC: Improve Throughput by Reducing Synchronization" to JDK 26 demos

Copilot AI lite review requested due to automatic review settings August 20, 2026 18:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a new JDK 26 demo entry for JEP 522 (G1 GC: Improve Throughput by Reducing Synchronization), including a new IDemo implementation and wiring it into the Java 26 demo loader, plus updating the JDK 26 metadata list.

Changes:

  • Added ReduceSyncDemo for JEP 522 under org.javademos.java26.jep522.
  • Registered the new demo in Java26DemoLoader.
  • Appended JEP 522 metadata to JDK26Info.json.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
src/main/resources/JDK26Info.json Adds JEP 522 metadata to the JDK 26 info list.
src/main/java/org/javademos/java26/jep522/ReduceSyncDemo.java Introduces the new JEP 522 demo implementation and explanatory output.
src/main/java/org/javademos/init/Java26DemoLoader.java Registers the JEP 522 demo so it can be loaded and executed.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/main/resources/JDK26Info.json
Comment thread src/main/java/org/javademos/java26/jep522/ReduceSyncDemo.java Outdated
Comment thread src/main/java/org/javademos/init/Java26DemoLoader.java Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

It introduces several confirmed consistency/convention issues (ordering/formatting in the Java 26 loader and JDK26Info.json, plus a mismatched documentation link) that should be corrected before approval.

Review details

Suppressed comments (5)

Previously missed (5) — in code that hasn't changed since the last review.

src/main/resources/JDK26Info.json:16

  • JDK26Info.json entries are not ordered by JEP number and the new JEP 522 object also breaks the JSON formatting convention (missing space after "name": and inconsistent sentence punctuation in dscr). Other JDK*Info.json files keep entries in ascending JEP order and consistently format fields with a space after the colon.
  {
    "jep": 522,
    "jdk": 26,
    "name":"JEP 522 - G1 GC: Improve Throughput by Reducing Synchronization",
    "dscr": "Improve latency and throughput by reducing the amount of synchronization required between application threads and GC threads",
    "link": false,
    "code": false

src/main/java/org/javademos/init/Java26DemoLoader.java:19

  • loadDemos entries should be kept in ascending JEP order (as in the other Java*DemoLoader classes), but 526 is currently registered before 522.
    @Override
    public void loadDemos(Map<Integer, IDemo> demos) {
        demos.put(526, new LazyConstantsDemo());
        demos.put(522, new ReduceSyncDemo());
    }

src/main/java/org/javademos/init/Java26DemoLoader.java:8

  • Import grouping in Java26DemoLoader is inconsistent with other Java*DemoLoader files (they separate common commons imports from demo imports with a blank line).
import org.javademos.commons.IDemo;
import org.javademos.commons.IDemoLoader;
import org.javademos.java26.jep522.ReduceSyncDemo;
import org.javademos.java26.jep526.LazyConstantsDemo;

src/main/java/org/javademos/java26/jep522/ReduceSyncDemo.java:19

  • The header doc comment has trailing whitespace and links to the Java SE 25 G1 documentation even though this demo targets JDK 26. Other demos generally link to the corresponding JDK docs version (e.g., jep345 uses /javase/14/).
/// This JEP proposes to increase the application throughput
/// when using G1 garbage collector by reducing the amount of 
/// synchronization required between application threads 
/// and GC threads.
/// 
/// Further reading:
/// - [JEP 522: G1 GC: Improve Throughput by Reducing Synchronization](https://openjdk.org/jeps/522)
/// - [G1 Garbage Collector](https://docs.oracle.com/en/java/javase/25/gctuning/garbage-first-garbage-collector.html)
/// 

src/main/java/org/javademos/java26/jep522/ReduceSyncDemo.java:121

  • There are multiple consecutive blank lines at the end of demo(), which is inconsistent with the tighter formatting used in other demo classes and adds noise to diffs.
        System.out.println("\nJEP 522 improves G1 throughput by reducing synchronization.");
        System.out.println("Available in JDK 26+ with G1 GC.");
        System.out.println("G1 now uses two card tables to reduce write-barrier overhead.");


    }
  • Files reviewed: 3/3 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The JEP registries (JDK26Info.json and Java26DemoLoader) violate the established ascending-JEP ordering convention (and import grouping consistency), which should be fixed before approval.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details

Suppressed comments (1)

src/main/java/org/javademos/init/Java26DemoLoader.java:18

  • Java*DemoLoader classes keep demos.put(...) registrations in ascending JEP order (e.g., Java25DemoLoader). Here 526 is registered before 522, which breaks that convention.
        demos.put(526, new LazyConstantsDemo());
        demos.put(522, new ReduceSyncDemo());
  • Files reviewed: 3/3 changed files
  • Comments generated: 2
  • Review effort level: Lite

Comment thread src/main/resources/JDK26Info.json
Comment thread src/main/java/org/javademos/init/Java26DemoLoader.java

@AloisSeckar AloisSeckar left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Two small things to change (I cant make Copilot to do it itself)
Otherwise good, thank you

@@ -15,5 +15,6 @@ public class Java26DemoLoader implements IDemoLoader {
@Override
public void loadDemos(Map<Integer, IDemo> demos) {
demos.put(526, new LazyConstantsDemo());

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

The loading order should be ascending by JEP - 522 first, 526 second.

"code": true
},
{
"jep": 522,

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

The order of entries should be ascending - 522 first, 526 second

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Understood, I'll make a note of it

@AloisSeckar AloisSeckar added the hacktoberfest Counts as submission for Hacktoberfest 2025 label Aug 24, 2026
@AloisSeckar
AloisSeckar merged commit cd12e35 into AloisSeckar:master Aug 24, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hacktoberfest Counts as submission for Hacktoberfest 2025

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JEP 522 – G1 GC: Improve Throughput by Reducing Synchronization

3 participants