Feature/java26/jep522 - #366
Conversation
There was a problem hiding this comment.
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
ReduceSyncDemofor JEP 522 underorg.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.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🔵 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.jsonentries 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 indscr). OtherJDK*Info.jsonfiles 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
loadDemosentries should be kept in ascending JEP order (as in the otherJava*DemoLoaderclasses), 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
Java26DemoLoaderis inconsistent with otherJava*DemoLoaderfiles (they separate commoncommonsimports 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.,
jep345uses/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
There was a problem hiding this comment.
🟡 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*DemoLoaderclasses keepdemos.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
AloisSeckar
left a comment
There was a problem hiding this comment.
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()); | |||
There was a problem hiding this comment.
The loading order should be ascending by JEP - 522 first, 526 second.
| "code": true | ||
| }, | ||
| { | ||
| "jep": 522, |
There was a problem hiding this comment.
The order of entries should be ascending - 522 first, 526 second
There was a problem hiding this comment.
Understood, I'll make a note of it
Fixes #359
Add "JEP 522: G1 GC: Improve Throughput by Reducing Synchronization" to JDK 26 demos