GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||
GeezerVison is showing github.com — fix(bigtable): allow non-default service accounts for session DirectAccess by sushanb · Pull Request #14926 · googleapis/google-cloud-java Conversation
|
| setStaticField( | ||
| InstantiatingGrpcChannelProvider.class, "systemProductName", "Google Compute Engine"); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Modifying static final fields (like systemProductName in InstantiatingGrpcChannelProvider) via reflection is highly fragile and will fail on modern JDKs (Java 12+ / Java 17+). In Java 12+, the JDK blocks modifying static final fields via reflection, throwing an IllegalAccessException. Additionally, strong encapsulation in Java 17+ will throw InaccessibleObjectException when attempting to access private fields of classes in other modules/packages without explicit --add-opens JVM arguments. Consider avoiding tests that rely on modifying GAX's internal static final fields. Since buildDirectAccessProvider is already unit-tested, we can rely on those assertions rather than trying to simulate a GCE environment by hacking GAX internals.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| private static Object getField(Object instance, String fieldName) throws Exception { | ||
| Field field = instance.getClass().getDeclaredField(fieldName); | ||
| field.setAccessible(true); | ||
| return field.get(instance); | ||
| } |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Using reflection to access private fields of InstantiatingGrpcChannelProvider (which resides in the GAX library) will fail with InaccessibleObjectException on Java 17+ due to strong encapsulation, unless explicit --add-opens JVM arguments are provided to the test runner. Since these are internal implementation details of GAX, relying on them makes the tests fragile to GAX updates. If public getters are not available, consider if these assertions are strictly necessary or if they can be verified through other public behaviors/side-effects.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
35496b3 to
44af920
Compare
44af920 to
026bfed
Compare
There was an error while loading. Please reload this page.
🤖 I have created a release *beep* *boop* --- <details><summary>1.96.0</summary> ## [1.96.0](v1.95.0...v1.96.0) (2026-11-05) ### Features * **gax:** wire-level changes for resuming uploads ([#14870](#14870)) ([956ac4d](956ac4d)) ### Bug Fixes * **bigquery-jdbc:** preserve civil digits for DATETIME/DATE ([#14910](#14910)) ([53bbde0](53bbde0)) * **bigquery:** handle empty queryParameters list in ConnectionImpl ([#14917](#14917)) ([cfea223](cfea223)) * **bigtable:** allow non-default service accounts for session DirectAccess ([#14926](#14926)) ([9f4a76a](9f4a76a)) </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --------- Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.