From 81bdf008ec106252b1c2a1b60449c98dd8213d1b Mon Sep 17 00:00:00 2001 From: Markus Heiden Date: Mon, 16 May 2022 19:00:45 +0200 Subject: [PATCH] Optimize creation of Optional --- .../java/com/google/ads/googleads/v10/utils/ErrorUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/google-ads-stubs-v10/src/main/java/com/google/ads/googleads/v10/utils/ErrorUtils.java b/google-ads-stubs-v10/src/main/java/com/google/ads/googleads/v10/utils/ErrorUtils.java index d6977ae67a..2f88656d6c 100644 --- a/google-ads-stubs-v10/src/main/java/com/google/ads/googleads/v10/utils/ErrorUtils.java +++ b/google-ads-stubs-v10/src/main/java/com/google/ads/googleads/v10/utils/ErrorUtils.java @@ -36,7 +36,7 @@ public ErrorPath createErrorPath( return new ErrorPath( error, pathElement.getFieldName(), - Optional.ofNullable(pathElement.hasIndex() ? (long) pathElement.getIndex() : null)); + pathElement.hasIndex() ? Optional.of(pathElement.getIndex()) : Optional.empty()); } @Override