Skip to content

Commit

Permalink
chore: prepare showcase for Graal SDK 23.x (#3574)
Browse files Browse the repository at this point in the history
### Approach
Register `java.time.Instant` to the reflection configuration of gax-grpc
(see [grpc code interacting with this
class](grpc/grpc-java#11604))

This comes from a behavior change in Graal for JDK 22, which introduced
a new class initialization strategy called strict image heap, which is
[enforced by default since
then](https://www.graalvm.org/release-notes/JDK_22/).


### Proof:
```
com.google.showcase.v1beta1.EchoClientTest > blockExceptionTest SUCCESSFUL


Test run finished after 95953 ms
[        30 containers found      ]
[         0 containers skipped    ]
[        30 containers started    ]
[         0 containers aborted    ]
[        30 containers successful ]
[         0 containers failed     ]
[       337 tests found           ]
[         1 tests skipped         ]
[       336 tests started         ]
[         0 tests aborted         ]
[       336 tests successful      ]
[         0 tests failed          ]

[INFO]
[INFO] --- jacoco:0.8.12:report (report) @ gapic-showcase ---
[INFO] Loading execution data file /usr/local/google/home/diegomarquezp/google/sdk-platform-java/showcase/gapic-showcase/target/jacoco.exec
[INFO] Analyzed bundle 'GAPIC Showcase Client' with 125 classes
[WARNING] Classes in bundle 'GAPIC Showcase Client' do not match with execution data. For report generation the same class files must be used as at runtime.
[WARNING] Execution data for class com/google/showcase/v1beta1/stub/HttpJsonSequenceServiceStub does not match.
[WARNING] Execution data for class com/google/showcase/v1beta1/stub/HttpJsonMessagingCallableFactory does not match.
[WARNING] Execution data for class com/google/showcase/v1beta1/stub/HttpJsonSequenceServiceCallableFactory does not match.
[WARNING] Execution data for class com/google/showcase/v1beta1/stub/HttpJsonTestingCallableFactory does not match.
[WARNING] Execution data for class com/google/showcase/v1beta1/stub/HttpJsonTestingStub does not match.
[WARNING] Execution data for class com/google/showcase/v1beta1/stub/HttpJsonMessagingStub does not match.
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for GAPIC Showcase Client Core Parent 0.0.1-SNAPSHOT:
[INFO]
[INFO] GAPIC Showcase Client Core Parent .................. SUCCESS [  1.709 s]
[INFO] proto-gapic-showcase-v1beta1 ....................... SUCCESS [  0.900 s]
[INFO] grpc-gapic-showcase-v1beta1 ........................ SUCCESS [  0.385 s]
[INFO] GAPIC Showcase Client .............................. SUCCESS [05:29 min]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  05:34 min
[INFO] Finished at: 2025-01-20T19:04:42Z
[INFO] ------------------------------------------------------------------------
```
  • Loading branch information
diegomarquezp authored Jan 24, 2025
1 parent 65a0f11 commit 540c8e5
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ private static void loadGrpcNettyClasses(BeforeAnalysisAccess access) {
private static void loadMiscClasses(BeforeAnalysisAccess access) {
registerClassHierarchyForReflection(access, "com.google.protobuf.DescriptorProtos");
registerClassForReflection(access, "com.google.api.FieldBehavior");

registerClassForReflection(access, "java.time.Instant");
registerForUnsafeFieldAccess(access, "javax.net.ssl.SSLContext", "contextSpi");
}
}

0 comments on commit 540c8e5

Please sign in to comment.