[BUG] Timeline.selectFullRange() throws IllegalArgumentException

I think this must be a bug. After adding items to an IndexedContainer previously added as a graph data source, I selectFullRange(), otherwise the Timeline won’t display anything at all.

But sometimes it throws an Exception:


java.lang.IllegalArgumentException: End date must come after the start date.
	at com.vaadin.addon.timeline.Timeline.setVisibleDateRange(Timeline.java:2430)
	at com.vaadin.addon.timeline.Timeline.selectFullRange(Timeline.java:2439)
	at gui.view.patient.TimelinePreview.setSeries(TimelinePreview.java:62)
	at app.presenter.paziente.MeasurementsHelper2.getThumb(MeasurementsHelper2.java:42)
	at app.presenter.paziente.MeasurementsHelper2.setup(MeasurementsHelper2.java:18)
	at app.presenter.PazientePresenter.setupContent(PazientePresenter.java:84)
	at app.presenter.PazientePresenter.bind(PazientePresenter.java:32)
	at app.presenter.PazientePresenter.bind(PazientePresenter.java:16)
	at app.ui.framework.Presenter.enter(Presenter.java:23)
	at com.vaadin.navigator.Navigator.navigateTo(Navigator.java:568)
	at com.vaadin.navigator.Navigator.navigateTo(Navigator.java:523)
	at app.presenter.PazientePresenter$1.handle(PazientePresenter.java:42)
	at app.presenter.PazientePresenter$1.handle(PazientePresenter.java:38)
	at gui.view.store.StoreLeftView.buttonClick(StoreLeftView.java:40)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:508)

I don’t know if this is API misusage, but I think selectFullRange() should never fail.

After reading the Javadoc, I think this is because the Container must be explicitely sorted, or the behavior can effectively be surprising. Maybe not a bug in the code, but the Book (or even the javadoc header) should stress this point more.