From 3df617323e1e0035344f66de28db34ccfdc2d557 Mon Sep 17 00:00:00 2001 From: Jean Chalard Date: Tue, 10 Dec 2013 21:52:38 +0900 Subject: Make the bad header a checked exception and fix dicttool test Change-Id: If780a2a1cb722aee83d910904c0a6315add9552d --- java/src/com/android/inputmethod/latin/makedict/FormatSpec.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'java/src') diff --git a/java/src/com/android/inputmethod/latin/makedict/FormatSpec.java b/java/src/com/android/inputmethod/latin/makedict/FormatSpec.java index f23fe4656..d7c523f3c 100644 --- a/java/src/com/android/inputmethod/latin/makedict/FormatSpec.java +++ b/java/src/com/android/inputmethod/latin/makedict/FormatSpec.java @@ -352,18 +352,19 @@ public final class FormatSpec { public static final String DICTIONARY_ID_ATTRIBUTE = "dictionary"; private static final String DICTIONARY_DESCRIPTION_ATTRIBUTE = "description"; public FileHeader(final int headerSize, final DictionaryOptions dictionaryOptions, - final FormatOptions formatOptions) { + final FormatOptions formatOptions) throws UnsupportedFormatException { mDictionaryOptions = dictionaryOptions; mFormatOptions = formatOptions; mBodyOffset = formatOptions.mVersion < VERSION4 ? headerSize : 0; if (null == getLocaleString()) { - throw new RuntimeException("Cannot create a FileHeader without a locale"); + throw new UnsupportedFormatException("Cannot create a FileHeader without a locale"); } if (null == getVersion()) { - throw new RuntimeException("Cannot create a FileHeader without a version"); + throw new UnsupportedFormatException( + "Cannot create a FileHeader without a version"); } if (null == getId()) { - throw new RuntimeException("Cannot create a FileHeader without an ID"); + throw new UnsupportedFormatException("Cannot create a FileHeader without an ID"); } } -- cgit v1.2.3-83-g751a