Skip to content

Introduce org.eclipse.jdt.launching.javaagent25, a new javaagent module - #994

Open
SougandhS wants to merge 1 commit into
eclipse-jdt:masterfrom
SougandhS:MigrateToClassFileApi
Open

SougandhS wants to merge 1 commit into
eclipse-jdt:masterfrom
SougandhS:MigrateToClassFileApi

Conversation

@SougandhS

@SougandhS SougandhS commented Sep 7, 2026 •

Copy link
Copy Markdown
Member

Module uses the JDK 25's built-in java.lang.classfile API for
SMAP/SourceDebugExtension injection. The Classfile API always supports
its own JDK's class format, removing the need to update an ASM version
ceiling for each new Java release. The existing
org.eclipse.jdt.launching.javaagent module (ASM-based) is unchanged and
continues to be used for debuggees running below Java 25."

Also require eclipse-jdt/eclipse.jdt#169

What it does

How to test

Author checklist

@SougandhS
SougandhS force-pushed the MigrateToClassFileApi branch from f897032 to fa3d973 Compare September 7, 2026 10:02
@SougandhS SougandhS changed the title [Experiment] [WIP] Replace ASM with JVM Classfile API in Advanced Source Lookup agent for Java 25+ [Exp] [WIP] Replace ASM with JVM Classfile API in Advanced Source Lookup agent for Java 25+ Sep 7, 2026
@SougandhS SougandhS changed the title [Exp] [WIP] Replace ASM with JVM Classfile API in Advanced Source Lookup agent for Java 25+ [Exp] Replace ASM with JVM Classfile API in Advanced Source Lookup agent for Java 25+ Sep 7, 2026

@iloveeclipse iloveeclipse left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If I see it right, this would restrict debuggee to Java 25+. However, we still want debug Java 8 applications.

@SougandhS

SougandhS commented Sep 7, 2026 •

Copy link
Copy Markdown
Member Author

If I see it right, this would restrict debuggee to Java 25+. However, we still want debug Java 8 applications.

it still uses old ASM based javaagent for < 25

@SougandhS
SougandhS force-pushed the MigrateToClassFileApi branch 3 times, most recently from 583f3a5 to b7e0754 Compare September 10, 2026 01:43
@mpalat

mpalat commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

If I see it right, this would restrict debuggee to Java 25+. However, we still want debug Java 8 applications.

it still uses old ASM based javaagent for < 25

We had discussed about moving from ASM in PMC last week - and also on a possibility of our own (JDT) Disassembler instead of ASM.

For a similar work @SougandhS : also please have a look at this too: eclipse-pde/eclipse.pde#2477 (comment)

@mpalat

mpalat commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

@SougandhS - as we briefly discussed offline, let us not shift to ClassFile APIs completely. Let's use the classfile APIs for 25 and keep the ASM implementation (and dependency) as it is. Let's continue this model for sometime and see how it goes and then take a call after a few releases. This middle level transition would make sure that we have minimal disruption for our customers/upline products. I would let others (@iloveeclipse ?) weigh in here as well. Thanks!

@SougandhS

Copy link
Copy Markdown
Member Author

@SougandhS - as we briefly discussed offline, let us not shift to ClassFile APIs completely. Let's use the classfile APIs for 25 and keep the ASM implementation (and dependency) as it is.

We'll create a new module for this
eg. org.eclipse.jdt.launching.ClassFileJavaAgent

@mpalat

mpalat commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

@SougandhS - see also: eclipse-jdt/eclipse.jdt.core#5418

@SougandhS
SougandhS force-pushed the MigrateToClassFileApi branch from b7e0754 to db6f6e1 Compare September 21, 2026 02:20
@SougandhS SougandhS changed the title [Exp] Replace ASM with JVM Classfile API in Advanced Source Lookup agent for Java 25+ Introduce org.eclipse.jdt.launching.javaagent25, a new javaagent module Sep 21, 2026
@SougandhS
SougandhS force-pushed the MigrateToClassFileApi branch 2 times, most recently from 01492a1 to cf83804 Compare September 21, 2026 03:51
@SougandhS

Copy link
Copy Markdown
Member Author

Hi @iloveeclipse, can you re-check this new implementation ?

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.

Copilot review overview

🟡 Changes recommended

The public agent argument API regresses to returning a path, and SMAP payloads use the wrong UTF-8 encoding.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 1 High severity · 1 Medium severity

Open (2)
What changed in this PR

Introduces a Java 25+ advanced-source-lookup agent using the JDK Class-File API while retaining the ASM agent for older JVMs.

Changes:

  • Adds and packages the Java 25 agent.
  • Selects the agent based on the configured JVM.
  • Updates stratum testing for Java 25+.
File Description
AdvancedSourceLookup.java Updates agent lookup delegation.
AbstractJavaLaunchConfigurationDelegate.java Selects agents per launch configuration.
AdvancedSourceLookupSupport.java Adds JVM-version-based agent selection.
build.properties Packages the new agent JAR.
ClassfileTransformer2.java Injects SMAP using the Class-File API.
Premain.java Registers the new transformer.
README.md Documents building and usage.
pom.xml Configures the Java 25 agent build.
META-INF/​MANIFEST.MF Defines module metadata.
.settings/​org.eclipse.jdt.ui.prefs Adds UI preferences.
.settings/​org.eclipse.jdt.core.prefs Configures Java 25 compilation.
.settings/​org.eclipse.core.resources.prefs Sets project encoding.
.project Defines the Eclipse project.
.classpath Configures Java 25 dependencies.
StratumTests.java Adjusts expectations for Java 25+.

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

@SougandhS
SougandhS force-pushed the MigrateToClassFileApi branch 3 times, most recently from a8c3bf2 to 42a3126 Compare September 21, 2026 07:57
@SougandhS

Copy link
Copy Markdown
Member Author

Co-pilot review comments addressed 👍

@SougandhS
SougandhS force-pushed the MigrateToClassFileApi branch from 42a3126 to 1f5a2c4 Compare September 24, 2026 10:05
@SougandhS

Copy link
Copy Markdown
Member Author

@iloveeclipse I have added this as an optional dependency as suggested
Change also requires : eclipse-jdt/eclipse.jdt#169

With these changes I made a local sdk build and was working fine on mac 👍
Below 25
image

Above 25
image

Jar is now build on eclipse sdk build

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

Copilot review overview

🟡 Changes recommended

The JavaSE-25 carrier bundle cannot reliably be installed on older supported Eclipse host runtimes, and agent selection lacks effective coverage.

Review effort: Balanced
Findings: 2 Medium severity · 1 Low severity

Open (3)

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.

Copilot review overview

🟡 Changes recommended

The new bundle does not package the repository-standard about.html legal notice.

Review effort: Balanced
Findings: 1 Low severity

Open (1)
Resolved since last review (3)

@SougandhS
SougandhS force-pushed the MigrateToClassFileApi branch 2 times, most recently from 73572f3 to 6ccdee6 Compare October 1, 2026 14:08
@SougandhS
SougandhS requested a balanced review from Copilot October 1, 2026 14:08

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.

Copilot review overview

🟡 Changes recommended

Modified UTF-8 encoding currently fails for valid SourceDebugExtension payloads exceeding 65,535 bytes.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
Resolved since last review (1)

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.

Copilot review overview

🔵 Needs a closer look

Runtime bytecode transformation and cross-repository packaging integration warrant final human validation.

Review effort: Balanced
Findings: None

Resolved since last review (1)

@SougandhS
SougandhS requested a review from iloveeclipse October 1, 2026 14:34
@SougandhS

Copy link
Copy Markdown
Member Author

@iloveeclipse Can you have a look at the current state ?
Also requires : eclipse-jdt/eclipse.jdt#169

Module uses the JDK 25's built-in java.lang.classfile API for
SMAP/SourceDebugExtension injection. The Classfile API always supports
its own JDK's class format, removing the need to update an ASM version
ceiling for each new Java release. The existing
org.eclipse.jdt.launching.javaagent module (ASM-based) is unchanged and
continues to be used for debuggees running below Java 25."
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.

4 participants