Skip to content

Commit

Permalink
CR
Browse files Browse the repository at this point in the history
  • Loading branch information
dstepanov committed Jul 22, 2024
1 parent 3317acc commit 289f691
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion core/src/main/java/io/micronaut/core/type/Argument.java
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ static <T> Argument<T> of(
* @since 4.6
*/
@NonNull
static <T> Argument<T> ofInstance(T instance) {
static <T> Argument<T> ofInstance(@NonNull T instance) {
return Argument.of((Class<T>) instance.getClass());
}

Expand Down
8 changes: 6 additions & 2 deletions core/src/main/java/io/micronaut/core/type/MutableHeaders.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
package io.micronaut.core.type;


import io.micronaut.core.annotation.NonNull;

/**
* Common interface for all mutable header types.
*
Expand Down Expand Up @@ -48,7 +50,8 @@ public interface MutableHeaders extends Headers {
* @return This headers
* @since 1.3.3
*/
default MutableHeaders set(CharSequence header, CharSequence value) {
@NonNull
default MutableHeaders set(@NonNull CharSequence header, @NonNull CharSequence value) {
remove(header);
add(header, value);
return this;
Expand All @@ -62,7 +65,8 @@ default MutableHeaders set(CharSequence header, CharSequence value) {
* @return This headers
* @since 4.6
*/
default MutableHeaders setIfMissing(CharSequence header, CharSequence value) {
@NonNull
default MutableHeaders setIfMissing(@NonNull CharSequence header, @NonNull CharSequence value) {
if (!contains(header.toString())) {
add(header, value);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
*/
@Internal
@Experimental
abstract class AbstractMessageBodyHandlerRegistry implements MessageBodyHandlerRegistry {
abstract sealed class AbstractMessageBodyHandlerRegistry implements MessageBodyHandlerRegistry permits ContextlessMessageBodyHandlerRegistry, DefaultMessageBodyHandlerRegistry {
private static final MessageBodyReader<Object> NO_READER = new NoReader();
private static final MessageBodyWriter<Object> NO_WRITER = new NoWriter();
private final Map<HandlerKey<?>, MessageBodyReader<?>> readers = new ConcurrentHashMap<>(10);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ <T> Optional<MessageBodyWriter<T>> findWriter(
);

/**
* Gets a writer for the type and annotation metadata at declaration point or fails.
* Gets a writer for the type and annotation metadata at declaration point or fails with {@link CodecException}.
* @param type The type
* @param mediaType The media type
* @return A message body writer if it is existing.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
package io.micronaut.http.body;

import io.micronaut.core.annotation.Experimental;
import io.micronaut.core.annotation.NonNull;
import io.micronaut.core.type.Argument;

/**
Expand All @@ -31,5 +32,6 @@ public interface TypedMessageBodyHandler<T> extends MessageBodyHandler<T>, Typed
/**
* @return The body type.
*/
@NonNull
Argument<T> getType();
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
package io.micronaut.http.body;

import io.micronaut.core.annotation.Experimental;
import io.micronaut.core.annotation.NonNull;
import io.micronaut.core.type.Argument;
import io.micronaut.http.MediaType;

Expand All @@ -32,6 +33,7 @@ public interface TypedMessageBodyReader<T> extends MessageBodyReader<T> {
/**
* @return The body type.
*/
@NonNull
Argument<T> getType();

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
package io.micronaut.http.body;

import io.micronaut.core.annotation.Experimental;
import io.micronaut.core.annotation.NonNull;
import io.micronaut.core.type.Argument;
import io.micronaut.http.MediaType;

Expand All @@ -32,6 +33,7 @@ public interface TypedMessageBodyWriter<T> extends MessageBodyWriter<T> {
/**
* @return The body type.
*/
@NonNull
Argument<T> getType();

@Override
Expand Down

0 comments on commit 289f691

Please sign in to comment.