Commit e65bcefa by aquilescanta Committed by bachinger

Reorder DataSourceException constructors and accept nullable parameters

This CL doesn't introduce functional changes.

PiperOrigin-RevId: 387613057
parent 337d5aa9
...@@ -70,26 +70,24 @@ public class DataSourceException extends IOException { ...@@ -70,26 +70,24 @@ public class DataSourceException extends IOException {
/** /**
* Constructs a DataSourceException. * Constructs a DataSourceException.
* *
* @param message The error message.
* @param cause The error cause. * @param cause The error cause.
* @param reason Reason of the error, should be one of the {@code ERROR_CODE_IO_*} in {@link * @param reason Reason of the error, should be one of the {@code ERROR_CODE_IO_*} in {@link
* PlaybackException.ErrorCode}. * PlaybackException.ErrorCode}.
*/ */
public DataSourceException( public DataSourceException(@Nullable Throwable cause, @PlaybackException.ErrorCode int reason) {
String message, @Nullable Throwable cause, @PlaybackException.ErrorCode int reason) { super(cause);
super(message, cause);
this.reason = reason; this.reason = reason;
} }
/** /**
* Constructs a DataSourceException. * Constructs a DataSourceException.
* *
* @param cause The error cause. * @param message The error message.
* @param reason Reason of the error, should be one of the {@code ERROR_CODE_IO_*} in {@link * @param reason Reason of the error, should be one of the {@code ERROR_CODE_IO_*} in {@link
* PlaybackException.ErrorCode}. * PlaybackException.ErrorCode}.
*/ */
public DataSourceException(Throwable cause, @PlaybackException.ErrorCode int reason) { public DataSourceException(@Nullable String message, @PlaybackException.ErrorCode int reason) {
super(cause); super(message);
this.reason = reason; this.reason = reason;
} }
...@@ -97,11 +95,15 @@ public class DataSourceException extends IOException { ...@@ -97,11 +95,15 @@ public class DataSourceException extends IOException {
* Constructs a DataSourceException. * Constructs a DataSourceException.
* *
* @param message The error message. * @param message The error message.
* @param cause The error cause.
* @param reason Reason of the error, should be one of the {@code ERROR_CODE_IO_*} in {@link * @param reason Reason of the error, should be one of the {@code ERROR_CODE_IO_*} in {@link
* PlaybackException.ErrorCode}. * PlaybackException.ErrorCode}.
*/ */
public DataSourceException(String message, @PlaybackException.ErrorCode int reason) { public DataSourceException(
super(message); @Nullable String message,
@Nullable Throwable cause,
@PlaybackException.ErrorCode int reason) {
super(message, cause);
this.reason = reason; this.reason = reason;
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment