Buggy code:
public static final CharSequenceTranslator ESCAPE_XML = new AggregateTranslator ( new LookupTranslator ( EntityArrays . BASIC_ESCAPE ( ) ) , new LookupTranslator ( EntityArrays . APOS_ESCAPE ( ) ) ) ; public static final CharSequenceTranslator ESCAPE_HTML3 = new AggregateTranslator ( new LookupTranslator ( EntityArrays . BASIC_ESCAPE ( ) ) , new LookupTranslator ( EntityArrays . ISO8859_1_ESCAPE ( ) ) ) ; public static final CharSequenceTranslator ESCAPE_HTML4 = new AggregateTranslator ( new LookupTranslator ( EntityArrays . BASIC_ESCAPE ( ) ) , new LookupTranslator ( EntityArrays . ISO8859_1_ESCAPE ( ) ) , new LookupTranslator ( EntityArrays . HTML40_EXTENDED_ESCAPE ( ) ) ) ; public static final CharSequenceTranslator ESCAPE_CSV = new StringEscapeUtils . CsvEscaper ( ) ; static class CsvEscaper extends CharSequenceTranslator { private static final char CSV_DELIMITER = ',' ; private static final char CSV_QUOTE = '"' ; private static final String CSV_QUOTE_STR = String . valueOf ( StringEscapeUtils . CsvEscaper . CSV_QUOTE ) ; private static final char [ ] CSV_SEARCH_CHARS = new char [ ] { StringEscapeUtils . CsvEscaper . CSV_DELIMITER , StringEscapeUtils . CsvEscaper . CSV_QUOTE , CharUtils . CR , CharUtils . LF } ; @ Override public int translate ( final CharSequence input , final int index , final Writer out ) throws IOException { if ( index != 0 ) { throw new IllegalStateException ( "CsvEscaper<seq2seq4repair_space>should<seq2seq4repair_space>never<seq2seq4repair_space>reach<seq2seq4repair_space>the<seq2seq4repair_space>[1]<seq2seq4repair_space>index" ) ; } if ( StringUtils . containsNone ( input . toString ( ) , StringEscapeUtils . CsvEscaper . CSV_SEARCH_CHARS ) ) { out . write ( input . toString ( ) ) ; } else { out . write ( StringEscapeUtils . CsvEscaper . CSV_QUOTE ) ; out . write ( StringUtils . replace ( input . toString ( ) , StringEscapeUtils . CsvEscaper . CSV_QUOTE_STR , ( ( StringEscapeUtils . CsvEscaper . CSV_QUOTE_STR ) + ( StringEscapeUtils . CsvEscaper . CSV_QUOTE_STR ) ) ) ) ; out . write ( StringEscapeUtils . CsvEscaper . CSV_QUOTE ) ; } return input . length ( ) ; } } public static final CharSequenceTranslator UNESCAPE_JAVA = new AggregateTranslator ( new OctalUnescaper ( ) , new UnicodeUnescaper ( ) , new LookupTranslator ( EntityArrays . JAVA_CTRL_CHARS_UNESCAPE ( ) ) , new LookupTranslator ( new String [ ] [ ] { new String [ ] { "\\\\" , "\\" } , new String [ ] { "\\\"" , "\"" } , new String [ ] { "\\\'" , "'" } , new String [ ] { "\\" , "" } } ) ) ; public static final CharSequenceTranslator UNESCAPE_ECMASCRIPT = StringEscapeUtils . UNESCAPE_JAVA ; public static final CharSequenceTranslator UNESCAPE_HTML3 = new AggregateTranslator ( new LookupTranslator ( EntityArrays . BASIC_UNESCAPE ( ) ) , new LookupTranslator ( EntityArrays . ISO8859_1_UNESCAPE ( ) ) , new NumericEntityUnescaper ( ) ) ; public static final CharSequenceTranslator UNESCAPE_HTML4 = new AggregateTranslator ( new LookupTranslator ( EntityArrays . BASIC_UNESCAPE ( ) ) , new LookupTranslator ( EntityArrays . ISO8859_1_UNESCAPE ( ) ) , new LookupTranslator ( EntityArrays . HTML40_EXTENDED_UNESCAPE ( ) ) , new NumericEntityUnescaper ( ) ) ; public static final CharSequenceTranslator UNESCAPE_XML = new AggregateTranslator ( new LookupTranslator ( EntityArrays . BASIC_UNESCAPE ( ) ) , new LookupTranslator ( EntityArrays . APOS_UNESCAPE ( ) ) , new NumericEntityUnescaper ( ) ) ; public static final CharSequenceTranslator UNESCAPE_CSV = new StringEscapeUtils . CsvUnescaper ( ) ; static class CsvUnescaper extends CharSequenceTranslator { private static final char CSV_DELIMITER = ',' ; private static final char CSV_QUOTE = '"' ; private static final String CSV_QUOTE_STR = String . valueOf ( StringEscapeUtils . CsvUnescaper . CSV_QUOTE ) ; private static final char [ ] CSV_SEARCH_CHARS = new char [ ] { StringEscapeUtils . CsvUnescaper . CSV_DELIMITER , StringEscapeUtils . CsvUnescaper . CSV_QUOTE , CharUtils . CR , CharUtils . LF } ; @ Override public int translate ( final CharSequence input , final int index , final Writer out ) throws IOException { if ( index != 0 ) { throw new IllegalStateException ( "CsvUnescaper<seq2seq4repair_space>should<seq2seq4repair_space>never<seq2seq4repair_space>reach<seq2seq4repair_space>the<seq2seq4repair_space>[1]<seq2seq4repair_space>index" ) ; } if ( ( ( input . charAt ( 0 ) ) != ( StringEscapeUtils . CsvUnescaper . CSV_QUOTE ) ) || ( ( input . charAt ( ( ( input . length ( ) ) - 1 ) ) ) != ( StringEscapeUtils . CsvUnescaper . CSV_QUOTE ) ) ) { out . write ( input . toString ( ) ) ; return input . length ( ) ; } <START_BUG> String quoteless = input . subSequence ( 1 , ( ( input . length ( ) ) - 1 ) ) . toString ( ) ; <END_BUG> if ( StringUtils . containsAny ( quoteless , StringEscapeUtils . CsvUnescaper . CSV_SEARCH_CHARS ) ) { out . write ( StringUtils . replace ( quoteless , ( ( StringEscapeUtils . CsvUnescaper . CSV_QUOTE_STR ) + ( StringEscapeUtils . CsvUnescaper . CSV_QUOTE_STR ) ) , StringEscapeUtils . CsvUnescaper . CSV_QUOTE_STR ) ) ; } else { out . write ( input . toString ( ) ) ; } return input . length ( ) ; } } public StringEscapeUtils ( ) { } public static final String escapeJava ( final String input ) { } public static final String escapeEcmaScript ( final String input ) { } public static final String unescapeJava ( final String input ) { } public static final String unescapeEcmaScript ( final String input ) { } public static final String escapeHtml4 ( final String input ) { } public static final String escapeHtml3 ( final String input ) { } public static final String unescapeHtml4 ( final String input ) { } public static final String unescapeHtml3 ( final String input ) { } public static final String escapeXml ( final String input ) { } public static final String unescapeXml ( final String input ) { } public static final String escapeCsv ( final String input ) { } public static final String unescapeCsv ( final String input ) { } }

Fix:
final String quoteless = input . subSequence ( 1 , ( ( input . length ( ) ) - 1 ) ) . toString ( ) ;