Buggy code:
@ SharedLoader public class HDFS2FileSink extends AbstractHdfsOperator implements StateHandler { private static final String CLASS_NAME = "com.ibm.streamsx.hdfs.HDFS2FileSink" ; private static final String CONSISTEN_ASPECT = "com.ibm.streamsx.hdfs.HDFS2FileSink.consistent" ; private static Logger LOGGER = Logger . getLogger ( ( ( ( LoggerNames . LOG_FACILITY ) + "." ) + ( HDFS2FileSink . CLASS_NAME ) ) , "com.ibm.streamsx.hdfs.BigDataMessages" ) ; private static Logger TRACE = Logger . getLogger ( HDFS2FileSink . CLASS_NAME ) ; private String rawFileName = "" ; private String file = null ; private String timeFormat = "yyyyMMdd_HHmmss" ; private String currentFileName ; private HdfsFile fFileToWrite ; private long bytesPerFile = - 1 ; private long tuplesPerFile = - 1 ; private double timePerFile = - 1 ; private boolean closeOnPunct = false ; private String encoding = null ; private String fileAttrName = null ; private int dataIndex = 0 ; private int fileIndex = - 1 ; private boolean dynamicFilename ; private MetaType dataType = null ; private int fileNum = 0 ; private boolean hasOutputPort = false ; private StreamingOutput < OutputTuple > outputPort ; private LinkedBlockingQueue < OutputTuple > outputPortQueue ; private Thread outputPortThread ; private Thread fFileTimerThread ; private HDFS2FileSink . InitialState initState ; private boolean isRestarting ; private ConsistentRegionContext crContext ; private class InitialState { String path ; String rawFilename ; private InitialState ( ) { } } @ ContextCheck ( compile = true ) public static void checkOutputPort ( OperatorContextChecker checker ) { } @ Parameter ( name = IHdfsConstants . PARAM_FILE_NAME_ATTR , optional = true , description = "The<seq2seq4repair_space>name<seq2seq4repair_space>of<seq2seq4repair_space>the<seq2seq4repair_space>attribute<seq2seq4repair_space>containing<seq2seq4repair_space>the<seq2seq4repair_space>filename." ) public void setFilenameAttr ( String name ) { } @ Parameter ( optional = true ) public void setFile ( String file ) { } public String getFile ( ) { } public String getCurrentFileName ( ) { } @ Parameter ( optional = true ) public void setTimeFormat ( String timeFormat ) { } @ Parameter ( optional = true ) public void setBytesPerFile ( long bytesPerFile ) { } public long getBytesPerFile ( ) { } @ Parameter ( optional = true ) public void setTuplesPerFile ( long tuplesPerFile ) { } public long getTuplesPerFile ( ) { } @ Parameter ( optional = true ) public void setTimePerFile ( double timePerFile ) { } public double getTimePerFile ( ) { } @ Parameter ( optional = true ) public void setCloseOnPunct ( boolean closeOnPunct ) { } public boolean isCloseOnPunct ( ) { } @ Parameter ( optional = true ) public void setEncoding ( String encoding ) { } public String getEncoding ( ) { } @ ContextCheck ( compile = true ) public static void checkInputPortSchema ( OperatorContextChecker checker ) throws Exception { } @ ContextCheck ( compile = true ) public static void checkCompileParameters ( OperatorContextChecker checker ) throws Exception { } @ ContextCheck ( compile = true ) public static void checkConsistentRegion ( OperatorContextChecker checker ) { OperatorContext opContext = checker . getOperatorContext ( ) ; ConsistentRegionContext crContext = opContext . getOptionalContext ( ConsistentRegionContext . class ) ; if ( crContext != null ) { if ( crContext . isStartOfRegion ( ) ) { <START_BUG> checker . setInvalidContext ( "This<seq2seq4repair_space>operator<seq2seq4repair_space>cannot<seq2seq4repair_space>be<seq2seq4repair_space>at<seq2seq4repair_space>the<seq2seq4repair_space>start<seq2seq4repair_space>of<seq2seq4repair_space>a<seq2seq4repair_space>consistent<seq2seq4repair_space>region." , null ) ; <END_BUG> } } } @ ContextCheck ( compile = false ) public static void checkParameters ( OperatorContextChecker checker ) throws Exception { } @ ContextCheck ( compile = false ) public static void checkFileAttributeName ( OperatorContextChecker checker ) { } @ ContextCheck ( compile = false ) public static void checkUriMatch ( OperatorContextChecker checker ) throws Exception { } @ Override public void initialize ( OperatorContext context ) throws Exception { } private void createFile ( String filename ) { } private void createFileTimer ( final double time , final HdfsFile file ) { } private void refreshCurrentFileName ( String baseName ) throws UnknownHostException { } public int getNextFileNum ( ) { } @ Override public void processPunctuation ( StreamingInput < Tuple > arg0 , Punctuation punct ) throws Exception { } private void closeFile ( ) throws Exception { } @ Override public synchronized void process ( StreamingInput < Tuple > stream , Tuple tuple ) throws Exception { } private void submitOnOutputPort ( String filename , long size ) throws Exception { } @ Override public void shutdown ( ) throws Exception { } private void fileTimerExpired ( final HdfsFile file ) throws Exception { } @ Override public void close ( ) throws IOException { } @ Override public void checkpoint ( Checkpoint checkpoint ) throws Exception { } @ Override public void drain ( ) throws Exception { } @ Override public void reset ( Checkpoint checkpoint ) throws Exception { } @ Override public void resetToInitialState ( ) throws Exception { } @ Override public void retireCheckpoint ( long id ) throws Exception { } private boolean isRestarting ( ) { } private void initRestarting ( OperatorContext opContext ) { } private void unsetRestarting ( ) { } @ Override protected void process ( ) throws Exception { } }

Fix:
checker . setInvalidContext ( "The<seq2seq4repair_space>following<seq2seq4repair_space>operator<seq2seq4repair_space>cannot<seq2seq4repair_space>be<seq2seq4repair_space>the<seq2seq4repair_space>start<seq2seq4repair_space>of<seq2seq4repair_space>a<seq2seq4repair_space>consistent<seq2seq4repair_space>region:<seq2seq4repair_space>HDFS2FileSink." , null ) ;