Unexpected behavior when using withHandler((state, detector, increasing)->...) after eventsLogger.monitorDetector(detector)

Dear all,
I noticed that in Orekit version 11.1.2 the following pseudo code was working fine, i.e. it was entering the withHandler() method and I was able to use the evaluated variables state, detector, increasing:

EventsLogger eventsLogger = new EventsLogger();
eventsLogger.monitorDetector(new DateDetector(maneuverStartDate))
.withHandler((state, detector, increasing) → {System.out.println(“entering here”);})

While in the latest version of Orekit 12.0.1, the withHandler() is not working anymore, it is not entering properly the withHandler() method and in my pseudo code above it is in practice not able to print the message “entering here”.

Is there a different way in Orekit 12.0.1 to use withHandler((state, detector, increasing) → {…}) after a eventsLogger.monitorDetector(detector) in order to use the variables state, detector and increasing?

Many thanks for your help.

I guess this is due to the fix for issue 1016, which was introduced in January 2023.
Just for double checking, can you confirm that the detector used in the propagation is the one returned by monitorDetector? I think you did the right thing and I think you identified a bug.

Dear Luc,
many thanks for your reply.

Yes, I checked and the detector used in the propagation is the one returned by monitorDetector.

Do you think is there a way to overcome this problem temporarily before the fix is available?

Many thanks.

You may try to add the handler to the DateDetector before wrapping it into the logger.

Also please open an issue so we don’t forget about this.

Dear Luc,
adding the handler to the detector before the wrapping into the monitorDetector works fine. I will open an issue.

When do you expect a fix for this issue will be available?

Many thanks.

Could probably be done for 12.0.2, i.e. very soon.

Dear Luc,
many thanks for the information.

I created an issue here:

Hi Francesca,

If you feel like providing the fix yourself, don’t hesitate.