Buggy code:
public class FilenameUtils { public static final char EXTENSION_SEPARATOR = '.' ; public static final String EXTENSION_SEPARATOR_STR = Character . toString ( FilenameUtils . EXTENSION_SEPARATOR ) ; private static final char UNIX_SEPARATOR = '//' ; private static final char WINDOWS_SEPARATOR = '\\' ; private static final char SYSTEM_SEPARATOR = File . separatorChar ; private static final char OTHER_SEPARATOR ; public FilenameUtils ( ) { } static boolean isSystemWindows ( ) { } private static boolean isSeparator ( char ch ) { } public static String normalize ( String filename ) { } public static String normalize ( String filename , boolean unixSeparator ) { } public static String normalizeNoEndSeparator ( String filename ) { } public static String normalizeNoEndSeparator ( String filename , boolean unixSeparator ) { } private static String doNormalize ( String filename , char separator , boolean keepSeparator ) { } public static String concat ( String basePath , String fullFilenameToAdd ) { } public static String separatorsToUnix ( String path ) { } public static String separatorsToWindows ( String path ) { } public static String separatorsToSystem ( String path ) { } public static int getPrefixLength ( String filename ) { } public static int indexOfLastSeparator ( String filename ) { } public static int indexOfExtension ( String filename ) { } public static String getPrefix ( String filename ) { } public static String getPath ( String filename ) { } public static String getPathNoEndSeparator ( String filename ) { } private static String doGetPath ( String filename , int separatorAdd ) { } public static String getFullPath ( String filename ) { } public static String getFullPathNoEndSeparator ( String filename ) { } private static String doGetFullPath ( String filename , boolean includeSeparator ) { } public static String getName ( String filename ) { } public static String getBaseName ( String filename ) { } public static String getExtension ( String filename ) { } public static String removeExtension ( String filename ) { } public static boolean equals ( String filename1 , String filename2 ) { } public static boolean equalsOnSystem ( String filename1 , String filename2 ) { } public static boolean equalsNormalized ( String filename1 , String filename2 ) { } public static boolean equalsNormalizedOnSystem ( String filename1 , String filename2 ) { } public static boolean equals ( String filename1 , String filename2 , boolean normalized , IOCase caseSensitivity ) { } public static boolean isExtension ( String filename , String extension ) { } public static boolean isExtension ( String filename , String [ ] extensions ) { } public static boolean isExtension ( String filename , Collection < String > extensions ) { } public static boolean wildcardMatch ( String filename , String wildcardMatcher ) { } public static boolean wildcardMatchOnSystem ( String filename , String wildcardMatcher ) { } public static boolean wildcardMatch ( String filename , String wildcardMatcher , IOCase caseSensitivity ) { } static String [ ] splitOnTokens ( String text ) { if ( ( ( text . indexOf ( '?' ) ) == ( - 1 ) ) && ( ( text . indexOf ( '*' ) ) == ( - 1 ) ) ) { return new String [ ] { text } ; } char [ ] array = text . toCharArray ( ) ; ArrayList < String > list = new ArrayList < String > ( ) ; StringBuilder buffer = new StringBuilder ( ) ; for ( int i = 0 ; i < ( array . length ) ; i ++ ) { if ( ( ( array [ i ] ) == '?' ) || ( ( array [ i ] ) == '*' ) ) { if ( ( buffer . length ( ) ) != 0 ) { list . add ( buffer . toString ( ) ) ; buffer . setLength ( 0 ) ; } if ( ( array [ i ] ) == '?' ) { list . add ( "?" ) ; } else <START_BUG> if ( ( ( list . size ( ) ) == 0 ) || ( ( i > 0 ) && ( ( list . get ( ( ( list . size ( ) ) - 1 ) ) . equals ( "*" ) ) == false ) ) ) { <END_BUG> list . add ( "*" ) ; } } else { buffer . append ( array [ i ] ) ; } } if ( ( buffer . length ( ) ) != 0 ) { list . add ( buffer . toString ( ) ) ; } return list . toArray ( new String [ list . size ( ) ] ) ; } }

Fix:
if ( ( list . isEmpty ( ) ) || ( ( i > 0 ) && ( ( list . get ( ( ( list . size ( ) ) - 1 ) ) . equals ( "*" ) ) == false ) ) ) {