Skip to content

Commit

Permalink
Annotate some new APIs in Exception classes. (#82)
Browse files Browse the repository at this point in the history
  • Loading branch information
cpovirk authored Oct 7, 2024
1 parent 12b9209 commit f8acc90
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public InvalidObjectException(@Nullable String reason) {
* @see ObjectInputValidation
* @since 19
*/
public InvalidObjectException(String reason, Throwable cause) {
public InvalidObjectException(@Nullable String reason, @Nullable Throwable cause) {
super(reason, cause);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ protected ObjectStreamException(@Nullable String message) {
* @param cause the cause
* @since 19
*/
protected ObjectStreamException(String message, Throwable cause) {
protected ObjectStreamException(@Nullable String message, @Nullable Throwable cause) {
super(message, cause);
}

Expand All @@ -73,7 +73,7 @@ protected ObjectStreamException() {
* @param cause the cause
* @since 19
*/
protected ObjectStreamException(Throwable cause) {
protected ObjectStreamException(@Nullable Throwable cause) {
super(cause);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public synchronized Throwable fillInStackTrace() {
*
* @return the detail message string, which may be {@code null}.
*/
public String getMessage() {
public @Nullable String getMessage() {
String message = super.getMessage();
if (message == null) {
synchronized(this) {
Expand Down
4 changes: 2 additions & 2 deletions src/java.base/share/classes/java/net/SocketException.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public SocketException() {
* @param cause the cause
* @since 19
*/
public SocketException(String msg, Throwable cause) {
public SocketException(@Nullable String msg, @Nullable Throwable cause) {
super(msg, cause);
}

Expand All @@ -76,7 +76,7 @@ public SocketException(String msg, Throwable cause) {
* @param cause the cause
* @since 19
*/
public SocketException(Throwable cause) {
public SocketException(@Nullable Throwable cause) {
super(cause);
}
}

0 comments on commit f8acc90

Please sign in to comment.