diff --git a/build.gradle b/build.gradle index 9bc7436c7e4..210e24b3f17 100644 --- a/build.gradle +++ b/build.gradle @@ -2,7 +2,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { id 'com.google.osdetector' version '1.6.2' apply false - // If you want to change `org.jetbrains.kotlin.jvm` version, + // If you want to change `org.jetbrains.kotlin.jvm` version, // you also need to change `org.jetbrains.kotlin:kotlin-allopen` version in `dependencies.yml`. id 'org.jetbrains.kotlin.jvm' version '1.3.72' apply false } diff --git a/core/src/main/java/com/linecorp/armeria/client/RefreshingAddressResolver.java b/core/src/main/java/com/linecorp/armeria/client/RefreshingAddressResolver.java index 93ec2400e8d..dd12d43fafb 100644 --- a/core/src/main/java/com/linecorp/armeria/client/RefreshingAddressResolver.java +++ b/core/src/main/java/com/linecorp/armeria/client/RefreshingAddressResolver.java @@ -327,7 +327,7 @@ public void run() { servedFromCache = false; numAttemptsSoFar = 1; - if (entry.address().equals(address) && entry.ttlMillis() == ttlMillis) { + if (address.equals(entry.address()) && entry.ttlMillis() == ttlMillis) { scheduleRefresh(ttlMillis); } else { // Replace the old entry with the new one. diff --git a/core/src/main/java/com/linecorp/armeria/common/MediaType.java b/core/src/main/java/com/linecorp/armeria/common/MediaType.java index 9875a1ae0f4..8f74f814343 100644 --- a/core/src/main/java/com/linecorp/armeria/common/MediaType.java +++ b/core/src/main/java/com/linecorp/armeria/common/MediaType.java @@ -1214,6 +1214,7 @@ private static final class KnownTypesByString { .distinct() .collect(toImmutableMap(MediaType::toString, Function.identity(), (a, b) -> a)); + @Nullable static MediaType get(String input) { return KNOWN_TYPES_BY_STRING.get(input); } diff --git a/core/src/main/java/com/linecorp/armeria/internal/common/DefaultTimeoutController.java b/core/src/main/java/com/linecorp/armeria/internal/common/DefaultTimeoutController.java index c93049108eb..a653baf42db 100644 --- a/core/src/main/java/com/linecorp/armeria/internal/common/DefaultTimeoutController.java +++ b/core/src/main/java/com/linecorp/armeria/internal/common/DefaultTimeoutController.java @@ -269,6 +269,7 @@ ScheduledFuture timeoutFuture() { return timeoutFuture; } + @Nullable @VisibleForTesting TimeoutTask timeoutTask() { return timeoutTask; diff --git a/core/src/main/java/com/linecorp/armeria/internal/common/util/ObjectCollectingUtil.java b/core/src/main/java/com/linecorp/armeria/internal/common/util/ObjectCollectingUtil.java index 1e75aab0c12..2bf0bd585b7 100644 --- a/core/src/main/java/com/linecorp/armeria/internal/common/util/ObjectCollectingUtil.java +++ b/core/src/main/java/com/linecorp/armeria/internal/common/util/ObjectCollectingUtil.java @@ -42,6 +42,7 @@ public final class ObjectCollectingUtil { * The {@link Class} instance of {@code reactor.core.publisher.Mono} of * Project Reactor. */ + @Nullable private static final Class MONO_CLASS; static { diff --git a/core/src/main/java/com/linecorp/armeria/internal/server/annotation/AnnotationUtil.java b/core/src/main/java/com/linecorp/armeria/internal/server/annotation/AnnotationUtil.java index 37e83988ec9..2eedc8e82f6 100644 --- a/core/src/main/java/com/linecorp/armeria/internal/server/annotation/AnnotationUtil.java +++ b/core/src/main/java/com/linecorp/armeria/internal/server/annotation/AnnotationUtil.java @@ -220,14 +220,14 @@ static List find(AnnotatedElement element, Class an private static void findMetaAnnotations( Builder builder, Annotation annotation, - Class annotationType, Class containerType) { + Class annotationType, @Nullable Class containerType) { findMetaAnnotations(builder, annotation, annotationType, containerType, Collections.newSetFromMap(new IdentityHashMap<>())); } private static boolean findMetaAnnotations( Builder builder, Annotation annotation, - Class annotationType, Class containerType, + Class annotationType, @Nullable Class containerType, Set> visitedAnnotationTypes) { final Class actualAnnotationType = annotation.getClass(); diff --git a/core/src/main/java/com/linecorp/armeria/server/docs/DocService.java b/core/src/main/java/com/linecorp/armeria/server/docs/DocService.java index aaf4ad089d6..401d7acd033 100644 --- a/core/src/main/java/com/linecorp/armeria/server/docs/DocService.java +++ b/core/src/main/java/com/linecorp/armeria/server/docs/DocService.java @@ -301,6 +301,7 @@ private static FieldInfo addFieldDocString(NamedTypeInfo parent, FieldInfo field docString(parent.name() + '/' + field.name(), field.docString(), docStrings)); } + @Nullable private static String docString( String key, @Nullable String currentDocString, Map docStrings) { return currentDocString != null ? currentDocString : docStrings.get(key);