Skip to content

AbstractFutureTest adding clinit test#8416

Closed
MarcoLe3 wants to merge 4 commits intogoogle:masterfrom
MarcoLe3:master
Closed

AbstractFutureTest adding clinit test#8416
MarcoLe3 wants to merge 4 commits intogoogle:masterfrom
MarcoLe3:master

Conversation

@MarcoLe3
Copy link
Copy Markdown
Contributor

@MarcoLe3 MarcoLe3 commented May 9, 2026

Summary:

Added a test case "testAssertNoClinit()" inside AbstractFutureTest.java which gathers the stream of "AbstractFuture".class and coverts into Bytes then parsed. Later loops all methods to find if class used does not contain a static initializer . This test uses java.lang.classfile API (JDK 25). Ensuring AbstractFutureTest.java can be loaded without effects from static block and reducing potential deadlocks.

Note: Included @SuppressWarnings("Java8ApiChecker") to allow the use of modern APIs within the Java 8-aligned test suite.

@imports

import com.google.common.io.ByteStreams;
import java.lang.classfile.ClassFile;
import java.lang.classfile.ClassModel;
import java.lang.classfile.MethodModel;

References

I used this link for reference for the test case:
https://docs.oracle.com/en/java/javase/23/docs/api/java.base/java/lang/classfile/package-summary.html

MarcoLe3 and others added 4 commits May 7, 2026 16:12
…oops through all methods in AbstractFuture and see if theres a static initalizer.
…oops through all methods in AbstractFuture and see if theres a static initalizer.
Added a test case "testAssertNoClinit()" inside AbstractFutureTest.java which gathers the stream of "AbstractFuture".class and coverts into Bytes then parsed. Later loops all methods to find if class used does not contain a static initializer <clinit>. This test uses java.lang.classfile API (JDK 25). Ensuring AbstractFutureTest.java can be loaded without effects from static block and reducing potential deadlocks.

Note: Included @SuppressWarnings("Java8ApiChecker") to allow the use of modern APIs within the Java 8-aligned test suite.
@cpovirk cpovirk self-assigned this May 9, 2026
@cpovirk cpovirk added package=concurrent type=other Miscellaneous activities not covered by other type= labels P2 labels May 9, 2026
copybara-service Bot pushed a commit that referenced this pull request May 10, 2026
Fixes #8416
Fixes #8412

RELNOTES=n/a
PiperOrigin-RevId: 912816502
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 package=concurrent type=other Miscellaneous activities not covered by other type= labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants