Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 0 additions & 2 deletions docs/src/main/java/io/jooby/adoc/DocPostprocessor.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import java.util.Set;
import java.util.UUID;

import edu.umd.cs.findbugs.annotations.NonNull;
import org.asciidoctor.extension.Postprocessor;
import org.jcodings.util.Hash;
import org.jsoup.Jsoup;
Expand Down Expand Up @@ -145,7 +144,6 @@ private static void headerIds(Document doc, int level) {
});
}

@NonNull
private static String cleanId(String id) {
return id.replaceAll("-\\d+$", "");
}
Expand Down
4 changes: 2 additions & 2 deletions jooby/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
<dependencies>

<dependency>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-annotations</artifactId>
<groupId>org.jspecify</groupId>
<artifactId>jspecify</artifactId>
</dependency>

<!-- Logging System -->
Expand Down
10 changes: 4 additions & 6 deletions jooby/src/main/java/io/jooby/AttachedFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
import java.io.InputStream;
import java.nio.file.Path;

import edu.umd.cs.findbugs.annotations.NonNull;

/**
* Represents a file attachment response.
*
Expand All @@ -26,7 +24,7 @@ public class AttachedFile extends FileDownload {
* @param fileName Filename.
* @param fileSize File size or <code>-1</code> if unknown.
*/
public AttachedFile(@NonNull InputStream content, @NonNull String fileName, long fileSize) {
public AttachedFile(InputStream content, String fileName, long fileSize) {
super(Mode.ATTACHMENT, content, fileName, fileSize);
}

Expand All @@ -36,7 +34,7 @@ public AttachedFile(@NonNull InputStream content, @NonNull String fileName, long
* @param content File content.
* @param fileName Filename.
*/
public AttachedFile(@NonNull InputStream content, @NonNull String fileName) {
public AttachedFile(InputStream content, String fileName) {
super(Mode.ATTACHMENT, content, fileName);
}

Expand All @@ -47,7 +45,7 @@ public AttachedFile(@NonNull InputStream content, @NonNull String fileName) {
* @param fileName Filename.
* @throws IOException For IO exception while reading file.
*/
public AttachedFile(@NonNull Path file, @NonNull String fileName) throws IOException {
public AttachedFile(Path file, String fileName) throws IOException {
super(Mode.ATTACHMENT, file, fileName);
}

Expand All @@ -57,7 +55,7 @@ public AttachedFile(@NonNull Path file, @NonNull String fileName) throws IOExcep
* @param file File content.
* @throws IOException For IO exception while reading file.
*/
public AttachedFile(@NonNull Path file) throws IOException {
public AttachedFile(Path file) throws IOException {
super(Mode.ATTACHMENT, file);
}
}
24 changes: 12 additions & 12 deletions jooby/src/main/java/io/jooby/Body.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
import java.util.List;
import java.util.Set;

import edu.umd.cs.findbugs.annotations.NonNull;
import edu.umd.cs.findbugs.annotations.Nullable;
import org.jspecify.annotations.Nullable;

import io.jooby.exception.MissingValueException;
import io.jooby.internal.ByteArrayBody;
import io.jooby.internal.FileBody;
Expand All @@ -39,7 +39,7 @@ public interface Body extends Value {
* @param charset Charset.
* @return Body as string.
*/
default String value(@NonNull Charset charset) {
default String value(Charset charset) {
byte[] bytes = bytes();
if (bytes.length == 0) {
throw new MissingValueException("body");
Expand Down Expand Up @@ -99,7 +99,7 @@ default Iterator<Value> iterator() {
InputStream stream();

@Override
default <T> List<T> toList(@NonNull Class<T> type) {
default <T> List<T> toList(Class<T> type) {
return to(Reified.list(type).getType());
}

Expand All @@ -112,11 +112,11 @@ default <T> List<T> toList(@NonNull Class<T> type) {
}

@Override
default <T> T to(@NonNull Class<T> type) {
default <T> T to(Class<T> type) {
return to((Type) type);
}

default @Nullable @Override <T> T toNullable(@NonNull Class<T> type) {
default @Nullable @Override <T> T toNullable(Class<T> type) {
return toNullable((Type) type);
}

Expand All @@ -127,7 +127,7 @@ default <T> T to(@NonNull Class<T> type) {
* @param <T> Generic type.
* @return Converted value.
*/
<T> T to(@NonNull Type type);
<T> T to(Type type);

/**
* Convert this body into the given type.
Expand All @@ -136,7 +136,7 @@ default <T> T to(@NonNull Class<T> type) {
* @param <T> Generic type.
* @return Converted value or <code>null</code>.
*/
@Nullable <T> T toNullable(@NonNull Type type);
@Nullable <T> T toNullable(Type type);

/* **********************************************************************************************
* Factory methods:
Expand All @@ -149,7 +149,7 @@ default <T> T to(@NonNull Class<T> type) {
* @param ctx Current context.
* @return Empty body.
*/
static Body empty(@NonNull Context ctx) {
static Body empty(Context ctx) {
return ByteArrayBody.empty(ctx);
}

Expand All @@ -161,7 +161,7 @@ static Body empty(@NonNull Context ctx) {
* @param size Size in bytes or <code>-1</code>.
* @return A new body.
*/
static Body of(@NonNull Context ctx, @NonNull InputStream stream, long size) {
static Body of(Context ctx, InputStream stream, long size) {
return new InputStreamBody(ctx, stream, size);
}

Expand All @@ -172,7 +172,7 @@ static Body of(@NonNull Context ctx, @NonNull InputStream stream, long size) {
* @param bytes byte array.
* @return A new body.
*/
static Body of(@NonNull Context ctx, @NonNull byte[] bytes) {
static Body of(Context ctx, byte[] bytes) {
return new ByteArrayBody(ctx, bytes);
}

Expand All @@ -183,7 +183,7 @@ static Body of(@NonNull Context ctx, @NonNull byte[] bytes) {
* @param file File.
* @return A new body.
*/
static Body of(@NonNull Context ctx, @NonNull Path file) {
static Body of(Context ctx, Path file) {
return new FileBody(ctx, file);
}
}
14 changes: 7 additions & 7 deletions jooby/src/main/java/io/jooby/ByteRange.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import java.io.IOException;
import java.io.InputStream;

import edu.umd.cs.findbugs.annotations.NonNull;
import edu.umd.cs.findbugs.annotations.Nullable;
import org.jspecify.annotations.Nullable;

import io.jooby.internal.NoByteRange;
import io.jooby.internal.NotSatisfiableByteRange;
import io.jooby.internal.SingleByteRange;
Expand Down Expand Up @@ -44,7 +44,7 @@ public interface ByteRange {
* @param contentLength Content length.
* @return Byte range instance.
*/
static @NonNull ByteRange parse(@Nullable String value, long contentLength) {
static ByteRange parse(@Nullable String value, long contentLength) {
if (contentLength <= 0 || value == null) {
// NOOP
return new NoByteRange(contentLength);
Expand Down Expand Up @@ -129,7 +129,7 @@ public interface ByteRange {
*
* @return Value for <code>Content-Range</code> response header.
*/
@NonNull String getContentRange();
String getContentRange();

/**
* For partial requests this method returns {@link StatusCode#PARTIAL_CONTENT}.
Expand All @@ -141,7 +141,7 @@ public interface ByteRange {
*
* @return Status code.
*/
@NonNull StatusCode getStatusCode();
StatusCode getStatusCode();

/**
* For partial request this method set the following byte range response headers:
Expand All @@ -157,7 +157,7 @@ public interface ByteRange {
* @param ctx Web context.
* @return This byte range request.
*/
@NonNull ByteRange apply(@NonNull Context ctx);
ByteRange apply(Context ctx);

/**
* For partial requests this method generates a new truncated input stream.
Expand All @@ -170,5 +170,5 @@ public interface ByteRange {
* @return A truncated input stream for partial request or same input stream.
* @throws IOException When truncation fails.
*/
@NonNull InputStream apply(@NonNull InputStream input) throws IOException;
InputStream apply(InputStream input) throws IOException;
}
6 changes: 2 additions & 4 deletions jooby/src/main/java/io/jooby/CompletionListeners.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
import java.util.List;
import java.util.stream.Stream;

import edu.umd.cs.findbugs.annotations.NonNull;

/**
* Utility class that group one or more completion listeners and execute them in reverse order.
*
Expand All @@ -28,7 +26,7 @@ public CompletionListeners() {}
*
* @param listener Listener.
*/
public void addListener(@NonNull Route.Complete listener) {
public void addListener(Route.Complete listener) {
if (listeners == null) {
listeners = new ArrayList<>();
}
Expand All @@ -40,7 +38,7 @@ public void addListener(@NonNull Route.Complete listener) {
*
* @param ctx Listeners.
*/
public void run(@NonNull Context ctx) {
public void run(Context ctx) {
if (listeners != null) {
Throwable cause = null;
for (int i = listeners.size() - 1; i >= 0; i--) {
Expand Down
Loading
Loading