Buggy code:
public void setValidate ( int validate ) { } public void setValidate ( int validate , boolean on ) { } public int getResolve ( ) { } public void setResolve ( int mode ) { } public void setResolve ( int mode , boolean on ) { } public int getSourceMode ( ) { } public void setSourceMode ( int mode ) { } public void setSourceMode ( int mode , boolean on ) { } public synchronized ClassMetaData getMetaData ( Class cls , ClassLoader envLoader , boolean mustExist ) { } public ClassMetaData getMetaData ( String alias , ClassLoader envLoader , boolean mustExist ) { } private ClassMetaData getMetaDataInternal ( Class cls , ClassLoader envLoader ) { } private static String toModeString ( int mode ) { } protected void prepareMapping ( ClassMetaData meta ) { } private void resolve ( ClassMetaData meta ) { } private List resolveMeta ( ClassMetaData meta ) { } private void loadMapping ( ClassMetaData meta ) { } private void preMapping ( ClassMetaData meta ) { } private boolean resolveMapping ( ClassMetaData meta ) { } private List processBuffer ( ClassMetaData meta , SortedSet buffer , int mode ) { } public synchronized ClassMetaData [ ] getMetaDatas ( ) { } public ClassMetaData getCachedMetaData ( Class cls ) { } public ClassMetaData addMetaData ( Class cls ) { } public ClassMetaData addMetaData ( Class cls , int access ) { } protected ClassMetaData newClassMetaData ( Class type ) { } protected ClassMetaData [ ] newClassMetaDataArray ( int length ) { } protected FieldMetaData newFieldMetaData ( String name , Class type , ClassMetaData owner ) { } protected FieldMetaData [ ] newFieldMetaDataArray ( int length ) { } protected ClassMetaData newEmbeddedClassMetaData ( ValueMetaData owner ) { } protected ValueMetaData newValueMetaData ( FieldMetaData owner ) { } protected Order newOrder ( FieldMetaData owner , String name , boolean asc ) { } protected Order newValueOrder ( FieldMetaData owner , boolean asc ) { } protected Order newRelatedFieldOrder ( FieldMetaData owner , FieldMetaData rel , boolean asc ) { } protected Order [ ] newOrderArray ( int size ) { } public boolean removeMetaData ( ClassMetaData meta ) { } public synchronized boolean removeMetaData ( Class cls ) { } void addDeclaredInterfaceImpl ( ClassMetaData meta , Class iface ) { } synchronized void setInterfaceImpl ( ClassMetaData meta , Class impl ) { } synchronized InterfaceImplGenerator getImplGenerator ( ) { } public ClassMetaData getMetaData ( Object oid , ClassLoader envLoader , boolean mustExist ) { if ( ( oid == null ) && mustExist ) throw new org . apache . openjpa . util . MetaDataException ( MetaDataRepository . _loc . get ( "no-oid-meta" , oid , "?" , _oids . toString ( ) ) ) ; if ( oid == null ) return null ; if ( oid instanceof OpenJPAId ) { Class cls = ( ( OpenJPAId ) ( oid ) ) . getType ( ) ; return getMetaData ( cls , envLoader , mustExist ) ; } processRegisteredClasses ( envLoader ) ; Class cls = ( ( Class ) ( _oids . get ( oid . getClass ( ) ) ) ) ; if ( cls != null ) return getMetaData ( cls , envLoader , mustExist ) ; if ( _oids . containsKey ( oid . getClass ( ) ) ) { if ( mustExist ) throw new org . apache . openjpa . util . MetaDataException ( MetaDataRepository . _loc . get ( "no-oid-meta" , oid , oid . getClass ( ) , _oids ) ) ; return null ; } resolveIdentityClass ( oid ) ; if ( ( processRegisteredClasses ( envLoader ) . length ) > 0 ) { cls = ( ( Class ) ( _oids . get ( oid . getClass ( ) ) ) ) ; if ( cls != null ) return getMetaData ( cls , envLoader , mustExist ) ; } _oids . put ( oid . getClass ( ) , null ) ; if ( ! mustExist ) return null ; <START_BUG> throw new org . apache . openjpa . util . MetaDataException ( MetaDataRepository . _loc . get ( "no-oid-meta" , oid , oid . getClass ( ) , _oids ) , oid ) ; <END_BUG> } private void resolveIdentityClass ( Object oid ) { } public ClassMetaData [ ] getImplementorMetaDatas ( Class cls , ClassLoader envLoader , boolean mustExist ) { } public NonPersistentMetaData getPersistenceAware ( Class cls ) { } public NonPersistentMetaData [ ] getPersistenceAwares ( ) { } public NonPersistentMetaData addPersistenceAware ( Class cls ) { } public boolean removePersistenceAware ( Class cls ) { } public NonPersistentMetaData getNonMappedInterface ( Class iface ) { } public NonPersistentMetaData [ ] getNonMappedInterfaces ( ) { } public NonPersistentMetaData addNonMappedInterface ( Class iface ) { } public boolean removeNonMappedInterface ( Class iface ) { } public synchronized void clear ( ) { } public synchronized Set getPersistentTypeNames ( boolean devpath , ClassLoader envLoader ) { } public synchronized Collection loadPersistentTypes ( boolean devpath , ClassLoader envLoader ) { } private Class classForName ( String name , ClassLoader loader ) { } Collection getPCSubclasses ( Class cls ) { } public void register ( Class cls ) { } private void loadRegisteredClassMetaData ( ClassLoader envLoader ) { } Class [ ] processRegisteredClasses ( ClassLoader envLoader ) { } private void processRegisteredClass ( Class cls ) { } private void updateImpls ( Class cls , Class leastDerived , Class check ) { } private boolean isLeastDerivedImpl ( Class inter , Class cls ) { } private void addToCollection ( Map map , Class key , Class value , boolean inheritance ) { } public void setConfiguration ( Configuration conf ) { } public void startConfiguration ( ) { } public void endConfiguration ( ) { } private void initializeMetaDataFactory ( ) { } public synchronized QueryMetaData getQueryMetaData ( Class cls , String name , ClassLoader envLoader , boolean mustExist ) { }

Fix:
throw new org . apache . openjpa . util . MetaDataException ( MetaDataRepository . _loc . get ( "no-oid-meta" , oid , oid . getClass ( ) , _oids ) ) . setFailedObject ( oid ) ;