This repository was archived by the owner on Apr 7, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
samples/snippets/src/main/java/com/example/spanner Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -39,8 +39,9 @@ public class MutableCredentialsExample {
3939 static void createClientWithMutableCredentials () throws IOException {
4040 final String credentialsPath = "location_of_service_account_credential_json" ;
4141 Path path = Paths .get (credentialsPath );
42- // Use an array to hold the mutable lastModifiedTime so it can be accessed in the lambda
43- FileTime [] lastModifiedTime = new FileTime [] {Files .getLastModifiedTime (path )};
42+ // Use an AtomicReference to hold the mutable lastModifiedTime so it can be accessed in the lambda
43+ final java .util .concurrent .atomic .AtomicReference <FileTime > lastModifiedTime =
44+ new java .util .concurrent .atomic .AtomicReference <>(Files .getLastModifiedTime (path ));
4445
4546 // 1 - create service account credentials
4647 ServiceAccountCredentials serviceAccountCredentials ;
You can’t perform that action at this time.
0 commit comments