Skip to content

Commit

Permalink
Remove superfluous @nonnull declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
jhoeller committed Mar 16, 2024
1 parent 58bd057 commit eb8b7c4
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 19 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -21,10 +21,10 @@
import java.util.function.Supplier;

import org.springframework.core.metrics.StartupStep;
import org.springframework.lang.NonNull;

/**
* {@link StartupStep} implementation for the Java Flight Recorder.
*
* <p>This variant delegates to a {@link FlightRecorderStartupEvent JFR event extension}
* to collect and record data in Java Flight Recorder.
*
Expand Down Expand Up @@ -114,12 +114,12 @@ public void add(String key, Supplier<String> value) {
add(key, value.get());
}

@NonNull
@Override
public Iterator<Tag> iterator() {
return new TagsIterator();
}


private class TagsIterator implements Iterator<Tag> {

private int idx = 0;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2023 the original author or authors.
* Copyright 2002-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -63,7 +63,6 @@

import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.lang.NonNull;
import org.springframework.lang.Nullable;
import org.springframework.util.Assert;
import org.springframework.util.LinkedCaseInsensitiveMap;
Expand Down Expand Up @@ -1020,7 +1019,7 @@ public void setCookies(@Nullable Cookie... cookies) {
}
}

private static String encodeCookies(@NonNull Cookie... cookies) {
private static String encodeCookies(Cookie... cookies) {
return Arrays.stream(cookies)
.map(c -> c.getName() + '=' + (c.getValue() == null ? "" : c.getValue()))
.collect(Collectors.joining("; "));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2023 the original author or authors.
* Copyright 2002-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -35,7 +35,6 @@
import org.springframework.core.io.DefaultResourceLoader;
import org.springframework.core.io.Resource;
import org.springframework.jdbc.datasource.init.ResourceDatabasePopulator;
import org.springframework.lang.NonNull;
import org.springframework.lang.Nullable;
import org.springframework.test.context.TestContext;
import org.springframework.test.context.TestContextAnnotationUtils;
Expand Down Expand Up @@ -363,7 +362,6 @@ else if (logger.isDebugEnabled()) {
}
}

@NonNull
private ResourceDatabasePopulator createDatabasePopulator(MergedSqlConfig mergedSqlConfig) {
ResourceDatabasePopulator populator = new ResourceDatabasePopulator();
populator.setSqlScriptEncoding(mergedSqlConfig.getEncoding());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2023 the original author or authors.
* Copyright 2002-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -18,7 +18,6 @@

import java.io.Serializable;

import org.springframework.lang.NonNull;
import org.springframework.lang.Nullable;

/**
Expand Down Expand Up @@ -80,8 +79,8 @@ private int hundreds() {


@Override
public int compareTo(@NonNull HttpStatusCode o) {
return Integer.compare(this.value, o.value());
public int compareTo(HttpStatusCode other) {
return Integer.compare(this.value, other.value());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2023 the original author or authors.
* Copyright 2002-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -63,7 +63,6 @@

import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.lang.NonNull;
import org.springframework.lang.Nullable;
import org.springframework.util.Assert;
import org.springframework.util.LinkedCaseInsensitiveMap;
Expand Down Expand Up @@ -1020,7 +1019,7 @@ public void setCookies(@Nullable Cookie... cookies) {
}
}

private static String encodeCookies(@NonNull Cookie... cookies) {
private static String encodeCookies(Cookie... cookies) {
return Arrays.stream(cookies)
.map(c -> c.getName() + '=' + (c.getValue() == null ? "" : c.getValue()))
.collect(Collectors.joining("; "));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.http.server.RequestPath;
import org.springframework.http.server.ServletServerHttpRequest;
import org.springframework.lang.NonNull;
import org.springframework.lang.Nullable;
import org.springframework.util.Assert;
import org.springframework.util.CollectionUtils;
Expand Down Expand Up @@ -522,7 +521,7 @@ public boolean contains(Object o) {
}

@Override
public boolean addAll(@NonNull Collection<? extends Entry<String, Object>> c) {
public boolean addAll(Collection<? extends Entry<String, Object>> c) {
throw new UnsupportedOperationException();
}

Expand All @@ -537,7 +536,7 @@ public boolean removeAll(Collection<?> c) {
}

@Override
public boolean retainAll(@NonNull Collection<?> c) {
public boolean retainAll(Collection<?> c) {
throw new UnsupportedOperationException();
}

Expand Down

0 comments on commit eb8b7c4

Please sign in to comment.