Skip to content

Commit eddf39a

Browse files
committed
Replace IsEmpty() with .length() == 0
1 parent d97972b commit eddf39a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ private static String generateRemoteService(SpanData span) {
332332
String httpUrl = span.getAttributes().get(HTTP_URL);
333333
try {
334334
URL url = new URL(httpUrl);
335-
if (!url.getHost().isEmpty()) {
335+
if (url.getHost().length() != 0) {
336336
remoteService = url.getHost();
337337
if (url.getPort() != -1) {
338338
remoteService += ":" + url.getPort();
@@ -502,7 +502,7 @@ private static void setRemoteResourceTypeAndIdentifier(SpanData span, Attributes
502502
remoteResourceIdentifier = getDbConnection(span);
503503
}
504504

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

@@ -728,7 +728,7 @@ private static String getDBStatementRemoteOperation(
728728
}
729729

730730
Matcher matcher = SQL_DIALECT_PATTERN.matcher(remoteOperation.toUpperCase());
731-
if (matcher.find() && !matcher.group(0).isEmpty()) {
731+
if (matcher.find() && matcher.group(0).length() != 0) {
732732
remoteOperation = matcher.group(0);
733733
} else {
734734
remoteOperation = UNKNOWN_REMOTE_OPERATION;

0 commit comments

Comments
 (0)