Throw illegal argument exception in BinaryDictionary::editDistance

Bug: 7276803
Change-Id: Icd9bdec0a04179a29d00336819d205627f77b71a
main
Satoshi Kataoka 2012-10-03 17:15:47 +09:00
parent 15281adbc1
commit 66d955ad71
1 changed files with 3 additions and 0 deletions

View File

@ -187,6 +187,9 @@ public final class BinaryDictionary extends Dictionary {
} }
public static int editDistance(String before, String after) { public static int editDistance(String before, String after) {
if (before == null || after == null) {
throw new IllegalArgumentException();
}
return editDistanceNative(before.toCharArray(), after.toCharArray()); return editDistanceNative(before.toCharArray(), after.toCharArray());
} }