Buggy code:
@ IocBean ( name = "t_msg_mail" ) public class MesssageMailMaker implements TimerHandler { private static final Log log = Logs . get ( ) ; @ Inject ( "refer:serviceFactory" ) private ZTaskFactory factory ; @ Override public String doHandle ( String name , Timering ing ) { final Map < String , List < Message > > map = new HashMap < String , List < Message > > ( ) ; <START_BUG> factory . messages ( ) . each ( null , "!R!N:" , null , 0 , new org . nutz . lang . Each < Message > ( ) { <END_BUG> public void invoke ( int index , Message msg , int length ) { List < Message > list = map . get ( msg . getOwner ( ) ) ; if ( null == list ) { list = new LinkedList < Message > ( ) ; map . put ( msg . getOwner ( ) , list ) ; } list . add ( msg ) ; } } ) ; if ( MesssageMailMaker . log . isDebugEnabled ( ) ) MesssageMailMaker . log . debugf ( "MailMaker:<seq2seq4repair_space>found<seq2seq4repair_space>%d<seq2seq4repair_space>users<seq2seq4repair_space>%s" , map . size ( ) , Strings . dup ( '*' , 40 ) ) ; for ( String unm : map . keySet ( ) ) { User u = factory . users ( ) . get ( unm ) ; if ( ( null == u ) || ( null == ( u . getEmail ( ) ) ) ) continue ; List < Message > list = map . get ( unm ) ; if ( ( null == list ) || ( list . isEmpty ( ) ) ) { continue ; } if ( MesssageMailMaker . log . isDebugEnabled ( ) ) MesssageMailMaker . log . debugf ( "<seq2seq4repair_space>-<seq2seq4repair_space>MailMaker:<seq2seq4repair_space>will<seq2seq4repair_space>send<seq2seq4repair_space>to<seq2seq4repair_space>'%s'" , unm ) ; Date now = Times . now ( ) ; StringBuilder sb = new StringBuilder ( ) ; sb . append ( ( ( "Message<seq2seq4repair_space>in<seq2seq4repair_space>zTask<seq2seq4repair_space>@<seq2seq4repair_space>" + ( Times . sDT ( now ) ) ) + "<seq2seq4repair_space>:<seq2seq4repair_space>\n\n" ) ) ; for ( Message msg : list ) { sb . append ( "<seq2seq4repair_space>[" ) . append ( Times . sDT ( msg . getCreateTime ( ) ) ) . append ( "]<seq2seq4repair_space>-<seq2seq4repair_space>" ) ; sb . append ( msg . getText ( ) ) ; sb . append ( "\n" ) ; } sb . append ( "\n\n" ) ; Message firstMsg = list . get ( 0 ) ; String subject = String . format ( "[zTask:%d]<seq2seq4repair_space>%s<seq2seq4repair_space>" , list . size ( ) , firstMsg . getText ( ) . replaceAll ( "[\\[]?[0-9a-f]{24}[\\]]?" , "" ) ) ; if ( MesssageMailMaker . log . isDebugEnabled ( ) ) MesssageMailMaker . log . debugf ( "<seq2seq4repair_space>-<seq2seq4repair_space>MailMaker:<seq2seq4repair_space>mail<seq2seq4repair_space>is:<seq2seq4repair_space>\'%s\':\n%s" , subject , sb ) ; MailObj mo = ZTasks . textMail ( subject , sb . toString ( ) ) ; mo . setTos ( Lang . array ( u . getName ( ) ) ) ; if ( MesssageMailMaker . log . isDebugEnabled ( ) ) MesssageMailMaker . log . debugf ( "<seq2seq4repair_space>-<seq2seq4repair_space>MailMaker:<seq2seq4repair_space>mail<seq2seq4repair_space>to<seq2seq4repair_space>@%s(%s)" , u . getName ( ) , u . getEmail ( ) ) ; factory . mails ( ) . joinMail ( mo ) ; if ( MesssageMailMaker . log . isDebugEnabled ( ) ) MesssageMailMaker . log . debugf ( "<seq2seq4repair_space>-<seq2seq4repair_space>MailMaker:<seq2seq4repair_space>after<seq2seq4repair_space>join,<seq2seq4repair_space>queue(%d)" , factory . mails ( ) . count ( ) ) ; for ( Message msg : list ) factory . messages ( ) . setNotified ( msg , now ) ; if ( MesssageMailMaker . log . isDebugEnabled ( ) ) { MesssageMailMaker . log . debugf ( "<seq2seq4repair_space>-<seq2seq4repair_space>MailMaker:<seq2seq4repair_space>set<seq2seq4repair_space>noti<seq2seq4repair_space>for<seq2seq4repair_space>%d<seq2seq4repair_space>messages" , list . size ( ) ) ; MesssageMailMaker . log . debugf ( "<seq2seq4repair_space>-<seq2seq4repair_space>MailMaker:<seq2seq4repair_space>%s<seq2seq4repair_space>--<seq2seq4repair_space>NEXT<seq2seq4repair_space>LOOP<seq2seq4repair_space>--" , Strings . dup ( '-' , 28 ) ) ; } } return ( "OK:" + ( map . size ( ) ) ) + "<seq2seq4repair_space>users" ; } }

Fix:
factory . messages ( ) . each ( null , "!R!N:" , null , false , 0 , new org . nutz . lang . Each < Message > ( ) {