Buggy code:
public class MappingTool implements MetaDataModes { public static final String SCHEMA_ACTION_NONE = "none" ; public static final String ACTION_ADD = "add" ; public static final String ACTION_REFRESH = "refresh" ; public static final String ACTION_BUILD_SCHEMA = "buildSchema" ; public static final String ACTION_DROP = "drop" ; public static final String ACTION_VALIDATE = "validate" ; public static final String ACTION_EXPORT = "export" ; public static final String ACTION_IMPORT = "import" ; public static final String [ ] ACTIONS = new String [ ] { MappingTool . ACTION_ADD , MappingTool . ACTION_REFRESH , MappingTool . ACTION_BUILD_SCHEMA , MappingTool . ACTION_DROP , MappingTool . ACTION_VALIDATE , MappingTool . ACTION_EXPORT , MappingTool . ACTION_IMPORT } ; private static final Localizer _loc = Localizer . forPackage ( MappingTool . class ) ; private final JDBCConfiguration _conf ; private final Log _log ; private final String _action ; private final boolean _meta ; private final int _mode ; private final DBDictionary _dict ; private MappingRepository _repos = null ; private SchemaGroup _schema = null ; private SchemaTool _schemaTool = null ; private String _schemaActions = SchemaTool . ACTION_ADD ; private boolean _readSchema = false ; private boolean _pks = false ; private boolean _fks = false ; private boolean _indexes = false ; 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 ( ) { } 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 record ( MappingTool . Flags flags ) { } 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 ) { ClassMapping mapping = repos . getMapping ( cls , null , false ) ; if ( mapping != null ) return mapping ; if ( ( ( ! validate ) || ( cls . isInterface ( ) ) ) || ( ( repos . getPersistenceAware ( cls ) ) != null ) ) return null ; <START_BUG> throw new org . apache . openjpa . util . MetaDataException ( MappingTool . _loc . get ( "no-meta" , cls ) ) ; <END_BUG> } 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 [ ] arguments ) throws IOException , SQLException { } public static boolean run ( JDBCConfiguration conf , String [ ] args , Options opts ) throws IOException , SQLException { } public static boolean run ( JDBCConfiguration conf , String [ ] args , MappingTool . Flags flags , ClassLoader loader ) throws IOException , SQLException { } private static MappingTool . ImportExport [ ] newImportExports ( ) { } private static boolean contains ( String list , String key ) { } 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 ; public boolean ignoreErrors = false ; public boolean readSchema = false ; public boolean dropTables = false ; public boolean openjpaTables = false ; public boolean dropSequences = false ; public boolean sequences = true ; public boolean primaryKeys = false ; public boolean foreignKeys = false ; public boolean indexes = false ; } public static interface ImportExport { public boolean importMappings ( JDBCConfiguration conf , Class [ ] act , String [ ] args , boolean meta , Log log , ClassLoader loader ) throws IOException { } public boolean exportMappings ( JDBCConfiguration conf , Class [ ] act , boolean meta , Log log , Writer writer ) throws IOException { } } }

Fix:
throw new org . apache . openjpa . util . MetaDataException ( MappingTool . _loc . get ( "no-meta" , cls , cls . getClassLoader ( ) ) ) ;