Buggy code:
@ JsonAutoDetect ( fieldVisibility = JsonAutoDetect . Visibility . NONE , getterVisibility = JsonAutoDetect . Visibility . NONE , isGetterVisibility = JsonAutoDetect . Visibility . NONE , setterVisibility = JsonAutoDetect . Visibility . NONE ) public class JobInstance extends RootPersistentEntity implements Comparable < JobInstance > { public static final String JOB_WORKING_DIR_PREFIX = "kylin-" ; public static final String YARN_APP_ID = "yarn_application_id" ; public static final String YARN_APP_URL = "yarn_application_tracking_url" ; public static final String MR_JOB_ID = "mr_job_id" ; public static final String HDFS_BYTES_WRITTEN = "hdfs_bytes_written" ; public static final String SOURCE_RECORDS_COUNT = "source_records_count" ; public static final String SOURCE_RECORDS_SIZE = "source_records_size" ; public static String getStepIdentity ( JobInstance jobInstance , JobInstance . JobStep jobStep ) { } public static String getJobIdentity ( JobInstance jobInstance ) { } public static String getJobWorkingDir ( JobInstance jobInstance , JobEngineConfig engineConfig ) { } public static String getJobWorkingDir ( String jobUuid , String hdfsWorkdingDir ) { } @ JsonProperty ( "name" ) private String name ; @ JsonProperty ( "type" ) private CubeBuildTypeEnum type ; @ JsonProperty ( "duration" ) private long duration ; @ JsonProperty ( "related_cube" ) private String relatedCube ; @ JsonProperty ( "related_segment" ) private String relatedSegment ; @ JsonProperty ( "exec_start_time" ) private long execStartTime ; @ JsonProperty ( "exec_end_time" ) private long execEndTime ; @ JsonProperty ( "mr_waiting" ) private long mrWaiting = 0 ; @ JsonManagedReference @ JsonProperty ( "steps" ) private List < JobInstance . JobStep > steps ; @ JsonProperty ( "submitter" ) private String submitter ; public JobInstance . JobStep getRunningStep ( ) { } @ JsonProperty ( "progress" ) public double getProgress ( ) { } @ JsonProperty ( "job_status" ) public JobStatusEnum getStatus ( ) { } public String getName ( ) { } public void setName ( String name ) { } public CubeBuildTypeEnum getType ( ) { } public void setType ( CubeBuildTypeEnum type ) { } public long getDuration ( ) { } public void setDuration ( long duration ) { } public String getRelatedCube ( ) { } public void setRelatedCube ( String relatedCube ) { } public String getRelatedSegment ( ) { } public void setRelatedSegment ( String relatedSegment ) { } public long getExecStartTime ( ) { } public void setExecStartTime ( long execStartTime ) { } public long getExecEndTime ( ) { } public void setExecEndTime ( long execEndTime ) { } public long getMrWaiting ( ) { } public void setMrWaiting ( long mrWaiting ) { } public List < JobInstance . JobStep > getSteps ( ) { } public void clearSteps ( ) { } public void addSteps ( Collection < JobInstance . JobStep > steps ) { } public void addStep ( JobInstance . JobStep step ) { } public void addStep ( int index , JobInstance . JobStep step ) { } public JobInstance . JobStep findStep ( String stepName ) { } public String getSubmitter ( ) { } public void setSubmitter ( String submitter ) { } @ JsonIgnoreProperties ( ignoreUnknown = true ) public static class JobStep implements Comparable < JobInstance . JobStep > { @ JsonBackReference private JobInstance jobInstance ; @ JsonProperty ( "name" ) private String name ; @ JsonProperty ( "sequence_id" ) private int sequenceID ; @ JsonProperty ( "exec_cmd" ) private String execCmd ; @ JsonProperty ( "interrupt_cmd" ) private String InterruptCmd ; @ JsonProperty ( "exec_start_time" ) private long execStartTime ; @ JsonProperty ( "exec_end_time" ) private long execEndTime ; @ JsonProperty ( "exec_wait_time" ) private long execWaitTime ; @ JsonProperty ( "step_status" ) private JobStepStatusEnum status ; @ JsonProperty ( "cmd_type" ) private JobStepCmdTypeEnum cmdType = JobStepCmdTypeEnum . SHELL_CMD_HADOOP ; @ JsonProperty ( "info" ) private ConcurrentHashMap < String , String > info ; @ JsonProperty ( "run_async" ) private boolean runAsync = false ; private ConcurrentHashMap < String , String > getInfo ( ) { } public void putInfo ( String key , String value ) { } public String getInfo ( String key ) { } public void clearInfo ( ) { } public String getName ( ) { } public void setName ( String name ) { } public int getSequenceID ( ) { } public void setSequenceID ( int sequenceID ) { } public String getExecCmd ( ) { } public void setExecCmd ( String execCmd ) { } public JobStepStatusEnum getStatus ( ) { } public void setStatus ( JobStepStatusEnum status ) { } public long getExecStartTime ( ) { } public void setExecStartTime ( long execStartTime ) { } public long getExecEndTime ( ) { } public void setExecEndTime ( long execEndTime ) { } public long getExecWaitTime ( ) { } public void setExecWaitTime ( long execWaitTime ) { } public String getInterruptCmd ( ) { } public void setInterruptCmd ( String interruptCmd ) { } public JobStepCmdTypeEnum getCmdType ( ) { } public void setCmdType ( JobStepCmdTypeEnum cmdType ) { } public boolean isRunAsync ( ) { } public void setRunAsync ( boolean runAsync ) { } public JobInstance getJobInstance ( ) { } @ Override public int hashCode ( ) { } @ Override public boolean equals ( Object obj ) { } @ Override public int compareTo ( JobInstance . JobStep o ) { } } @ Override public int compareTo ( JobInstance o ) { <START_BUG> return ( ( int ) ( ( o . lastModified ) - ( this . lastModified ) ) ) ; <END_BUG> } }

Fix:
return ( o . lastModified ) < ( this . lastModified ) ? - 1 : ( o . lastModified ) > ( this . lastModified ) ? 1 : 0 ;