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

Fix IllegalArgumentException when updating InstructionList #1123

Merged
merged 1 commit into from
Jul 20, 2018

Conversation

danesfeder
Copy link
Contributor

Found 🐛 in CI - regression from #1064

FATAL EXCEPTION: ControllerMessenger
Process: com.mapbox.services.android.navigation.testapp, PID: 26365
java.lang.IllegalArgumentException
	at java.util.AbstractList.subList(AbstractList.java:736)
	at com.mapbox.services.android.navigation.ui.v5.summary.list.InstructionListPresenter.removeInstructionsFrom(InstructionListPresenter.java:154)
	at com.mapbox.services.android.navigation.ui.v5.summary.list.InstructionListPresenter.updateInstructionList(InstructionListPresenter.java:146)
	at com.mapbox.services.android.navigation.ui.v5.summary.list.InstructionListPresenter.updateBannerListWith(InstructionListPresenter.java:53)
	at com.mapbox.services.android.navigation.ui.v5.summary.list.InstructionListAdapter.updateBannerListWith(InstructionListAdapter.java:49)
	at com.mapbox.services.android.navigation.ui.v5.instruction.InstructionView.updateInstructionList(InstructionView.java:918)
	at com.mapbox.services.android.navigation.ui.v5.instruction.InstructionView.updateDataFromInstruction(InstructionView.java:841)
	at com.mapbox.services.android.navigation.ui.v5.instruction.InstructionView.access$000(InstructionView.java:79)
	at com.mapbox.services.android.navigation.ui.v5.instruction.InstructionView$1.onChanged(InstructionView.java:190)
	at com.mapbox.services.android.navigation.ui.v5.instruction.InstructionView$1.onChanged(InstructionView.java:186)
	at android.arch.lifecycle.LiveData.considerNotify(LiveData.java:109)
	at android.arch.lifecycle.LiveData.dispatchingValue(LiveData.java:126)
	at android.arch.lifecycle.LiveData.setValue(LiveData.java:282)
	at android.arch.lifecycle.MutableLiveData.setValue(MutableLiveData.java:33)
	at com.mapbox.services.android.navigation.ui.v5.NavigationViewModel$1.onProgressChange(NavigationViewModel.java:262)
	at com.mapbox.services.android.navigation.v5.navigation.NavigationEventDispatcher.onProgressChange(NavigationEventDispatcher.java:144)
	at com.mapbox.services.android.navigation.v5.navigation.RouteProcessorThreadListener.onNewRouteProgress(RouteProcessorThreadListener.java:34)
	at com.mapbox.services.android.navigation.v5.navigation.RouteProcessorHandlerCallback$1.run(RouteProcessorHandlerCallback.java:97)
	at android.os.Handler.handleCallback(Handler.java:739)
	at android.os.Handler.dispatchMessage(Handler.java:95)
	at androidx.test.espresso.base.Interrogator.a(Interrogator.java:19)
	at androidx.test.espresso.base.UiControllerImpl.a(UiControllerImpl.java:142)
	at androidx.test.espresso.base.UiControllerImpl.a(UiControllerImpl.java:134)
	at androidx.test.espresso.base.UiControllerImpl.a(UiControllerImpl.java:34)
	at androidx.test.espresso.action.MotionEvents.a(MotionEvents.java:74)
	at androidx.test.espresso.action.MotionEvents.a(MotionEvents.java:52)
	at androidx.test.espresso.action.Tap.c(Tap.java:9)
	at androidx.test.espresso.action.Tap.a(Tap.java:19)
	at androidx.test.espresso.action.Tap$1.b(Tap.java:2)
	at androidx.test.espresso.action.GeneralClickAction.perform(GeneralClickAction.java:22)
	at androidx.test.espresso.ViewInteraction$SingleExecutionViewAction.perform(ViewInteraction.java:9)
	at androidx.test.espresso.ViewInteraction.a(ViewInteraction.java:78)
	at androidx.test.espresso.ViewInteraction.a(ViewInteraction.java:94)
	at androidx.test.espresso.ViewInteraction$1.call(ViewInteraction.java:3)
	at java.util.concurrent.FutureTask.run(FutureTask.java:237)
	at android.os.Handler.handleCallback(Handler.java:739)
	at android.os.Handler.dispatchMessage(Handler.java:95)
	at android.os.Looper.loop(Looper.java:135)
	at android.app.ActivityThread.main(ActivityThread.java:5254)
	at java.lang.reflect.Method.invoke(Native Method)
	at java.lang.reflect.Method.invoke(Method.java:372)
	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)

@danesfeder danesfeder self-assigned this Jul 19, 2018
@danesfeder danesfeder added bug Defect to be fixed. navigation-ui labels Jul 19, 2018
@danesfeder danesfeder added this to the 0.16.0 milestone Jul 19, 2018
@danesfeder danesfeder force-pushed the dan-sublist-illegal branch 2 times, most recently from 17dc5e4 to a2e7657 Compare July 19, 2018 16:18
Copy link
Contributor

@Guardiola31337 Guardiola31337 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a test covering this? If not, it'd be 💯 to add.

@danesfeder danesfeder force-pushed the dan-sublist-illegal branch 2 times, most recently from 89e6b97 to 8d9d4a0 Compare July 19, 2018 17:17
Copy link
Contributor

@Guardiola31337 Guardiola31337 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding a test checking the fixed issue ❤️

🚢 @danesfeder

@danesfeder danesfeder force-pushed the dan-sublist-illegal branch 2 times, most recently from 7386c6b to 99226ac Compare July 19, 2018 21:29
@Guardiola31337
Copy link
Contributor

CI is still reporting IllegalArgumentException

From AbstractList#subList docs 👀

IllegalArgumentException - if the endpoint indices are out of order (fromIndex > toIndex)

@danesfeder danesfeder merged commit a6bdaf8 into master Jul 20, 2018
@danesfeder danesfeder deleted the dan-sublist-illegal branch July 20, 2018 14:07
@danesfeder danesfeder mentioned this pull request Jul 20, 2018
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Defect to be fixed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants