@@ -344,17 +344,17 @@ private String getUniverseDomainFromMetadata() throws IOException {
344344
345345 /**
346346 * Retrieves the Google Cloud project ID from the Compute Engine (GCE) metadata server.
347- * <p>
348- * On its first successful execution, it fetches the project ID and caches it for the lifetime
347+ *
348+ * <p> On its first successful execution, it fetches the project ID and caches it for the lifetime
349349 * of the object. Subsequent calls will return the cached value without making additional network
350350 * requests.
351- * <p>
352- * If the request to the metadata server fails (e.g., due to network issues, or if the VM lacks
351+ *
352+ * <p> If the request to the metadata server fails (e.g., due to network issues, or if the VM lacks
353353 * the required service account permissions), the method will attempt to fall back to a default
354354 * project ID provider which could be {@code null}.
355355 *
356- * @return the GCP project ID string, or {@code null} if the metadata server is
357- * inaccessible and no fallback project ID can be determined.
356+ * @return the GCP project ID string, or {@code null} if the metadata server is inaccessible and
357+ * no fallback project ID can be determined.
358358 */
359359 @ Override
360360 public String getProjectId () {
@@ -376,11 +376,15 @@ private String getProjectIdFromMetadata() {
376376 HttpResponse response = getMetadataResponse (getProjectIdUrl (), RequestType .UNTRACKED , false );
377377 int statusCode = response .getStatusCode ();
378378 if (statusCode == HttpStatusCodes .STATUS_CODE_NOT_FOUND ) {
379- LoggingUtils .log (LOGGER_PROVIDER , Level .WARNING , Collections .emptyMap (), String .format (
380- "Error code %s trying to get project ID from"
381- + " Compute Engine metadata. This may be because the virtual machine instance"
382- + " does not have permission scopes specified." ,
383- statusCode ));
379+ LoggingUtils .log (
380+ LOGGER_PROVIDER ,
381+ Level .WARNING ,
382+ Collections .emptyMap (),
383+ String .format (
384+ "Error code %s trying to get project ID from"
385+ + " Compute Engine metadata. This may be because the virtual machine instance"
386+ + " does not have permission scopes specified." ,
387+ statusCode ));
384388 return super .getProjectId ();
385389 }
386390 if (statusCode != HttpStatusCodes .STATUS_CODE_OK ) {
@@ -403,7 +407,7 @@ private String getProjectIdFromMetadata() {
403407 String .format (
404408 "Unexpected Error: %s trying to get project ID"
405409 + " from Compute Engine metadata server. Reason: %s" ,
406- e .getMessage (), e .getCause ().toString ()));
410+ e .getMessage (), e .getCause ().toString ()));
407411 return super .getProjectId ();
408412 }
409413 }
0 commit comments