Skip to content

Conversation

@armsargis
Copy link
Contributor

@armsargis armsargis commented Sep 22, 2025

Updated org.ow2.asm:asm to version 9.8 for java 25 support and replace deprecated getNextTarEntry with getNextEntry

BEGIN_COMMIT_OVERRIDE
deps: update org.ow2.asm:asm to version 9.8 for java 25 support
END_COMMIT_OVERRIDE

Fixes #4417🛠️

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @armsargis, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on maintaining compatibility and modernizing API usage within the project. It updates a core dependency, org.ow2.asm:asm, to support upcoming Java versions, specifically Java 25. Concurrently, it addresses API deprecation by replacing an outdated method for reading TAR entries with its current equivalent across several files, ensuring the codebase remains up-to-date and free of warnings.

Highlights

  • Dependency Update: The org.ow2.asm:asm library has been updated from version 9.5 to 9.8 to ensure compatibility with Java 25.
  • Deprecated API Replacement: All instances of the deprecated getNextTarEntry() method from TarArchiveInputStream have been replaced with the modern getNextEntry() method across the codebase.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @armsargis, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request primarily focuses on maintaining compatibility and modernizing API usage. It updates a core dependency, org.ow2.asm:asm, to support upcoming Java versions, specifically Java 25. Concurrently, it addresses API deprecation by replacing an outdated method for reading TAR archive entries with its current equivalent, ensuring the codebase remains up-to-date and avoids potential issues with future library versions.

Highlights

  • Dependency Update: The org.ow2.asm:asm library has been updated from version 9.5 to 9.8 to ensure compatibility with Java 25.
  • Deprecated API Replacement: Instances of the deprecated getNextTarEntry() method from TarArchiveInputStream have been replaced with the modern getNextEntry() method across several files.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @armsargis, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request ensures the project remains compatible with the latest Java advancements by updating a critical bytecode manipulation dependency, org.ow2.asm:asm, to version 9.8 for Java 25 support. Additionally, it addresses API deprecations by replacing the getNextTarEntry() method with getNextEntry() in TarArchiveInputStream usage throughout the codebase, leading to cleaner and more up-to-date code.

Highlights

  • Dependency Update: The org.ow2.asm:asm library has been updated from version 9.5 to 9.8 to provide essential support for Java 25.
  • Deprecated API Replacement: All instances of the deprecated getNextTarEntry() method from TarArchiveInputStream have been replaced with the modern getNextEntry() method across several files, improving code hygiene and maintainability.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the org.ow2.asm:asm dependency to version 9.8 to add support for Java 25. It also replaces the deprecated getNextTarEntry() method with getNextEntry() across the codebase. The changes are correct and improve the code by using an up-to-date API. I have one suggestion to improve code consistency and readability.

Comment on lines +74 to +76
for (TarArchiveEntry entry = tarArchiveInputStream.getNextEntry();
entry != null;
entry = tarArchiveInputStream.getNextTarEntry()) {
entry = tarArchiveInputStream.getNextEntry()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

For consistency with other parts of the codebase and for better readability, this for loop can be converted to a while loop. The while ((entry = ...getNextEntry()) != null) pattern is more idiomatic for iterating through archive entries.

      TarArchiveEntry entry;
      while ((entry = tarArchiveInputStream.getNextEntry()) != null) {

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request correctly updates the org.ow2.asm:asm dependency to version 9.8, which adds support for Java 25. It also replaces the deprecated getNextTarEntry method with getNextEntry across the codebase. The changes are straightforward and well-executed. I have one minor suggestion to improve code consistency.

Comment on lines +74 to +76
for (TarArchiveEntry entry = tarArchiveInputStream.getNextEntry();
entry != null;
entry = tarArchiveInputStream.getNextTarEntry()) {
entry = tarArchiveInputStream.getNextEntry()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

For better readability and consistency with other parts of the codebase (e.g., ReproducibleImageTest.java), consider refactoring this for loop into a while loop. The while ((entry = ...)) {} pattern is more idiomatic in Java for this type of iteration.

      TarArchiveEntry entry;
      while ((entry = tarArchiveInputStream.getNextEntry()) != null) {

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the ASM dependency to version 9.8 to add support for Java 25 and replaces the deprecated getNextTarEntry method with getNextEntry. The changes are correct and follow the pull request's intent. I have one suggestion in TarExtractor.java to refactor a loop for better readability and consistency with the rest of the codebase.

Comment on lines +74 to +76
for (TarArchiveEntry entry = tarArchiveInputStream.getNextEntry();
entry != null;
entry = tarArchiveInputStream.getNextTarEntry()) {
entry = tarArchiveInputStream.getNextEntry()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

While this for loop is correct, it can be simplified into a more idiomatic while loop. This would also make it consistent with other parts of the codebase where TarArchiveInputStream is used (for example, in ReproducibleImageTest.java).

Consider refactoring this loop to:

      TarArchiveEntry entry;
      while ((entry = tarArchiveInputStream.getNextEntry()) != null) {
        // ... loop body
      }

@magiccrafter
Copy link

Could someone please review this and merge it? Thank you.

@atrujillofalcon
Copy link

Please don't abandon the project

@breun breun mentioned this pull request Oct 23, 2025
@diegomarquezp diegomarquezp merged commit 87b4c0e into GoogleContainerTools:master Oct 24, 2025
6 of 7 checks passed
@cailliaud
Copy link

Thank you @armsargis for the fix.
I can't wait to use it when the ##4427 will be released

@diegomarquezp diegomarquezp changed the title Updated org.ow2.asm:asm to version 9.8 for java 25 support Update org.ow2.asm:asm to version 9.8 for java 25 support Oct 27, 2025
@ML-Marco
Copy link
Contributor

ML-Marco commented Oct 29, 2025

@armsargis @diegomarquezp
This will not fully support Java 25. In Java 25 a main method is not required to be public any more.

See: https://docs.oracle.com/javase/specs/jls/se25/html/jls-12.html#jls-12.1.4

It has a single formal parameter (§8.4.1) whose declared type is an array of String, a void result, and public, protected or package access

This should be changed as well:

public MethodVisitor visitMethod(
int access, String name, String descriptor, String signature, String[] exceptions) {
if ((access & ~OPTIONAL_ACCESS) == (Opcodes.ACC_PUBLIC | Opcodes.ACC_STATIC)
&& name.equals("main")
&& descriptor.equals(MAIN_DESCRIPTOR)) {
visitedMainClass = true;
}
return null;
}
}

A main class can now look like this:

void main() {
    System.out.println("Hello, World!");
}

More details can also be found in JEP 512

Also, asm 9.9 is out by now and should be used.

@breun
Copy link
Contributor

breun commented Oct 29, 2025

@ML-Marco Since this pull request is already merged and closed, it might be a good idea to create a new issue (and optionally a pull request?) for adding support for the additional main method variants that Java 25 supports, and maybe a separate issue to update to ASM 9.9 is also a good idea.

I believe this pull request should already support existing code bases that upgrade to Java 25 from a previous Java version.

@diegomarquezp
Copy link
Contributor

Hi @ML-Marco. We do plan to support JEP 512 with the next release. As @breun mentioned, we will first make sure this supports upgrades to JDK 25.

@ML-Marco
Copy link
Contributor

@diegomarquezp
I opened a pr for it #4432
Maybe this can be included in the release.

@diegomarquezp diegomarquezp changed the title Update org.ow2.asm:asm to version 9.8 for java 25 support deps: update org.ow2.asm:asm to version 9.8 for java 25 support Nov 17, 2025
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.

Support java 25

8 participants