Skip to content
Open
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/java.base/share/classes/java/io/EOFException.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@

package java.io;

import org.checkerframework.checker.nullness.qual.Nullable;
import org.checkerframework.framework.qual.AnnotatedFor;

/**
* Signals that an end of file or end of stream has been reached
* unexpectedly during input.
Expand All @@ -38,6 +41,7 @@
* @see java.io.IOException
* @since 1.0
*/
@AnnotatedFor({"nullness"})
public class EOFException extends IOException {
@java.io.Serial
private static final long serialVersionUID = 6433858223774886977L;
Expand All @@ -58,7 +62,7 @@ public EOFException() {
*
* @param s the detail message.
*/
public EOFException(String s) {
public EOFException(@Nullable String s) {
super(s);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@

package java.io;

import org.checkerframework.checker.nullness.qual.Nullable;
import org.checkerframework.framework.qual.AnnotatedFor;

/**
* Signals that an attempt to open the file denoted by a specified pathname
Expand All @@ -39,6 +41,7 @@
* @since 1.0
*/

@AnnotatedFor({"nullness"})
public class FileNotFoundException extends IOException {
@java.io.Serial
private static final long serialVersionUID = -897856973823710492L;
Expand All @@ -60,7 +63,7 @@ public FileNotFoundException() {
*
* @param s the detail message.
*/
public FileNotFoundException(String s) {
public FileNotFoundException(@Nullable String s) {
super(s);
}

Expand All @@ -73,7 +76,7 @@ public FileNotFoundException(String s) {
*
* @since 1.2
*/
private FileNotFoundException(String path, String reason) {
private FileNotFoundException(String path, @Nullable String reason) {
super(path + ((reason == null)
? ""
: " (" + reason + ")"));
Expand Down
5 changes: 4 additions & 1 deletion src/java.base/share/classes/java/io/IOError.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,15 @@

package java.io;

import org.checkerframework.checker.nullness.qual.Nullable;
import org.checkerframework.framework.qual.AnnotatedFor;
/**
* Thrown when a serious I/O error has occurred.
*
* @author Xueming Shen
* @since 1.6
*/
@AnnotatedFor({"nullness"})
public class IOError extends Error {
/**
* Constructs a new instance of IOError with the specified cause. The
Expand All @@ -42,7 +45,7 @@ public class IOError extends Error {
* The cause of this error, or {@code null} if the cause
* is not known
*/
public IOError(Throwable cause) {
public IOError(@Nullable Throwable cause) {
super(cause);
}

Expand Down
6 changes: 5 additions & 1 deletion src/java.base/share/classes/java/io/NotActiveException.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,15 @@

package java.io;

import org.checkerframework.checker.nullness.qual.Nullable;
import org.checkerframework.framework.qual.AnnotatedFor;

/**
* Thrown when serialization or deserialization is not active.
*
* @since 1.1
*/
@AnnotatedFor({"nullness"})
public class NotActiveException extends ObjectStreamException {

@java.io.Serial
Expand All @@ -40,7 +44,7 @@ public class NotActiveException extends ObjectStreamException {
*
* @param reason a String describing the reason for the exception.
*/
public NotActiveException(String reason) {
public NotActiveException(@Nullable String reason) {
super(reason);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,17 @@

package java.io;

import org.checkerframework.checker.nullness.qual.Nullable;
import org.checkerframework.framework.qual.AnnotatedFor;

/**
* Thrown when an instance is required to have a Serializable interface.
* The serialization runtime or the class of the instance can throw
* this exception. The argument should be the name of the class.
*
* @since 1.1
*/
@AnnotatedFor({"nullness"})
public class NotSerializableException extends ObjectStreamException {

@java.io.Serial
Expand All @@ -42,7 +46,7 @@ public class NotSerializableException extends ObjectStreamException {
*
* @param classname Class of the instance being serialized/deserialized.
*/
public NotSerializableException(String classname) {
public NotSerializableException(@Nullable String classname) {
super(classname);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
*/
package java.io;

import org.checkerframework.framework.qual.AnnotatedFor;

/**
* Exception indicating the failure of an object read operation due to
* unread primitive data, or the end of data belonging to a serialized
Expand All @@ -44,6 +46,7 @@
*
* @since 1.1
*/
@AnnotatedFor({"nullness"})
public class OptionalDataException extends ObjectStreamException {

@java.io.Serial
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,15 @@

package java.io;

import org.checkerframework.checker.nullness.qual.Nullable;
import org.checkerframework.framework.qual.AnnotatedFor;
/**
* Thrown when control information that was read from an object stream
* violates internal consistency checks.
*
* @since 1.1
*/
@AnnotatedFor({"nullness"})
public class StreamCorruptedException extends ObjectStreamException {

@java.io.Serial
Expand All @@ -41,7 +44,7 @@ public class StreamCorruptedException extends ObjectStreamException {
*
* @param reason String describing the reason for the exception.
*/
public StreamCorruptedException(String reason) {
public StreamCorruptedException(@Nullable String reason) {
super(reason);
}

Expand Down
6 changes: 5 additions & 1 deletion src/java.base/share/classes/java/io/SyncFailedException.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@

package java.io;

import org.checkerframework.checker.nullness.qual.Nullable;
import org.checkerframework.framework.qual.AnnotatedFor;

/**
* Signals that a sync operation has failed.
*
Expand All @@ -33,6 +36,7 @@
* @see java.io.IOException
* @since 1.1
*/
@AnnotatedFor({"nullness"})
public class SyncFailedException extends IOException {
@java.io.Serial
private static final long serialVersionUID = -2353342684412443330L;
Expand All @@ -43,7 +47,7 @@ public class SyncFailedException extends IOException {
*
* @param desc a String describing the exception.
*/
public SyncFailedException(String desc) {
public SyncFailedException(@Nullable String desc) {
super(desc);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@

package java.io;

import org.checkerframework.checker.nullness.qual.Nullable;
import org.checkerframework.framework.qual.AnnotatedFor;

/**
* Signals that a malformed string in
* <a href="DataInput.html#modified-utf-8">modified UTF-8</a>
Expand All @@ -42,6 +45,7 @@
* @see java.io.IOException
* @since 1.0
*/
@AnnotatedFor({"nullness"})
public class UTFDataFormatException extends IOException {
@java.io.Serial
private static final long serialVersionUID = 420743449228280612L;
Expand All @@ -63,7 +67,7 @@ public UTFDataFormatException() {
*
* @param s the detail message.
*/
public UTFDataFormatException(String s) {
public UTFDataFormatException(@Nullable String s) {
super(s);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,16 @@
*/
package java.io;

import org.checkerframework.checker.nullness.qual.Nullable;
import org.checkerframework.framework.qual.AnnotatedFor;

/**
* The Character Encoding is not supported.
*
* @author Asmus Freytag
* @since 1.1
*/
@AnnotatedFor({"nullness"})
public class UnsupportedEncodingException
extends IOException
{
Expand All @@ -47,7 +51,7 @@ public UnsupportedEncodingException() {
* Constructs an UnsupportedEncodingException with a detail message.
* @param s Describes the reason for the exception.
*/
public UnsupportedEncodingException(String s) {
public UnsupportedEncodingException(@Nullable String s) {
super(s);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
package java.io;

import org.checkerframework.checker.nullness.qual.Nullable;
import org.checkerframework.framework.qual.AnnotatedFor;

/**
* Signals that one of the ObjectStreamExceptions was thrown during a
Expand All @@ -37,6 +38,7 @@
*
* @since 1.1
*/
@AnnotatedFor({"nullness"})
public class WriteAbortedException extends ObjectStreamException {
@java.io.Serial
private static final long serialVersionUID = -3326426625597282442L;
Expand All @@ -51,15 +53,15 @@ public class WriteAbortedException extends ObjectStreamException {
* @serial
*/
@Deprecated(since="17")
public Exception detail;
public @Nullable Exception detail;

/**
* Constructs a WriteAbortedException with a string describing
* the exception and the exception causing the abort.
* @param s String describing the exception.
* @param ex Exception causing the abort.
*/
public WriteAbortedException(String s, Exception ex) {
public WriteAbortedException(@Nullable String s, @Nullable Exception ex) {
super(s);
initCause(null); // Disallow subsequent initCause
detail = ex;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@

package java.nio.file;

import org.checkerframework.checker.nullness.qual.Nullable;
import org.checkerframework.framework.qual.AnnotatedFor;

/**
* Checked exception thrown when a file system operation is denied, typically
* due to a file permission or other access check.
Expand All @@ -36,7 +39,7 @@
*
* @since 1.7
*/

@AnnotatedFor({"nullness"})
public class AccessDeniedException
extends FileSystemException
{
Expand All @@ -49,7 +52,7 @@ public class AccessDeniedException
* @param file
* a string identifying the file or {@code null} if not known
*/
public AccessDeniedException(String file) {
public AccessDeniedException(@Nullable String file) {
super(file);
}

Expand All @@ -63,7 +66,7 @@ public AccessDeniedException(String file) {
* @param reason
* a reason message with additional information or {@code null}
*/
public AccessDeniedException(String file, String other, String reason) {
public AccessDeniedException(@Nullable String file, @Nullable String other, @Nullable String reason) {
super(file, other, reason);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,17 @@

package java.nio.file;

import org.checkerframework.checker.nullness.qual.Nullable;
import org.checkerframework.framework.qual.AnnotatedFor;

/**
* Checked exception thrown when a file cannot be moved as an atomic file system
* operation.
*
* @since 1.7
*/

@AnnotatedFor({"nullness"})
public class AtomicMoveNotSupportedException
extends FileSystemException
{
Expand All @@ -48,9 +52,9 @@ public class AtomicMoveNotSupportedException
* @param reason
* a reason message with additional information or {@code null}
*/
public AtomicMoveNotSupportedException(String source,
String target,
String reason)
public AtomicMoveNotSupportedException(@Nullable String source,
@Nullable String target,
@Nullable String reason)
{
super(source, target, reason);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
import java.io.ObjectInputStream;
import java.io.InvalidObjectException;

import org.checkerframework.checker.nullness.qual.Nullable;
import org.checkerframework.framework.qual.AnnotatedFor;

/**
* Runtime exception thrown if an I/O error is encountered when iterating over
* the entries in a directory. The I/O error is retrieved as an {@link
Expand All @@ -40,6 +43,7 @@
* @see DirectoryStream
*/

@AnnotatedFor({"nullness"})
public final class DirectoryIteratorException
extends ConcurrentModificationException
{
Expand Down
Loading
Loading