Skip to content

Commit d589a2b

Browse files
committed
java doc, logs
1 parent 6893598 commit d589a2b

File tree

2 files changed

+22
-5
lines changed

2 files changed

+22
-5
lines changed

utils/src/main/java/software/amazon/awssdk/utils/uri/SdkURI.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import java.net.URI;
1919
import java.net.URISyntaxException;
2020
import java.util.Objects;
21+
import org.slf4j.event.Level;
2122
import software.amazon.awssdk.annotations.SdkProtectedApi;
2223
import software.amazon.awssdk.utils.Logger;
2324
import software.amazon.awssdk.utils.cache.lru.LruCache;
@@ -132,11 +133,13 @@ private boolean isAccountIdUri(String s) {
132133
}
133134

134135
private void logCacheUsage(boolean containsKey, URI uri) {
135-
log.trace(() -> "URI cache size: " + cache.size());
136-
if (containsKey) {
137-
log.trace(() -> "Using cached uri for " + uri.toString());
138-
} else {
139-
log.trace(() -> "Cache empty for " + uri.toString());
136+
if (log.isLoggingLevelEnabled(Level.TRACE)) {
137+
log.trace(() -> "URI cache size: " + cache.size());
138+
if (containsKey) {
139+
log.trace(() -> "Using cached uri for " + uri.toString());
140+
} else {
141+
log.trace(() -> "Cache empty for " + uri.toString());
142+
}
140143
}
141144
}
142145

utils/src/main/java/software/amazon/awssdk/utils/uri/internal/UriConstructorArgs.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,21 @@
1818
import java.net.URI;
1919
import software.amazon.awssdk.annotations.SdkInternalApi;
2020

21+
/**
22+
* Represent the different constructor to the URI class used by the SDK. Implementation of this interface are able to create new
23+
* URIs based on the different arguments passed to classes to them.
24+
*
25+
* @see URI#create(String)
26+
* @see URI#URI(String, String, String, String, String)
27+
* @see URI#URI(String, String, String, int, String, String, String)
28+
*/
2129
@SdkInternalApi
2230
public interface UriConstructorArgs {
31+
32+
/**
33+
* Creates a new instance of the URI. Can return a new instance everytime it is called.
34+
*
35+
* @return a new URI instance
36+
*/
2337
URI newInstance();
2438
}

0 commit comments

Comments
 (0)