Buggy code:
public class AnimationHandler extends Observable implements Runnable { private static Logger LOG = LoggerFactory . getLogger ( AnimationHandler . class ) ; private List < Animation > anis ; private int index = 0 ; private DMDClock clock ; private boolean clockActive ; private int clockCycles ; private EventHandler eventHandler ; private DMD dmd ; private volatile boolean stop = true ; private Scale scale ; private boolean showClock = true ; private int lastRenderedFrame = - 1 ; private byte [ ] mask ; private boolean forceRerender = false ; public AnimationHandler ( List < Animation > anis , DMDClock clock , DMD dmd ) { } public void run ( ) { } public void runInner ( ) { if ( clockActive ) { if ( ( clockCycles ) == 0 ) dmd . clear ( ) ; clock . renderTime ( dmd , false ) ; if ( ( ( ! ( stop ) ) && ( ( ( clockCycles ) ++ ) > 20 ) ) && ( ! ( anis . isEmpty ( ) ) ) ) { clockActive = false ; clockCycles = 0 ; clock . restart ( ) ; } if ( scale . isDisposed ( ) ) return ; eventHandler . notifyAni ( new com . rinke . solutions . pinball . animation . AniEvent ( Type . CLOCK ) ) ; } else { if ( ( ( anis ) == null ) || ( anis . isEmpty ( ) ) ) { clockActive = true ; } else { Animation ani = anis . get ( index ) ; if ( scale . isDisposed ( ) ) return ; scale . setMinimum ( ani . start ) ; scale . setMaximum ( ani . end ) ; scale . setIncrement ( ani . skip ) ; if ( ( ( ! ( forceRerender ) ) && ( stop ) ) && ( ( ani . actFrame ) == ( lastRenderedFrame ) ) ) return ; forceRerender = false ; dmd . clear ( ) ; if ( ani . addClock ( ) ) { if ( ani . isClockSmall ( ) ) clock . renderTime ( dmd , ani . isClockSmall ( ) , ani . getClockXOffset ( ) , ani . getClockYOffset ( ) , false ) ; else clock . renderTime ( dmd , false ) ; } Frame res = ani . render ( dmd , stop ) ; scale . setSelection ( ani . actFrame ) ; eventHandler . notifyAni ( new com . rinke . solutions . pinball . animation . AniEvent ( Type . ANI , ani . actFrame , ani , res . getHashes ( mask ) , res . timecode , res . delay , res . planes . size ( ) ) ) ; lastRenderedFrame = ani . actFrame ; <START_BUG> if ( ( res . planes . size ( ) ) == 3 ) { <END_BUG> if ( ( ani . getClockFrom ( ) ) > ( ani . getTransitionFrom ( ) ) ) dmd . writeNotAnd ( res . planes . get ( 2 ) . plane ) ; DMD tmp = new DMD ( dmd . getWidth ( ) , dmd . getHeight ( ) ) ; tmp . writeOr ( res ) ; tmp . writeAnd ( res . planes . get ( 2 ) . plane ) ; dmd . writeOr ( tmp . getFrame ( ) ) ; } else { if ( ani . addClock ( ) ) { DMD tmp = new DMD ( dmd . getWidth ( ) , dmd . getHeight ( ) ) ; tmp . writeOr ( res ) ; clock . renderTime ( tmp , true ) ; dmd . writeOr ( tmp . getFrame ( ) ) ; } else { dmd . writeOr ( res ) ; } } if ( ani . hasEnded ( ) ) { ani . restart ( ) ; if ( showClock ) clockActive = true ; ( index ) ++ ; if ( ( index ) >= ( anis . size ( ) ) ) { index = 0 ; } } } } } public int getRefreshDelay ( ) { } public void setEventHandler ( EventHandler handler ) { } public void start ( ) { } public void setStop ( boolean b ) { } public void stop ( ) { } public void prev ( ) { } public void next ( ) { } public void setScale ( Scale scale ) { } public void setPos ( int pos ) { } public void setAnimations ( List < Animation > anis2 ) { } public boolean isShowClock ( ) { } public void setShowClock ( boolean showClock ) { } public boolean isStopped ( ) { } public boolean isClockActive ( ) { } public void setClockActive ( boolean clockActive ) { } public void setMask ( byte [ ] mask ) { } }

Fix:
if ( res . containsMask ( ) ) {