Buggy code:
private boolean _seqs = true ; private boolean _dropUnused = true ; private boolean _ignoreErrors = false ; private File _file = null ; private Writer _mappingWriter = null ; private Writer _schemaWriter = null ; private Set _dropCls = null ; private Set _dropMap = null ; private boolean _flush = false ; private boolean _flushSchema = false ; public MappingTool ( JDBCConfiguration conf , String action , boolean meta ) { } public String getAction ( ) { } public boolean isMetaDataAction ( ) { } public String getSchemaAction ( ) { } public void setSchemaAction ( String schemaAction ) { } public boolean getReadSchema ( ) { } public void setReadSchema ( boolean readSchema ) { } public boolean getSequences ( ) { } public void setSequences ( boolean seqs ) { } public boolean getIndexes ( ) { } public void setIndexes ( boolean indexes ) { } public boolean getForeignKeys ( ) { } public void setForeignKeys ( boolean fks ) { } public boolean getPrimaryKeys ( ) { } public void setPrimaryKeys ( boolean pks ) { } public boolean getDropUnusedComponents ( ) { } public void setDropUnusedComponents ( boolean dropUnused ) { } public void setIgnoreErrors ( boolean ignoreErrors ) { } public boolean getIgnoreErrors ( ) { } public SchemaTool getSchemaTool ( ) { } private SchemaTool newSchemaTool ( String action ) { } public void setSchemaTool ( SchemaTool tool ) { } public Writer getSchemaWriter ( ) { } public void setSchemaWriter ( Writer schemaWriter ) { } public Writer getMappingWriter ( ) { } public void setMappingWriter ( Writer mappingWriter ) { } public File getMetaDataFile ( ) { } public void setMetaDataFile ( File file ) { } public MappingRepository getRepository ( ) { } public void setRepository ( MappingRepository repos ) { } public SchemaGroup getSchemaGroup ( ) { } public void setSchemaGroup ( SchemaGroup schema ) { } public void clear ( ) { } public void record ( ) { } private void dropUnusedSchemaComponents ( ClassMapping [ ] mappings ) { } private void addSequenceComponents ( ClassMapping [ ] mappings ) { } private void addSequenceComponents ( ClassMapping mapping , SchemaGroup group ) { } public void run ( Class cls ) { } private void add ( Class cls ) { } private static ClassMapping getMapping ( MappingRepository repos , Class cls , boolean validate ) { } private void addMeta ( Class cls ) { } private void refresh ( Class cls ) { } private void validate ( Class cls ) { } private void buildSchema ( Class cls ) { } private void drop ( Class cls ) { } public static void main ( String [ ] args ) throws IOException , SQLException { } public static boolean run ( JDBCConfiguration conf , String [ ] args , Options opts ) throws IOException , SQLException { if ( ( opts . containsKey ( "help" ) ) || ( opts . containsKey ( "-help" ) ) ) return false ; MappingTool . Flags flags = new MappingTool . Flags ( ) ; flags . action = opts . removeProperty ( "action" , "a" , flags . action ) ; flags . schemaAction = opts . removeProperty ( "schemaAction" , "sa" , flags . schemaAction ) ; flags . dropTables = opts . removeBooleanProperty ( "dropTables" , "dt" , flags . dropTables ) ; <START_BUG> flags . openjpaTables = opts . removeBooleanProperty ( "openjpaTables" , "kt" , flags . openjpaTables ) ; <END_BUG> flags . dropSequences = opts . removeBooleanProperty ( "dropSequences" , "dsq" , flags . dropSequences ) ; flags . readSchema = opts . removeBooleanProperty ( "readSchema" , "rs" , flags . readSchema ) ; flags . primaryKeys = opts . removeBooleanProperty ( "primaryKeys" , "pk" , flags . primaryKeys ) ; flags . indexes = opts . removeBooleanProperty ( "indexes" , "ix" , flags . indexes ) ; flags . foreignKeys = opts . removeBooleanProperty ( "foreignKeys" , "fk" , flags . foreignKeys ) ; flags . sequences = opts . removeBooleanProperty ( "sequences" , "sq" , flags . sequences ) ; flags . ignoreErrors = opts . removeBooleanProperty ( "ignoreErrors" , "i" , flags . ignoreErrors ) ; flags . meta = opts . removeBooleanProperty ( "meta" , "m" , flags . meta ) ; String fileName = opts . removeProperty ( "file" , "f" , null ) ; String schemaFileName = opts . removeProperty ( "schemaFile" , "sf" , null ) ; String sqlFileName = opts . removeProperty ( "sqlFile" , "sql" , null ) ; String schemas = opts . removeProperty ( "s" ) ; if ( schemas != null ) opts . setProperty ( "schemas" , schemas ) ; Configurations . populateConfiguration ( conf , opts ) ; ClassLoader loader = conf . getClassResolverInstance ( ) . getClassLoader ( MappingTool . class , null ) ; if ( ( flags . meta ) && ( MappingTool . ACTION_ADD . equals ( flags . action ) ) ) flags . metaDataFile = Files . getFile ( fileName , loader ) ; else flags . mappingWriter = Files . getWriter ( fileName , loader ) ; flags . schemaWriter = Files . getWriter ( schemaFileName , loader ) ; flags . sqlWriter = Files . getWriter ( sqlFileName , loader ) ; return MappingTool . run ( conf , args , flags , loader ) ; } public static boolean run ( JDBCConfiguration conf , String [ ] args , MappingTool . Flags flags , ClassLoader loader ) throws IOException , SQLException { } private static MappingTool . ImportExport [ ] newImportExports ( ) { } public static class Flags { public String action = null ; public boolean meta = false ; public String schemaAction = SchemaTool . ACTION_ADD ; public File metaDataFile = null ; public Writer mappingWriter = null ; public Writer schemaWriter = null ; public Writer sqlWriter = null ;

Fix:
flags . openjpaTables = opts . removeBooleanProperty ( "openjpaTables" , "ot" , flags . openjpaTables ) ;