Buggy code:
public SwordBookMetaData ( File file , URI bookRootPath ) throws IOException , BookException { } public SwordBookMetaData ( byte [ ] buffer , String bookConf ) throws IOException { } @ Override public boolean isQuestionable ( ) { } @ Override public boolean isSupported ( ) { } @ Override public boolean isEnciphered ( ) { } @ Override public boolean isLocked ( ) { } @ Override public boolean unlock ( String unlockKey ) { } @ Override public String getUnlockKey ( ) { } public String getName ( ) { } public String getBookCharset ( ) { } @ Override public KeyType getKeyType ( ) { } public BookType getBookType ( ) { } public Filter getFilter ( ) { } public File getConfigFile ( ) { } @ Override public void setLibrary ( URI library ) throws BookException { } public BookCategory getBookCategory ( ) { } @ Override public Document toOSIS ( ) { } public static void normalize ( Writer out , final IniSection config , final String [ ] order ) { } public String getInitials ( ) { } String getInternalName ( ) { } public String getAbbreviation ( ) { } public boolean isLeftToRight ( ) { } @ Override public boolean hasFeature ( FeatureType feature ) { } public Set < String > getPropertyKeys ( ) { } public String getProperty ( String key ) { } @ Override public void setProperty ( String key , String value ) { } public void putProperty ( String key , String value , boolean forFrontend ) { } public void putProperty ( String key , String value , MetaDataLocator metaDataLocator ) { } private IniSection load ( File file , org . crosswire . common . util . Filter < String > keepers ) throws IOException { } private IniSection load ( byte [ ] buffer , org . crosswire . common . util . Filter < String > keepers ) throws IOException { IniSection config = new IniSection ( ) ; config . load ( buffer , SwordBookMetaData . ENCODING_UTF8 , keepers ) ; String encoding = config . get ( SwordBookMetaData . KEY_ENCODING ) ; if ( ! ( SwordBookMetaData . ENCODING_UTF8 . equalsIgnoreCase ( encoding ) ) ) { config . clear ( ) ; <START_BUG> config . load ( buffer , SwordBookMetaData . ENCODING_LATIN1 ) ; <END_BUG> } return config ; } private IniSection addConfig ( MetaDataLocator locator ) { } private void mergeConfig ( IniSection config ) { } private Object getValue ( String key ) { } private Element toRow ( OSISUtil . OSISFactory factory , String key , String value ) { } private Element toRow ( OSISUtil . OSISFactory factory , String key ) { } private Element toKeyCell ( OSISUtil . OSISFactory factory , String key ) { } private void adjustConfig ( ) { } private void adjustLanguage ( ) { } private void testLanguage ( String key , String lang ) { } private void adjustBookType ( ) { } private void adjustName ( ) { } private static void adjustHistory ( IniSection config ) { } public static void report ( final IniSection config ) { } private String bookConf ; private IniSection configAll ; private IniSection configJSword ; private IniSection configFrontend ; private boolean supported ; private BookCategory bookCat ; private BookType bookType ; private boolean questionable ; private File configFile ; private static final String [ ] REQUIRED = new String [ ] { SwordBookMetaData . KEY_ABBREVIATION , SwordBookMetaData . KEY_DESCRIPTION , KEY_LANG , KEY_CATEGORY , SwordBookMetaData . KEY_FEATURE , SwordBookMetaData . KEY_GLOBAL_OPTION_FILTER , SwordBookMetaData . KEY_SIGLUM1 , SwordBookMetaData . KEY_SIGLUM2 , SwordBookMetaData . KEY_SIGLUM3 , SwordBookMetaData . KEY_SIGLUM4 , SwordBookMetaData . KEY_SIGLUM5 , KEY_FONT , SwordBookMetaData . KEY_DATA_PATH , SwordBookMetaData . KEY_MOD_DRV , SwordBookMetaData . KEY_SOURCE_TYPE , SwordBookMetaData . KEY_BLOCK_TYPE , SwordBookMetaData . KEY_BLOCK_COUNT , SwordBookMetaData . KEY_COMPRESS_TYPE , SwordBookMetaData . KEY_ENCODING , SwordBookMetaData . KEY_DIRECTION , SwordBookMetaData . KEY_KEY_TYPE , SwordBookMetaData . KEY_DISPLAY_LEVEL , KEY_VERSIFICATION , SwordBookMetaData . KEY_CASE_SENSITIVE_KEYS , SwordBookMetaData . KEY_LOCAL_STRIP_FILTER , SwordBookMetaData . KEY_PREFERRED_CSS_XHTML , SwordBookMetaData . KEY_STRONGS_PADDING , SwordBookMetaData . KEY_SEARCH_OPTION , SwordBookMetaData . KEY_INSTALL_SIZE , KEY_SCOPE , KEY_BOOKLIST , SwordBookMetaData . KEY_CIPHER_KEY } ; private static final class KeyFilter implements org . crosswire . common . util . Filter < String > { public KeyFilter ( String [ ] keepers ) { } public boolean test ( String key ) { } private Set keepers ; } private static final Filter keyKeepers = new SwordBookMetaData . KeyFilter ( SwordBookMetaData . REQUIRED ) ; private static final String [ ] OSIS_INFO = new String [ ] { SwordBookMetaData . KEY_ABBREVIATION , SwordBookMetaData . KEY_DESCRIPTION , KEY_LANG , KEY_CATEGORY , SwordBookMetaData . KEY_LCSH , SwordBookMetaData . KEY_SWORD_VERSION_DATE , SwordBookMetaData . KEY_VERSION , SwordBookMetaData . KEY_HISTORY , SwordBookMetaData . KEY_OBSOLETES , SwordBookMetaData . KEY_GLOSSARY_FROM , SwordBookMetaData . KEY_GLOSSARY_TO , SwordBookMetaData . KEY_ABOUT , SwordBookMetaData . KEY_SHORT_PROMO , SwordBookMetaData . KEY_DISTRIBUTION_LICENSE , SwordBookMetaData . KEY_DISTRIBUTION_NOTES , SwordBookMetaData . KEY_DISTRIBUTION_SOURCE , SwordBookMetaData . KEY_SHORT_COPYRIGHT , SwordBookMetaData . KEY_COPYRIGHT , SwordBookMetaData . KEY_COPYRIGHT_DATE , SwordBookMetaData . KEY_COPYRIGHT_HOLDER , SwordBookMetaData . KEY_COPYRIGHT_CONTACT_NAME , SwordBookMetaData . KEY_COPYRIGHT_CONTACT_ADDRESS , SwordBookMetaData . KEY_COPYRIGHT_CONTACT_EMAIL , SwordBookMetaData . KEY_COPYRIGHT_CONTACT_NOTES , SwordBookMetaData . KEY_COPYRIGHT_NOTES , SwordBookMetaData . KEY_TEXT_SOURCE , SwordBookMetaData . KEY_FEATURE , SwordBookMetaData . KEY_GLOBAL_OPTION_FILTER , SwordBookMetaData . KEY_SIGLUM1 , SwordBookMetaData . KEY_SIGLUM2 , SwordBookMetaData . KEY_SIGLUM3 , SwordBookMetaData . KEY_SIGLUM4 , SwordBookMetaData . KEY_SIGLUM5 , KEY_FONT , SwordBookMetaData . KEY_DATA_PATH , SwordBookMetaData . KEY_MOD_DRV , SwordBookMetaData . KEY_SOURCE_TYPE , SwordBookMetaData . KEY_BLOCK_TYPE , SwordBookMetaData . KEY_BLOCK_COUNT , SwordBookMetaData . KEY_COMPRESS_TYPE , SwordBookMetaData . KEY_ENCODING , SwordBookMetaData . KEY_MINIMUM_VERSION , SwordBookMetaData . KEY_OSIS_VERSION , SwordBookMetaData . KEY_OSIS_Q_TO_TICK , SwordBookMetaData . KEY_DIRECTION , SwordBookMetaData . KEY_KEY_TYPE , SwordBookMetaData . KEY_DISPLAY_LEVEL , KEY_VERSIFICATION , SwordBookMetaData . KEY_CASE_SENSITIVE_KEYS , SwordBookMetaData . KEY_LOCAL_STRIP_FILTER , SwordBookMetaData . KEY_PREFERRED_CSS_XHTML , SwordBookMetaData . KEY_STRONGS_PADDING , SwordBookMetaData . KEY_SEARCH_OPTION , SwordBookMetaData . KEY_INSTALL_SIZE , KEY_SCOPE , KEY_BOOKLIST } ; private static final String [ ] HIDDEN = new String [ ] { SwordBookMetaData . KEY_CIPHER_KEY , KEY_LANGUAGE } ; private static final Pattern RTF_PATTERN = Pattern . compile ( "\\\\pard|\\\\pa[er]|\\\\qc|\\\\[bi]|\\\\u-?[0-9]{4,6}+"

Fix:
config . load ( buffer , SwordBookMetaData . ENCODING_LATIN1 , keepers ) ;