Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ASM Upgrade 9.7.1 with Java 24 Opcode support #542

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions org.eclipse.jdt.launching.javaagent/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.jdt.launching.javaagent;singleton:=true
Bundle-Version: 3.10.200.qualifier
Bundle-Version: 3.10.300.qualifier
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-11
Automatic-Module-Name: org.eclipse.jdt.launching.javaagent
Import-Package: org.objectweb.asm;version="[9.7.0,10.0.0)"
Import-Package: org.objectweb.asm;version="[9.7.1,10.0.0)"
4 changes: 2 additions & 2 deletions org.eclipse.jdt.launching.javaagent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@

<groupId>org.eclipse.jdt</groupId>
<artifactId>org.eclipse.jdt.launching.javaagent</artifactId>
<version>3.10.200-SNAPSHOT</version>
<version>3.10.300-SNAPSHOT</version>

<dependencies>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm</artifactId>
<version>9.7</version>
<version>9.7.1</version>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@
*******************************************************************************/
package org.eclipse.jdt.launching.internal.weaving;

import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassVisitor;
import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.Opcodes;
import org.eclipse.jdt.launching.internal.org.objectweb.asm.ClassReader;
Copy link
Contributor

Choose a reason for hiding this comment

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

where do these Classes come from?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was throwing some errors with existing imports, so did quick fix for that. should I revert that then ?

Copy link
Contributor

Choose a reason for hiding this comment

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

i wonder why it compiles on CI but not for me locally:
image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If possible could you try the same ? generating a new javaagent-shaded file, maybe I did some mistake while doing it..

Copy link
Contributor

Choose a reason for hiding this comment

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

probably... that jar is wrong:
image

Copy link
Contributor

Choose a reason for hiding this comment

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

when i create the jar it looks the same. Also Readme.md describes that
Note that ASM classes are _relocated_ to org.eclipse.jdt.launching.internal.org.objectweb.asm package to avoid possible conflicts with applicates being debugged.
however it should not change the source and i still don't get why the CI does not complain about it.

Copy link
Contributor

Choose a reason for hiding this comment

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

i guess org.eclipse.jdt.launching.javaagent is missing in pom.xml so that it is not compiled by CI

Copy link
Contributor Author

Choose a reason for hiding this comment

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

when i create the jar it looks the same. Also Readme.md describes that Note that ASM classes are _relocated_ to org.eclipse.jdt.launching.internal.org.objectweb.asm package to avoid possible conflicts with applicates being debugged. however it should not change the source and i still don't get why the CI does not complain about it.

so is it some issue with the jar ?

Copy link
Contributor Author

@SougandhS SougandhS Oct 21, 2024

Choose a reason for hiding this comment

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

Hi @jukzi, I have changed the imports to defaults now

import org.eclipse.jdt.launching.internal.org.objectweb.asm.ClassVisitor;
import org.eclipse.jdt.launching.internal.org.objectweb.asm.ClassWriter;
import org.eclipse.jdt.launching.internal.org.objectweb.asm.Opcodes;

public class ClassfileTransformer {

// must match JDIHelpers.STRATA_ID
private static final String STRATA_ID = "jdt"; //$NON-NLS-1$

/** max supported java class format major version, must match {@link #ASM_API} below **/
public static final int MAX_CLASS_MAJOR = Opcodes.V23;
public static final int MAX_CLASS_MAJOR = Opcodes.V24;

/** supported ASM API version, must match {@link #MAX_CLASS_MAJOR} above */
private static final int ASM_API = Opcodes.ASM9;
Expand Down
Binary file modified org.eclipse.jdt.launching/lib/javaagent-shaded.jar
Binary file not shown.
Loading