diff --git a/moshi/src/main/java/com/squareup/moshi/JsonDataException.java b/moshi/src/main/java/com/squareup/moshi/JsonDataException.kt similarity index 56% rename from moshi/src/main/java/com/squareup/moshi/JsonDataException.java rename to moshi/src/main/java/com/squareup/moshi/JsonDataException.kt index 61b2987..a708d79 100644 --- a/moshi/src/main/java/com/squareup/moshi/JsonDataException.java +++ b/moshi/src/main/java/com/squareup/moshi/JsonDataException.kt @@ -13,34 +13,23 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.squareup.moshi; - -import javax.annotation.Nullable; +package com.squareup.moshi /** * Thrown when the data in a JSON document doesn't match the data expected by the caller. For * example, suppose the application expects a boolean but the JSON document contains a string. When - * the call to {@link JsonReader#nextBoolean} is made, a {@code JsonDataException} is thrown. + * the call to [JsonReader.nextBoolean] is made, a `JsonDataException` is thrown. * - *
Exceptions of this type should be fixed by either changing the application code to accept the + * Exceptions of this type should be fixed by either changing the application code to accept the * unexpected JSON, or by changing the JSON to conform to the application's expectations. * - *
This exception may also be triggered if a document's nesting exceeds 31 levels. This depth is + * This exception may also be triggered if a document's nesting exceeds 31 levels. This depth is * sufficient for all practical applications, but shallow enough to avoid uglier failures like - * {@link StackOverflowError}. + * [StackOverflowError]. */ -public final class JsonDataException extends RuntimeException { - public JsonDataException() {} - - public JsonDataException(@Nullable String message) { - super(message); - } - - public JsonDataException(@Nullable Throwable cause) { - super(cause); - } - - public JsonDataException(@Nullable String message, @Nullable Throwable cause) { - super(message, cause); - } +public class JsonDataException : RuntimeException { + public constructor() : super() + public constructor(message: String?) : super(message) + public constructor(cause: Throwable?) : super(cause) + public constructor(message: String?, cause: Throwable?) : super(message, cause) } diff --git a/moshi/src/main/java/com/squareup/moshi/JsonEncodingException.java b/moshi/src/main/java/com/squareup/moshi/JsonEncodingException.kt similarity index 73% rename from moshi/src/main/java/com/squareup/moshi/JsonEncodingException.java rename to moshi/src/main/java/com/squareup/moshi/JsonEncodingException.kt index dc83fa0..73c6dfd 100644 --- a/moshi/src/main/java/com/squareup/moshi/JsonEncodingException.java +++ b/moshi/src/main/java/com/squareup/moshi/JsonEncodingException.kt @@ -13,14 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.squareup.moshi; +package com.squareup.moshi -import java.io.IOException; -import javax.annotation.Nullable; +import java.io.IOException /** Thrown when the data being parsed is not encoded as valid JSON. */ -public final class JsonEncodingException extends IOException { - public JsonEncodingException(@Nullable String message) { - super(message); - } -} +public class JsonEncodingException(message: String?) : IOException(message)