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