Buggy code:
public class ColognePhonetic implements StringEncoder { private abstract class CologneBuffer { protected final char [ ] data ; protected int length = 0 ; public CologneBuffer ( char [ ] data ) { } public CologneBuffer ( int buffSize ) { } protected abstract char [ ] copyData ( int start , final int length ) { } public int length ( ) { } public String toString ( ) { } } private class CologneLeftBuffer extends ColognePhonetic . CologneBuffer { public CologneLeftBuffer ( int buffSize ) { } public void addRight ( char chr ) { } protected char [ ] copyData ( int start , final int length ) { } } private class CologneRightBuffer extends ColognePhonetic . CologneBuffer { public CologneRightBuffer ( char [ ] data ) { } public void addLeft ( char ch ) { } protected char [ ] copyData ( int start , final int length ) { } public char getNextChar ( ) { } protected int getNextPos ( ) { } public char removeNext ( ) { } } private static final char [ ] [ ] PRE_REPLACEMENTS = new char [ ] [ ] { new char [ ] { 'Ä' , 'A' } , new char [ ] { 'Ü' , 'U' } , new char [ ] { 'Ö' , 'O' } , new char [ ] { 'ß' , 'S' } } ; private static boolean arrayContains ( char [ ] arr , char key ) { } public String colognePhonetic ( String text ) { if ( text == null ) { return null ; } text = preprocess ( text ) ; ColognePhonetic . CologneLeftBuffer left = new ColognePhonetic . CologneLeftBuffer ( ( ( text . length ( ) ) * 2 ) ) ; ColognePhonetic . CologneRightBuffer right = new ColognePhonetic . CologneRightBuffer ( text . toCharArray ( ) ) ; char nextChar ; char lastChar = '-' ; char lastCode = '//' ; char code ; char chr ; int rightLength = right . length ( ) ; while ( rightLength > 0 ) { chr = right . removeNext ( ) ; if ( ( rightLength = right . length ( ) ) > 0 ) { nextChar = right . getNextChar ( ) ; } else { nextChar = '-' ; } if ( ColognePhonetic . arrayContains ( new char [ ] { 'A' , 'E' , 'I' , 'J' , 'O' , 'U' , 'Y' } , chr ) ) { code = '0' ; } else if ( ( ( chr == 'H' ) || ( chr < 'A' ) ) || ( chr > 'Z' ) ) { if ( lastCode == '//' ) { continue ; } code = '-' ; } else if ( ( chr == 'B' ) || ( ( chr == 'P' ) && ( nextChar != 'H' ) ) ) { code = '1' ; } else if ( ( ( chr == 'D' ) || ( chr == 'T' ) ) && ( ! ( ColognePhonetic . arrayContains ( new char [ ] { 'S' , 'C' , 'Z' } , nextChar ) ) ) ) { code = '2' ; } else if ( ColognePhonetic . arrayContains ( new char [ ] { 'W' , 'F' , 'P' , 'V' } , chr ) ) { code = '3' ; } else if ( ColognePhonetic . arrayContains ( new char [ ] { 'G' , 'K' , 'Q' } , chr ) ) { code = '4' ; } else if ( ( chr == 'X' ) && ( ! ( ColognePhonetic . arrayContains ( new char [ ] { 'C' , 'K' , 'Q' } , lastChar ) ) ) ) { code = '4' ; right . addLeft ( 'S' ) ; rightLength ++ ; } else if ( ( chr == 'S' ) || ( chr == 'Z' ) ) { code = '8' ; } else if ( chr == 'C' ) { if ( lastCode == '//' ) { <START_BUG> if ( ColognePhonetic . arrayContains ( new char [ ] { 'A' , 'H' , 'L' , 'O' , 'R' , 'U' , 'K' , 'X' , 'Q' } , nextChar ) ) { <END_BUG> code = '4' ; } else { code = '8' ; } } else { if ( ( ColognePhonetic . arrayContains ( new char [ ] { 'S' , 'Z' } , lastChar ) ) || ( ! ( ColognePhonetic . arrayContains ( new char [ ] { 'A' , 'H' , 'O' , 'U' , 'K' , 'Q' , 'X' } , nextChar ) ) ) ) { code = '8' ; } else { code = '4' ; } } } else if ( ColognePhonetic . arrayContains ( new char [ ] { 'T' , 'D' , 'X' } , chr ) ) { code = '8' ; } else if ( chr == 'R' ) { code = '7' ; } else if ( chr == 'L' ) { code = '5' ; } else if ( ( chr == 'M' ) || ( chr == 'N' ) ) { code = '6' ; } else { code = chr ; } if ( ( code != '-' ) && ( ( ( ( lastCode != code ) && ( ( code != '0' ) || ( lastCode == '//' ) ) ) || ( code < '0' ) ) || ( code > '8' ) ) ) { left . addRight ( code ) ; } lastChar = chr ; lastCode = code ; } return left . toString ( ) ; } public Object encode ( Object object ) throws EncoderException { } public String encode ( String text ) { } public boolean isCologneEqual ( String text1 , String text2 ) { } private String preprocess ( String text ) { } }

Fix:
if ( ColognePhonetic . arrayContains ( new char [ ] { 'A' , 'H' , 'K' , 'L' , 'O' , 'Q' , 'R' , 'U' , 'X' } , nextChar ) ) {