Skip to content
Merged

1 #2

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
821e202
Fix typo in Javadoc in SymbolTable
izeye Apr 16, 2025
b88d42f
Add support of Java 26
forax Jun 7, 2025
45ca91b
Merge branch 'update-classfile-version-to-java-26' into 'master'
forax Jun 17, 2025
dfefb0b
Use "Visits" instead of "Visit" in the javadoc of the methods to be c…
forax Jun 23, 2025
ef39aeb
Merge branch 'Use-Visits-instead-of-Visit-in-ModuleViaitor-doc' into …
forax Jun 23, 2025
d7e149f
Merge branch 'typo' into 'master'
forax Jun 23, 2025
e75e722
Update Sonar Gradle plugin to latest version.
ebruneton Jun 23, 2025
2ce241a
Do not filter out ACC_SUPER when printing the raw access flags of inn…
ebruneton Jun 29, 2025
d2ab6fc
Merge branch '318028-fix-textifier-innerclass-accessflags' into 'master'
ebruneton Jun 29, 2025
0b34604
Use 'sha-1' algorithm instead of 'sha'.
ebruneton Jul 6, 2025
d4c2464
Merge branch '318032-use-more-specific-sha-version' into 'master'
ebruneton Jul 6, 2025
ad4dc0f
Add a new mapInvokeDynamicMethodName method.
ebruneton Aug 31, 2025
d9813a9
Improve `How to Contribute` in README.md
Karlatemp Sep 13, 2025
3f12198
Merge branch 'patch-1' into 'master'
ebruneton Sep 13, 2025
ea4c6f1
Merge branch 'new-map-invokedynamicmethodname-method' into 'master'
ebruneton Sep 15, 2025
1eda731
Add a jdk8.AllLambdas test case and fix two missing ASM API checks fo…
ebruneton Sep 21, 2025
bf4c0ed
Merge branch '318034-add-precompiled-jdk8-all-lambdas-test' into 'mas…
ebruneton Sep 21, 2025
c911d6d
Update ASM version.
ebruneton Oct 4, 2025
124a450
Support remapping lambda
Karlatemp Oct 19, 2025
f07fd88
Merge branch 'lambda-remap' into 'master'
ebruneton Oct 19, 2025
142cd79
Include only the Java files for Sonar analysis, as a workaround for a…
ebruneton Oct 19, 2025
829f942
Tweak SonarQube configuration.
ebruneton Oct 26, 2025
bcbb529
Enable Gradle logs for the Sonar job.
ebruneton Oct 26, 2025
2613153
Test using artifacts to share outputs between stages.
ebruneton Oct 26, 2025
db1cf8d
Attempt to fix Gradle CI build error.
ebruneton Oct 26, 2025
9a92389
New attempt to fix Gradle CI build error.
ebruneton Oct 26, 2025
176f616
Add forRemoval=false in @Deprecated annotations. Also fix other issue…
ebruneton Oct 26, 2025
3f11dd7
Fix code smells found with SonarQube.
ebruneton Nov 2, 2025
ec9f0b2
Fix OOM error when reading invalid class.
ebruneton Nov 30, 2025
fc36273
Merge branch '318036-fix-oom-error' into 'master'
ebruneton Nov 30, 2025
f389709
Provide an upper bound on Import-Package
jonahgraham Dec 6, 2025
f36870e
Merge branch 'version-upper' into 'master'
ebruneton Dec 6, 2025
4e6de6c
Update version to 9.9.1 for new minor release.
ebruneton Dec 6, 2025
c9d66aa
Update to next release version number.
ebruneton Dec 6, 2025
a2b4d18
Merge branch 'master' into 1
aaaapai Dec 20, 2025
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
10 changes: 8 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,17 @@ build-job:
stage: build
script:
- $GRADLE build
artifacts:
untracked: true
expire_in: 1 hour

test-job:
stage: test
script:
- $GRADLE test jacocoTestCoverageVerification
- $GRADLE --info test jacocoTestCoverageVerification jacocoTestReport
artifacts:
untracked: true
expire_in: 1 hour

deploy-job:
stage: deploy
Expand All @@ -32,4 +38,4 @@ sonar-job:
stage: deploy
allow_failure: true
script:
- if [ $SONAR_LOGIN ]; then $GRADLE -Dorg.gradle.jvmargs='-XX:MetaspaceSize=1024M -XX:MaxMetaspaceSize=1024M' jacocoTestReport sonar -Dsonar.host.url=$SONAR -Dsonar.login=${SONAR_LOGIN}; fi
- if [ $SONAR_LOGIN ]; then $GRADLE --info -Dorg.gradle.jvmargs='-XX:MetaspaceSize=1024M -XX:MaxMetaspaceSize=1024M' sonar -Dsonar.host.url=$SONAR -Dsonar.token=${SONAR_LOGIN}; fi
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ with [googleJavaFormat](https://github.com/google/google-java-format),
[Checkstyle](https://checkstyle.sourceforge.io)
and [PMD](https://pmd.github.io).

To fix code formatting errors, you can run the reformat task:

```shell
./gradle/gradlew spotlessApply
```

For more details, see the [Developer Guide](https://asm.ow2.io/developer-guide.html)

## Reporting Issues

If you encounter any issues with the ASM project, please create a new issue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.Opcodes;
import org.objectweb.asm.test.AsmTest;
import org.objectweb.asm.test.AsmTest.PrecompiledClass;
import org.objectweb.asm.tree.ClassNode;
import org.objectweb.asm.tree.MethodNode;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ void testAnalyze_classNotFound() {
}

@Test
void testAnalyze_mergeStackFrames() throws AnalyzerException {
void testAnalyze_mergeStackFrames() {
Label loopLabel = new Label();
MethodNode methodNode =
new MethodNodeBuilder(1, 4)
Expand Down Expand Up @@ -223,7 +223,7 @@ void testAnalyze_mergeStackFrames() throws AnalyzerException {
}

@Test
void testAnalyze_mergeStackFramesWithExceptionHandlers() throws AnalyzerException {
void testAnalyze_mergeStackFramesWithExceptionHandlers() {
Label startTry0Label = new Label();
Label endTry0Label = new Label();
Label catch0Label = new Label();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ MethodNodeBuilder nop() {
}

MethodNodeBuilder push() {
methodNode.visitInsn(Opcodes.ICONST_0);
return this;
return iconst_0();
}

MethodNodeBuilder pop() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ void testIterator_next_noSuchElement() {
iterator.next();
iterator.next();

Executable next = () -> iterator.next();
Executable next = iterator::next;

assertThrows(NoSuchElementException.class, next);
}
Expand All @@ -159,7 +159,7 @@ void testIterator_remove() {
Iterator<Object> iterator = newSmallSet(ELEMENT1, ELEMENT2).iterator();
iterator.next();

assertThrows(UnsupportedOperationException.class, () -> iterator.remove());
assertThrows(UnsupportedOperationException.class, iterator::remove);
}

private static SmallSet<Object> newSmallSet(final Object element1, final Object element2) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public class AnnotationRemapper extends AnnotationVisitor {
* @param remapper the remapper to use to remap the types in the visited annotation.
* @deprecated use {@link #AnnotationRemapper(String, AnnotationVisitor, Remapper)} instead.
*/
@Deprecated
@Deprecated(forRemoval = false)
public AnnotationRemapper(final AnnotationVisitor annotationVisitor, final Remapper remapper) {
this(/* descriptor= */ null, annotationVisitor, remapper);
}
Expand Down Expand Up @@ -85,7 +85,7 @@ public AnnotationRemapper(
* @param remapper the remapper to use to remap the types in the visited annotation.
* @deprecated use {@link #AnnotationRemapper(int, String, AnnotationVisitor, Remapper)} instead.
*/
@Deprecated
@Deprecated(forRemoval = false)
protected AnnotationRemapper(
final int api, final AnnotationVisitor annotationVisitor, final Remapper remapper) {
this(api, /* descriptor= */ null, annotationVisitor, remapper);
Expand Down Expand Up @@ -153,7 +153,7 @@ public AnnotationVisitor visitArray(final @Identifier String name) {
* @return the newly created remapper.
* @deprecated use {@link #createAnnotationRemapper(String, AnnotationVisitor)} instead.
*/
@Deprecated
@Deprecated(forRemoval = false)
protected AnnotationVisitor createAnnotationRemapper(final AnnotationVisitor annotationVisitor) {
return new AnnotationRemapper(api, /* descriptor= */ null, annotationVisitor, remapper);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ protected MethodVisitor createMethodRemapper(final MethodVisitor methodVisitor)
* @return the newly created remapper.
* @deprecated use {@link #createAnnotationRemapper(String, AnnotationVisitor)} instead.
*/
@Deprecated
@Deprecated(forRemoval = false)
protected AnnotationVisitor createAnnotationRemapper(final AnnotationVisitor annotationVisitor) {
return new AnnotationRemapper(api, /* descriptor= */ null, annotationVisitor, remapper);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public AnnotationVisitor visitTypeAnnotation(
* @return the newly created remapper.
* @deprecated use {@link #createAnnotationRemapper(String, AnnotationVisitor)} instead.
*/
@Deprecated
@Deprecated(forRemoval = false)
protected AnnotationVisitor createAnnotationRemapper(final AnnotationVisitor annotationVisitor) {
return new AnnotationRemapper(api, /* descriptor= */ null, annotationVisitor, remapper);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,9 @@ public void visitInvokeDynamicInsn(
final @MethodDescriptor String descriptor,
final Handle bootstrapMethodHandle,
final Object... bootstrapMethodArguments) {
if (api < Opcodes.ASM5) {
throw new UnsupportedOperationException("This feature requires ASM5");
}
invokedynamic(name, descriptor, bootstrapMethodHandle, bootstrapMethodArguments);
}

Expand Down Expand Up @@ -1074,8 +1077,8 @@ public void putfield(final @InternalForm String owner, final @Identifier String
* @param descriptor the method's descriptor (see {@link Type}).
* @deprecated use {@link #invokevirtual(String, String, String, boolean)} instead.
*/
@Deprecated
public void invokevirtual(final @InternalForm String owner, final @Identifier String name, final @MethodDescriptor String descriptor) {
@Deprecated(forRemoval = false)
public void invokevirtual(final String owner, final String name, final String descriptor) {
if (api >= Opcodes.ASM5) {
invokevirtual(owner, name, descriptor, false);
return;
Expand Down Expand Up @@ -1113,8 +1116,8 @@ public void invokevirtual(
* @param descriptor the method's descriptor (see {@link Type}).
* @deprecated use {@link #invokespecial(String, String, String, boolean)} instead.
*/
@Deprecated
public void invokespecial(final @InternalForm String owner, final @Identifier String name, final @MethodDescriptor String descriptor) {
@Deprecated(forRemoval = false)
public void invokespecial(final String owner, final String name, final String descriptor) {
if (api >= Opcodes.ASM5) {
invokespecial(owner, name, descriptor, false);
return;
Expand Down Expand Up @@ -1152,8 +1155,8 @@ public void invokespecial(
* @param descriptor the method's descriptor (see {@link Type}).
* @deprecated use {@link #invokestatic(String, String, String, boolean)} instead.
*/
@Deprecated
public void invokestatic(final @InternalForm String owner, final @Identifier String name, final @MethodDescriptor String descriptor) {
@Deprecated(forRemoval = false)
public void invokestatic(final String owner, final String name, final String descriptor) {
if (api >= Opcodes.ASM5) {
invokestatic(owner, name, descriptor, false);
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,17 +175,26 @@ public void visitMethodInsn(
}

@Override
@SuppressWarnings("deprecation")
public void visitInvokeDynamicInsn(
final String name,
final @MethodDescriptor String descriptor,
final Handle bootstrapMethodHandle,
final Object... bootstrapMethodArguments) {
String remappedName;
if (remapper.api == 0) {
remappedName = remapper.mapInvokeDynamicMethodName(name, descriptor);
} else {
remappedName =
remapper.mapInvokeDynamicMethodName(
name, descriptor, bootstrapMethodHandle, bootstrapMethodArguments);
}
Object[] remappedBootstrapMethodArguments = new Object[bootstrapMethodArguments.length];
for (int i = 0; i < bootstrapMethodArguments.length; ++i) {
remappedBootstrapMethodArguments[i] = remapper.mapValue(bootstrapMethodArguments[i]);
}
super.visitInvokeDynamicInsn(
remapper.mapInvokeDynamicMethodName(name, descriptor),
remappedName,
remapper.mapMethodDesc(descriptor),
(Handle) remapper.mapValue(bootstrapMethodHandle),
remappedBootstrapMethodArguments);
Expand Down Expand Up @@ -274,7 +283,7 @@ public AnnotationVisitor visitLocalVariableAnnotation(
* @return the newly created remapper.
* @deprecated use {@link #createAnnotationRemapper(String, AnnotationVisitor)} instead.
*/
@Deprecated
@Deprecated(forRemoval = false)
protected AnnotationVisitor createAnnotationRemapper(final AnnotationVisitor annotationVisitor) {
return new AnnotationRemapper(api, /* descriptor= */ null, annotationVisitor, remapper);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public AnnotationVisitor visitTypeAnnotation(
* @return the newly created remapper.
* @deprecated use {@link #createAnnotationRemapper(String, AnnotationVisitor)} instead.
*/
@Deprecated
@Deprecated(forRemoval = false)
protected AnnotationVisitor createAnnotationRemapper(final AnnotationVisitor annotationVisitor) {
return new AnnotationRemapper(api, /* descriptor= */ null, annotationVisitor, remapper);
}
Expand Down
Loading
Loading