Buggy code:
public class FilenameUtils { private static final int NOT_FOUND = - 1 ; 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 ( final char ch ) { } public static String normalize ( final String filename ) { } public static String normalize ( final String filename , final boolean unixSeparator ) { } public static String normalizeNoEndSeparator ( final String filename ) { } public static String normalizeNoEndSeparator ( final String filename , final boolean unixSeparator ) { } private static String doNormalize ( final String filename , final char separator , final boolean keepSeparator ) { } public static String concat ( final String basePath , final String fullFilenameToAdd ) { } public static boolean directoryContains ( final String canonicalParent , final String canonicalChild ) throws IOException { } public static String separatorsToUnix ( final String path ) { } public static String separatorsToWindows ( final String path ) { } public static String separatorsToSystem ( final String path ) { } public static int getPrefixLength ( final String filename ) { } public static int indexOfLastSeparator ( final String filename ) { } public static int indexOfExtension ( final String filename ) { } public static String getPrefix ( final String filename ) { } public static String getPath ( final String filename ) { } public static String getPathNoEndSeparator ( final String filename ) { } private static String doGetPath ( final String filename , final int separatorAdd ) { } public static String getFullPath ( final String filename ) { } public static String getFullPathNoEndSeparator ( final String filename ) { } private static String doGetFullPath ( final String filename , final boolean includeSeparator ) { } public static String getName ( final String filename ) { } public static String getBaseName ( final String filename ) { } public static String getExtension ( final String filename ) { } public static String removeExtension ( final String filename ) { } public static boolean equals ( final String filename1 , final String filename2 ) { } public static boolean equalsOnSystem ( final String filename1 , final String filename2 ) { } public static boolean equalsNormalized ( final String filename1 , final String filename2 ) { } public static boolean equalsNormalizedOnSystem ( final String filename1 , final String filename2 ) { } public static boolean equals ( String filename1 , String filename2 , final boolean normalized , IOCase caseSensitivity ) { } public static boolean isExtension ( final String filename , final String extension ) { if ( filename == null ) { return false ; } <START_BUG> if ( ( extension == null ) || ( ( extension . length ( ) ) == 0 ) ) { <END_BUG> return ( FilenameUtils . indexOfExtension ( filename ) ) == ( FilenameUtils . NOT_FOUND ) ; } final String fileExt = FilenameUtils . getExtension ( filename ) ; return fileExt . equals ( extension ) ; } public static boolean isExtension ( final String filename , final String [ ] extensions ) { } public static boolean isExtension ( final String filename , final Collection < String > extensions ) { } public static boolean wildcardMatch ( final String filename , final String wildcardMatcher ) { } public static boolean wildcardMatchOnSystem ( final String filename , final String wildcardMatcher ) { } public static boolean wildcardMatch ( final String filename , final String wildcardMatcher , IOCase caseSensitivity ) { } static String [ ] splitOnTokens ( final String text ) { } }

Fix:
if ( ( extension == null ) || ( extension . isEmpty ( ) ) ) {