Skip to content

Commit 409d1d4

Browse files
harrryrmxiamxia
andauthored
Switch isEmpty() to .isPresent() for Optionals Type (#939)
*Issue #, if available:* Main-build Enablement E2E tests started failing starting from this [PR](#899). It was due to the usage of `isEmpty()` for Optional datatypes, which is available only from Java 11 *Description of changes:* Change .isEmpty() to .isPresent() for optional types By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. Co-authored-by: Min Xia <xiami@amazon.com>
1 parent e4e5725 commit 409d1d4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

awsagentprovider/src/main/java/software/amazon/opentelemetry/javaagent/providers/AwsMetricAttributeGenerator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ private static void setRemoteResourceTypeAndIdentifier(SpanData span, Attributes
502502
remoteResourceIdentifier = getDbConnection(span);
503503
}
504504

505-
if (cloudformationPrimaryIdentifier.isEmpty()) {
505+
if (!cloudformationPrimaryIdentifier.isPresent()) {
506506
cloudformationPrimaryIdentifier = remoteResourceIdentifier;
507507
}
508508

0 commit comments

Comments
 (0)