Buggy code:
private static final int CREATE_DSS_OBJECT = 2 ; private static final int END_DSS = 3 ; private static final int END_DDM_AND_DSS = 4 ; private static final int START_DDM = 5 ; private static final int END_DDM = 6 ; private static final int WRITE_BYTE = 7 ; private static final int WRITE_NETWORK_SHORT = 8 ; private static final int WRITE_NETWORK_INT = 9 ; private static final int WRITE_BYTES = 10 ; private static final int WRITE_CODEPOINT_4BYTES = 11 ; private static final int WRITE_SCALAR_1BYTE = 12 ; private static final int WRITE_SCALAR_2BYTES = 13 ; private static final int WRITE_SCALAR_BYTES = 14 ; private static final int WRITE_SCALAR_HEADER = 15 ; private static final int WRITE_SCALAR_STRING = 16 ; private static final int WRITE_SCALAR_PADDED_STRING = 17 ; private static final int WRITE_SCALAR_PADDED_BYTES = 18 ; private static final int WRITE_SHORT = 19 ; private static final int WRITE_INT = 20 ; private static final int WRITE_LONG = 21 ; private static final int WRITE_FLOAT = 22 ; private static final int WRITE_DOUBLE = 23 ; private static final int READ_REPLY_DSS = 24 ; private static final int READ_LENGTH_AND_CODEPOINT = 25 ; private static final int READ_CODEPOINT = 26 ; private static final int MARK_COLLECTION = 27 ; private static final int GET_CODEPOINT = 28 ; private static final int READ_BYTE = 29 ; private static final int READ_NETWORK_SHORT = 30 ; private static final int READ_SHORT = 31 ; private static final int READ_NETWORK_INT = 32 ; private static final int READ_INT = 33 ; private static final int READ_LONG = 34 ; private static final int READ_BOOLEAN = 35 ; private static final int READ_STRING = 36 ; private static final int READ_BYTES = 37 ; private static final int FLUSH = 38 ; private static final int DISPLAY = 39 ; private static final int CHECKERROR = 40 ; private static final int RESET = 41 ; private static final int CREATE_DSS_REPLY = 42 ; private static final int SKIP_DSS = 43 ; private static final int READ_SCALAR_2BYTES = 44 ; private static final int READ_SCALAR_1BYTE = 45 ; private static final int END_TEST = 46 ; private static final int SKIP_DDM = 47 ; private static final int INCLUDE = 48 ; private static final int SKIP_BYTES = 49 ; private static final int WRITE_PADDED_STRING = 50 ; private static final int WRITE_STRING = 51 ; private static final int WRITE_ENCODED_STRING = 52 ; private static final int WRITE_ENCODED_LDSTRING = 53 ; private static final int CHECK_SQLCARD = 54 ; private static final int MORE_DATA = 55 ; private static final int COMPLETE_TEST = 56 ; private static final int READ_SECMEC_SECCHKCD = 57 ; private static final String MULTIVAL_START = "MULTIVALSTART" ; private static final String MULTIVAL_SEP = "SEP" ; private static final String MULTIVAL_END = "MULTIVALEND" ; private Socket monitorSocket = null ; private InputStream monitorIs = null ; private OutputStream monitorOs = null ; private DDMWriter writer = new DDMWriter ( TestProto . ccsidManager , null , null ) ; private DDMReader reader ; private boolean failed = false ; private StreamTokenizer tkn ; private String current_filename ; public TestProto ( String filename ) { } private void processIncludeFile ( ) throws IOException , DRDAProtocolException { } private void processFile ( String filename ) throws IOException , DRDAProtocolException { String prev_filename = current_filename ; current_filename = filename ; String hostName = TestProto . getHostName ( ) ; BufferedReader fr ; try { fr = new BufferedReader ( new InputStreamReader ( new FileInputStream ( filename ) , "UTF-8" ) ) ; } catch ( FileNotFoundException fnfe ) { String userdir = System . getProperty ( "user.dir" ) ; String sep = System . getProperty ( "file.separator" ) ; <START_BUG> fr = new BufferedReader ( new InputStreamReader ( new FileInputStream ( ( ( ( ( userdir + sep ) + "extin" ) + sep ) + filename ) ) , "UTF-8" ) ) ; <END_BUG> } tkn = new StreamTokenizer ( fr ) ; int val ; while ( ( val = tkn . nextToken ( ) ) != ( StreamTokenizer . TT_EOF ) ) { switch ( val ) { case StreamTokenizer . TT_NUMBER : break ; case StreamTokenizer . TT_WORD : processCommand ( ) ; break ; case StreamTokenizer . TT_EOL : break ; } } current_filename = prev_filename ; } private void getConnection ( ) { } private void closeConnection ( ) { } private void reset ( ) { } private void completeTest ( ) { } private static void init ( ) { } private void processCommand ( ) throws IOException , DRDAProtocolException { } private void skipDss ( ) throws DRDAProtocolException { } private void skipDdm ( ) throws DRDAProtocolException { } private int getInt ( ) throws IOException { } private int convertHex ( String str ) throws IOException { } private boolean checkIntOrCP ( int val ) throws IOException { } private int getIntOrCP ( ) throws IOException { } private byte [ ] getBytes ( ) throws IOException { } private String getString ( ) throws IOException { } private int getCP ( ) throws IOException { } private int decodeCP ( String strval ) { } private void fail ( String msg ) throws IOException { } private void checkError ( ) throws IOException , DRDAProtocolException { } private void readLengthAndCodePoint ( ) throws IOException , DRDAProtocolException { } private void readSecMecAndSECCHKCD ( ) throws IOException , DRDAProtocolException { } private void cpError ( int cp , int reqCP ) throws IOException { } private byte [ ] getEBCDIC ( String str ) { } private void writeEncodedString ( String str , String encoding ) throws IOException { } private void writeEncodedLDString ( String str , String encoding , int len ) throws IOException { } private void checkSQLCARD ( int sqlCode , String sqlState ) throws IOException , DRDAProtocolException { } private static String getHostName ( ) { } }

Fix:
fr = new BufferedReader ( new InputStreamReader ( new FileInputStream ( ( ( userdir + sep ) + filename ) ) , "UTF-8" ) ) ;