Loading java/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderUtils.java +1 −2 Original line number Diff line number Diff line Loading @@ -561,8 +561,7 @@ public final class BinaryDictDecoderUtils { */ @UsedForTesting /* package */ static FusionDictionary readDictionaryBinary(final Ver3DictDecoder dictDecoder, final FusionDictionary dict) throws FileNotFoundException, IOException, UnsupportedFormatException { final FusionDictionary dict) throws IOException, UnsupportedFormatException { // Read header final FileHeader fileHeader = dictDecoder.readHeader(); Loading java/src/com/android/inputmethod/latin/makedict/Ver3DictDecoder.java +18 −1 Original line number Diff line number Diff line Loading @@ -25,6 +25,8 @@ import com.android.inputmethod.latin.makedict.FusionDictionary.PtNode; import com.android.inputmethod.latin.makedict.FusionDictionary.WeightedString; import com.android.inputmethod.latin.utils.JniUtils; import android.util.Log; import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; Loading @@ -38,6 +40,7 @@ import java.util.TreeMap; */ @UsedForTesting public class Ver3DictDecoder implements DictDecoder { private static final String TAG = Ver3DictDecoder.class.getSimpleName(); static { JniUtils.loadNativeLibrary(); Loading Loading @@ -308,7 +311,21 @@ public class Ver3DictDecoder implements DictDecoder { if (mDictBuffer == null) { openDictBuffer(); } try { return BinaryDictDecoderUtils.readDictionaryBinary(this, dict); } catch (IOException e) { Log.e(TAG, "The dictionary " + mDictionaryBinaryFile.getName() + " is broken.", e); if (!mDictionaryBinaryFile.delete()) { Log.e(TAG, "Failed to delete the broken dictionary."); } throw e; } catch (UnsupportedFormatException e) { Log.e(TAG, "The dictionary " + mDictionaryBinaryFile.getName() + " is broken.", e); if (!mDictionaryBinaryFile.delete()) { Log.e(TAG, "Failed to delete the broken dictionary."); } throw e; } } @Override Loading Loading
java/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderUtils.java +1 −2 Original line number Diff line number Diff line Loading @@ -561,8 +561,7 @@ public final class BinaryDictDecoderUtils { */ @UsedForTesting /* package */ static FusionDictionary readDictionaryBinary(final Ver3DictDecoder dictDecoder, final FusionDictionary dict) throws FileNotFoundException, IOException, UnsupportedFormatException { final FusionDictionary dict) throws IOException, UnsupportedFormatException { // Read header final FileHeader fileHeader = dictDecoder.readHeader(); Loading
java/src/com/android/inputmethod/latin/makedict/Ver3DictDecoder.java +18 −1 Original line number Diff line number Diff line Loading @@ -25,6 +25,8 @@ import com.android.inputmethod.latin.makedict.FusionDictionary.PtNode; import com.android.inputmethod.latin.makedict.FusionDictionary.WeightedString; import com.android.inputmethod.latin.utils.JniUtils; import android.util.Log; import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; Loading @@ -38,6 +40,7 @@ import java.util.TreeMap; */ @UsedForTesting public class Ver3DictDecoder implements DictDecoder { private static final String TAG = Ver3DictDecoder.class.getSimpleName(); static { JniUtils.loadNativeLibrary(); Loading Loading @@ -308,7 +311,21 @@ public class Ver3DictDecoder implements DictDecoder { if (mDictBuffer == null) { openDictBuffer(); } try { return BinaryDictDecoderUtils.readDictionaryBinary(this, dict); } catch (IOException e) { Log.e(TAG, "The dictionary " + mDictionaryBinaryFile.getName() + " is broken.", e); if (!mDictionaryBinaryFile.delete()) { Log.e(TAG, "Failed to delete the broken dictionary."); } throw e; } catch (UnsupportedFormatException e) { Log.e(TAG, "The dictionary " + mDictionaryBinaryFile.getName() + " is broken.", e); if (!mDictionaryBinaryFile.delete()) { Log.e(TAG, "Failed to delete the broken dictionary."); } throw e; } } @Override Loading