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

CustomFormat: unhandled exception on illegal format Input #14

Closed
tianxiaogu opened this Issue Nov 9, 2017 · 3 comments

Comments

Projects
2 participants
@tianxiaogu

tianxiaogu commented Nov 9, 2017

Exceptions from a third-party library have not been handled.

Reproduce:

  1. Export -> Edit custom format
  2. Enable Escaping and Comment, click BACK.
[APE] // CRASH: vocabletrainer.heinecke.aron.vocabletrainer (pid 25350) (elapsed nanos: 18947365328958)
[APE] // Short Msg: java.lang.IllegalArgumentException
[APE] // Long Msg: java.lang.IllegalArgumentException: The comment start and the escape character cannot be the same ('n')
[APE] // Build Label: Android/sdk_google_phone_x86/generic_x86:6.0/MASTER/4088240:userdebug/test-keys
[APE] // Build Changelist: 4088240
[APE] // Build Time: 1497047463000
[APE] // java.lang.IllegalArgumentException: The comment start and the escape character cannot be the same ('n')
[APE] // 	at org.apache.commons.csv.CSVFormat.validate(CSVFormat.java:1208)
[APE] // 	at org.apache.commons.csv.CSVFormat.<init>(CSVFormat.java:531)
[APE] // 	at org.apache.commons.csv.CSVFormat.withCommentMarker(CSVFormat.java:1283)
[APE] // 	at org.apache.commons.csv.CSVFormat.withCommentMarker(CSVFormat.java:1265)
[APE] // 	at vocabletrainer.heinecke.aron.vocabletrainer.fragment.FormatFragment.savePrefsToCSVFormat(FormatFragment.java:125)
[APE] // 	at vocabletrainer.heinecke.aron.vocabletrainer.fragment.FormatFragment.onStop(FormatFragment.java:85)
[APE] // 	at android.app.Fragment.performStop(Fragment.java:2391)
[APE] // 	at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1025)
[APE] // 	at android.app.FragmentManagerImpl.removeFragment(FragmentManager.java:1253)
[APE] // 	at android.app.BackStackRecord.popFromBackStack(BackStackRecord.java:1605)
[APE] // 	at android.app.FragmentManagerImpl.popBackStackState(FragmentManager.java:1587)
[APE] // 	at android.app.FragmentManagerImpl.popBackStackImmediate(FragmentManager.java:578)
[APE] // 	at vocabletrainer.heinecke.aron.vocabletrainer.Activities.FragmentActivity.handleFragmentBack(FragmentActivity.java:82)
[APE] // 	at vocabletrainer.heinecke.aron.vocabletrainer.Activities.FragmentActivity.onBackPressed(FragmentActivity.java:68)
[APE] // 	at android.app.Activity.onKeyUp(Activity.java:2477)
[APE] // 	at android.view.KeyEvent.dispatch(KeyEvent.java:2664)
[APE] // 	at android.app.Activity.dispatchKeyEvent(Activity.java:2730)
[APE] // 	at android.support.v7.app.AppCompatActivity.dispatchKeyEvent(AppCompatActivity.java:541)
[APE] // 	at android.support.v7.view.WindowCallbackWrapper.dispatchKeyEvent(WindowCallbackWrapper.java:59)
[APE] // 	at android.support.v7.app.AppCompatDelegateImplBase$AppCompatWindowCallbackBase.dispatchKeyEvent(AppCompatDelegateImplBase.java:319)
[APE] // 	at android.support.v7.view.WindowCallbackWrapper.dispatchKeyEvent(WindowCallbackWrapper.java:59)
[APE] // 	at com.android.internal.policy.PhoneWindow$DecorView.dispatchKeyEvent(PhoneWindow.java:2310)
[APE] // 	at android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:4127)
[APE] // 	at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4089)
[APE] // 	at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3642)
[APE] // 	at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3695)
[APE] // 	at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3661)
[APE] // 	at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3787)
[APE] // 	at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3669)
[APE] // 	at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:3844)
[APE] // 	at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3642)
[APE] // 	at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3695)
[APE] // 	at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3661)
[APE] // 	at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3669)
[APE] // 	at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3642)
[APE] // 	at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3695)
[APE] // 	at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3661)
[APE] // 	at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3820)
[APE] // 	at android.view.ViewRootImpl$ImeInputStage.onFinishedInputEvent(ViewRootImpl.java:3981)
[APE] // 	at android.view.inputmethod.InputMethodManager$PendingEvent.run(InputMethodManager.java:2253)
[APE] // 	at android.view.inputmethod.InputMethodManager.invokeFinishedInputEventCallback(InputMethodManager.java:1874)
[APE] // 	at android.view.inputmethod.InputMethodManager.finishedInputEvent(InputMethodManager.java:1865)
[APE] // 	at android.view.inputmethod.InputMethodManager$ImeInputEventSender.onInputEventFinished(InputMethodManager.java:2230)
[APE] // 	at android.view.InputEventSender.dispatchInputEventFinished(InputEventSender.java:141)
[APE] // 	at android.os.MessageQueue.nativePollOnce(Native Method)
[APE] // 	at android.os.MessageQueue.next(MessageQueue.java:323)
[APE] // 	at android.os.Looper.loop(Looper.java:135)
[APE] // 	at android.app.ActivityThread.main(ActivityThread.java:5417)
[APE] // 	at java.lang.reflect.Method.invoke(Native Method)
[APE] // 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
[APE] // 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
[APE] // 

@0xpr03

This comment has been minimized.

Owner

0xpr03 commented Nov 13, 2017

Good catch.
Seems like you've used the same character for two sections: comments & escapes.
Nevertheless this should be handled gracefully by an error dialog instead of crashing.
Please retry without using the same character for two sections.

@0xpr03 0xpr03 added crash bug labels Nov 13, 2017

@0xpr03 0xpr03 added this to the 1.0 milestone Nov 13, 2017

@0xpr03 0xpr03 self-assigned this Nov 13, 2017

@0xpr03 0xpr03 changed the title from java.lang.IllegalArgumentException: The comment start and the escape character cannot be the same ('n') to CustomFormat: unhandled exception on illegal format Input Nov 13, 2017

@tianxiaogu

This comment has been minimized.

tianxiaogu commented Nov 13, 2017

@0xpr03 Thanks for taking time to fix this issue. :)

@0xpr03

This comment has been minimized.

Owner

0xpr03 commented Nov 19, 2017

Note: I've added an entry in the wiki for now, stating which rules are enforced for custom formats.

@0xpr03 0xpr03 added this to Incoming in 1.0 Nov 19, 2017

0xpr03 added a commit that referenced this issue Nov 24, 2017

ads quick mode training mode
allows to train without writing down the answer on the phone

closes #14

@0xpr03 0xpr03 closed this in c59230e Nov 24, 2017

@0xpr03 0xpr03 reopened this Nov 24, 2017

@0xpr03 0xpr03 closed this in cb70813 Nov 25, 2017

1.0 automation moved this from Backlog to Finished Nov 25, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment