Skip to content

CronTrigger.getTriggerBuilder() changes misfire instruction from "ignore misfire" to "smart" #505

Closed
@wrwatson

Description

@wrwatson

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).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions