Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add @NonNull annotations to @NullUnmarked APIs. #110

Merged
merged 3 commits into from
Dec 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions src/java.base/share/classes/java/nio/file/Files.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
import java.util.stream.Stream;
import java.util.stream.StreamSupport;

import org.jspecify.annotations.NonNull;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.NullUnmarked;
import org.jspecify.annotations.Nullable;
Expand Down Expand Up @@ -1814,9 +1815,9 @@ public static Path setAttribute(Path path, String attribute, Object value,
* @throws IOException
* if an I/O error occurs
*/
@NullUnmarked
public static Object getAttribute(Path path, String attribute,
LinkOption... options)
@NullUnmarked // https://github.com/jspecify/jdk/pull/10#pullrequestreview-1404320091
public static /*@NullUnmarked*/ Object getAttribute(@NonNull Path path, @NonNull String attribute,
@NonNull LinkOption @NonNull ... options)
throws IOException
{
// only one attribute should be read
Expand Down Expand Up @@ -1913,9 +1914,9 @@ public static Object getAttribute(Path path, String attribute,
* @throws IOException
* if an I/O error occurs
*/
@NullUnmarked
public static Map<String,Object> readAttributes(Path path, String attributes,
LinkOption... options)
@NullUnmarked // https://github.com/jspecify/jdk/pull/10#pullrequestreview-1404320091
public static @NonNull Map<@NonNull String, /*@NullUnmarked*/ Object> readAttributes(@NonNull Path path, @NonNull String attributes,
@NonNull LinkOption @NonNull ... options)
throws IOException
{
return provider(path).readAttributes(path, attributes, options);
Expand Down
Loading