The method original.getTriggerBuilder() should return a trigger builder with all fields set the same as on original. However, the misfire instruction is not always set in the builder correctly.
The following code shows the issue:
@Test
public void testClone()
{
final CronTrigger original = TriggerBuilder.newTrigger()
.withSchedule( CronScheduleBuilder.dailyAtHourAndMinute( 10, 0 )
.withMisfireHandlingInstructionIgnoreMisfires() )
.build();
final CronTrigger clone = original.getTriggerBuilder().build();
System.out.println( "original=" + original.getMisfireInstruction() );
System.out.println( "clone =" + clone.getMisfireInstruction() );
}
I would expect the value returned by getMisfireInstruction() to be the same for both triggers. However, clone has a the misfire strategy of 0 (Smart).