Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aedict query parser crashes when the query contains NBSP character #658

Closed
mvysny opened this issue Apr 9, 2016 · 4 comments
Closed

Aedict query parser crashes when the query contains NBSP character #658

mvysny opened this issue Apr 9, 2016 · 4 comments

Comments

@mvysny
Copy link
Owner

@mvysny mvysny commented Apr 9, 2016

java.lang.RuntimeException: Unable to resume activity {sk.baka.aedict3/sk.baka.aedict3.search.MainActivity}: java.lang.IllegalArgumentException: Parameter query: invalid value : iPhone、Xperiaほか、SIMロックフリー端末に使えるSIMカードをラインアップ。: contains whitespaces
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2941)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2970)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2383)
at android.app.ActivityThread.access$800(ActivityThread.java:155)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1244)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5433)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1268)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1084)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.IllegalArgumentException: Parameter query: invalid value : iPhone、Xperiaほか、SIMロックフリー端末に使えるSIMカードをラインアップ。: contains whitespaces
at sk.baka.aedict.search.QueryKana.(QueryKana.kt:56)
at sk.baka.aedict.search.QueryKana$Companion.parse(QueryKana.kt:90)
at sk.baka.aedict.search.QueryKana.parse(QueryKana.kt)
at sk.baka.aedict.search.JMDictQuery.forGenericEnJpTerm(JMDictQuery.java:570)
at sk.baka.aedict.search.JMDictQuery.access$000(JMDictQuery.java:39)
at sk.baka.aedict.search.JMDictQuery$Builder.forGenericEnJpTerm(JMDictQuery.java:490)
at sk.baka.aedict3.util.Config.newQuery(Config.java:671)
at sk.baka.aedict3.search.MainActivity.getSearch(MainActivity.java:423)
at sk.baka.aedict3.search.MainActivity.liveSearch(MainActivity.java:442)
at sk.baka.aedict3.search.MainActivity.onResume(MainActivity.java:289)
at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1199)
at android.app.Activity.performResume(Activity.java:5380)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2931)
... 12 more

@mvysny mvysny added the bug label Apr 9, 2016
@mvysny
Copy link
Owner Author

@mvysny mvysny commented Apr 9, 2016

Cannot reproduce. Releasing a new version of Aedict with improved exception messages, waiting for this bug to be reproduced.

@mvysny
Copy link
Owner Author

@mvysny mvysny commented Apr 9, 2016

Releasing 3.39.14; I hope that this is not yet another Android bug reproducible on Galaxy Core Prime (core33g) only - that is, splitting the string by \p{javaWhitespace}+ produces different results on Galaxy Core Prime (and the splitted strings contain whitespaces!!!! This must not happen, see https://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html : \p{javaWhitespace} Equivalent to java.lang.Character.isWhitespace()) than on other Androids.. I wouldn't be surprised though, see #290

@mvysny
Copy link
Owner Author

@mvysny mvysny commented Apr 9, 2016

Oh, \p{javaWhitespace} ignores Character.isSpaceChar (that is, nbsp 160), which Kotlin considers as a whitespace char and the check fails...

@mvysny mvysny changed the title Aedict query parser crashes Aedict query parser crashes when the query contains NBSP character Apr 9, 2016
@mvysny
Copy link
Owner Author

@mvysny mvysny commented Apr 9, 2016

Fixed in Aedict 3.39.15

@mvysny mvysny closed this Apr 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.