Skip to content

Commit 3b58688

Browse files
laurittrask
andauthored
Apply suggestions from code review
Co-authored-by: Trask Stalnaker <[email protected]>
1 parent 12de0ba commit 3b58688

File tree

12 files changed

+20
-20
lines changed

12 files changed

+20
-20
lines changed

instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/internal/Experimental.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public static <REQUEST> void setUrlTemplateExtractor(
5555
}
5656
}
5757

58-
@SuppressWarnings({"rawtypes", "unchecked"}) // we loose the generic type information
58+
@SuppressWarnings({"rawtypes", "unchecked"}) // we lose the generic type information
5959
public static <REQUEST> void internalSetUrlTemplateExtractor(
6060
BiConsumer<HttpSpanNameExtractorBuilder<REQUEST>, Function<REQUEST, String>>
6161
urlTemplateExtractorSetter) {
@@ -76,7 +76,7 @@ public static <REQUEST, RESPONSE> void addOperationListenerAttributesExtractor(
7676
}
7777
}
7878

79-
@SuppressWarnings({"rawtypes", "unchecked"}) // we loose the generic type information
79+
@SuppressWarnings({"rawtypes", "unchecked"}) // we lose the generic type information
8080
public static <REQUEST, RESPONSE> void internalAddOperationListenerAttributesExtractor(
8181
BiConsumer<
8282
InstrumenterBuilder<REQUEST, RESPONSE>,

instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/internal/RuntimeVirtualFieldSupplier.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ private static final class CacheBasedVirtualFieldSupplier implements VirtualFiel
5151
ownerToFieldToImplementationMap = Cache.weak();
5252

5353
@Override
54-
// storing VirtualField instances in a map looses the generic types
54+
// storing VirtualField instances in a map loses the generic types
5555
@SuppressWarnings("unchecked")
5656
public <U extends T, V extends F, T, F> VirtualField<U, V> find(
5757
Class<T> type, Class<F> fieldType) {

instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/internal/ServiceLoaderUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public final class ServiceLoaderUtil {
1818

1919
private ServiceLoaderUtil() {}
2020

21-
// we loose the generic type information because of using the loader function
21+
// we lose the generic type information because of using the loader function
2222
@SuppressWarnings("unchecked")
2323
public static <T> Iterable<T> load(Class<T> clazz) {
2424
return (Iterable<T>) loadFunction.apply(clazz);

instrumentation/grpc-1.6/library/src/main/java/io/opentelemetry/instrumentation/grpc/v1_6/TracingClientInterceptor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ final class TracingClientInterceptor implements ClientInterceptor {
3737
private static final String SENT = "SENT";
3838
private static final String RECEIVED = "RECEIVED";
3939

40-
@SuppressWarnings("rawtypes") // AtomicLongFieldUpdater.newUpdate looses generic type
40+
@SuppressWarnings("rawtypes") // AtomicLongFieldUpdater.newUpdate loses generic type
4141
private static final AtomicLongFieldUpdater<TracingClientCall> SENT_MESSAGE_ID_UPDATER =
4242
AtomicLongFieldUpdater.newUpdater(TracingClientCall.class, "sentMessageId");
4343

44-
@SuppressWarnings("rawtypes") // AtomicLongFieldUpdater.newUpdate looses generic type
44+
@SuppressWarnings("rawtypes") // AtomicLongFieldUpdater.newUpdate loses generic type
4545
private static final AtomicLongFieldUpdater<TracingClientCall> RECEIVED_MESSAGE_ID_UPDATER =
4646
AtomicLongFieldUpdater.newUpdater(TracingClientCall.class, "receivedMessageId");
4747

instrumentation/grpc-1.6/library/src/main/java/io/opentelemetry/instrumentation/grpc/v1_6/TracingServerInterceptor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ final class TracingServerInterceptor implements ServerInterceptor {
3737
private static final String SENT = "SENT";
3838
private static final String RECEIVED = "RECEIVED";
3939

40-
@SuppressWarnings("rawtypes") // AtomicLongFieldUpdater.newUpdate looses generic type
40+
@SuppressWarnings("rawtypes") // AtomicLongFieldUpdater.newUpdate loses generic type
4141
private static final AtomicLongFieldUpdater<TracingServerCall> SENT_MESSAGE_ID_UPDATER =
4242
AtomicLongFieldUpdater.newUpdater(TracingServerCall.class, "sentMessageId");
4343

44-
@SuppressWarnings("rawtypes") // AtomicLongFieldUpdater.newUpdate looses generic type
44+
@SuppressWarnings("rawtypes") // AtomicLongFieldUpdater.newUpdate loses generic type
4545
private static final AtomicLongFieldUpdater<TracingServerCall> RECEIVED_MESSAGE_ID_UPDATER =
4646
AtomicLongFieldUpdater.newUpdater(TracingServerCall.class, "receivedMessageId");
4747

instrumentation/jedis/jedis-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jedis/JedisRequestContext.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public static <T> void endIfNotAttached(
5353
}
5454
}
5555

56-
@SuppressWarnings("unchecked") // we loose the generic type in ThreadLocal
56+
@SuppressWarnings("unchecked") // we lose the generic type in ThreadLocal
5757
private static <T> JedisRequestContext<T> current() {
5858
return (JedisRequestContext<T>) contextThreadLocal.get();
5959
}

instrumentation/opentelemetry-api/opentelemetry-api-1.50/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/opentelemetryapi/v1_50/incubator/logs/ApplicationLogRecordBuilder150Incubator.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public <T> ExtendedLogRecordBuilder setAttribute(AttributeKey<T> key, @Nullable
117117
}
118118

119119
@Override
120-
@SuppressWarnings("unchecked") // converting ExtendedAttributeKey looses generic type
120+
@SuppressWarnings("unchecked") // converting ExtendedAttributeKey loses generic type
121121
public <T> ExtendedLogRecordBuilder setAttribute(ExtendedAttributeKey<T> key, T value) {
122122
io.opentelemetry.api.incubator.common.ExtendedAttributeKey<T> agentKey =
123123
convertExtendedAttributeKey(key);
@@ -140,7 +140,7 @@ public ExtendedLogRecordBuilder setException(Throwable throwable) {
140140
@SuppressWarnings({
141141
"unchecked",
142142
"rawtypes"
143-
}) // converting ExtendedAttributeKey looses generic type
143+
}) // converting ExtendedAttributeKey loses generic type
144144
private static io.opentelemetry.api.incubator.common.ExtendedAttributes convertExtendedAttributes(
145145
ExtendedAttributes applicationAttributes) {
146146
io.opentelemetry.api.incubator.common.ExtendedAttributesBuilder agentAttributes =
@@ -159,7 +159,7 @@ private static io.opentelemetry.api.incubator.common.ExtendedAttributes convertE
159159
return agentAttributes.build();
160160
}
161161

162-
@SuppressWarnings("rawtypes") // converting ExtendedAttributeKey looses generic type
162+
@SuppressWarnings("rawtypes") // converting ExtendedAttributeKey loses generic type
163163
private static io.opentelemetry.api.incubator.common.ExtendedAttributeKey
164164
convertExtendedAttributeKey(ExtendedAttributeKey applicationKey) {
165165
switch (applicationKey.getType()) {

instrumentation/resources/library/src/main/java/io/opentelemetry/instrumentation/resources/AttributeResourceProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ private AttributeBuilder() {}
3737

3838
@CanIgnoreReturnValue
3939
@Override
40-
@SuppressWarnings({"unchecked", "rawtypes"}) // we loose generic types when storing in map
40+
@SuppressWarnings({"unchecked", "rawtypes"}) // we lose generic types when storing in map
4141
public <T> AttributeBuilder add(AttributeKey<T> key, Function<D, Optional<T>> getter) {
4242
attributeGetters.put((AttributeKey) key, Objects.requireNonNull((Function) getter));
4343
return this;

instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/internal/properties/SpringConfigProperties.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ public Double getDouble(String name) {
193193
otelSdkProperties.getDouble(name));
194194
}
195195

196-
@SuppressWarnings("unchecked") // reading list form environment looses generic type
196+
@SuppressWarnings("unchecked") // reading list form environment loses generic type
197197
@Override
198198
public List<String> getList(String name) {
199199
String normalizedName = ConfigUtil.normalizeEnvironmentVariableKey(name);
@@ -224,7 +224,7 @@ public Duration getDuration(String name) {
224224
.getDuration(name);
225225
}
226226

227-
@SuppressWarnings("unchecked") // reading map looses generic type
227+
@SuppressWarnings("unchecked") // reading map loses generic type
228228
@Override
229229
public Map<String, String> getMap(String name) {
230230
Map<String, String> otelSdkMap = otelSdkProperties.getMap(name);

instrumentation/undertow-1.4/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/undertow/UndertowHelper.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public void exchangeCompleted(Context context, HttpServerExchange exchange) {
6767
}
6868
}
6969

70-
@SuppressWarnings("unchecked") // we loose type info with attachments
70+
@SuppressWarnings("unchecked") // we lose type info with attachments
7171
@Nullable
7272
public Context getServerContext(HttpServerExchange exchange) {
7373
AttachmentKey<Context> contextKey =
@@ -78,7 +78,7 @@ public Context getServerContext(HttpServerExchange exchange) {
7878
return exchange.getAttachment(contextKey);
7979
}
8080

81-
@SuppressWarnings("unchecked") // we loose type info with attachments
81+
@SuppressWarnings("unchecked") // we lose type info with attachments
8282
private static void attachServerContext(Context context, HttpServerExchange exchange) {
8383
AttachmentKey<Context> contextKey =
8484
(AttachmentKey<Context>)

0 commit comments

Comments
 (0)