Buggy code:
public void setDataCacheTimeout ( int timeout ) { } public DataCache getDataCache ( ) { } public boolean isDetachable ( ) { } public void setDetachable ( boolean detachable ) { } public String getDetachedState ( ) { } public void setDetachedState ( String field ) { } public Field getDetachedStateField ( ) { } public Boolean usesDetachedState ( ) { } private Boolean usesDetachedState ( String detachedField , boolean confDisallows ) { } protected void clearAllFieldCache ( ) { } protected void clearDefinedFieldCache ( ) { } protected void clearFieldCache ( ) { } protected void clearSubclassCache ( ) { } void clearExtraFieldDataTable ( ) { } private void cacheFields ( ) { } public int hashCode ( ) { } public boolean equals ( Object other ) { } public int compareTo ( Object other ) { } public String toString ( ) { } public int getResolve ( ) { } public void setResolve ( int mode ) { } public void setResolve ( int mode , boolean on ) { } public boolean resolve ( int mode ) { } protected void resolveMeta ( boolean runtime ) { } protected void validateMeta ( boolean runtime ) { } protected void resolveMapping ( boolean runtime ) { } protected void validateMapping ( boolean runtime ) { } protected void initializeMapping ( ) { } private void validateDataCache ( ) { } private void validateIdentity ( boolean runtime ) { } private void validateAppIdClass ( boolean runtime ) { } private boolean hasConcretePCSuperclass ( ) { } private void validateAppIdClassMethods ( Class oid ) { } private void validateAppIdClassPKs ( ClassMetaData meta , FieldMetaData [ ] fmds , Class oid ) { if ( ( ( fmds . length ) == 0 ) && ( ! ( Modifier . isAbstract ( meta . getDescribedType ( ) . getModifiers ( ) ) ) ) ) throw new org . apache . openjpa . util . MetaDataException ( ClassMetaData . _loc . get ( "no-pk" , _type ) ) ; Field f ; Method m ; Class c ; for ( int i = 0 ; i < ( fmds . length ) ; i ++ ) { switch ( fmds [ i ] . getDeclaredTypeCode ( ) ) { case JavaTypes . ARRAY : c = fmds [ i ] . getDeclaredType ( ) . getComponentType ( ) ; if ( ( ( ( c == ( byte . class ) ) || ( c == ( Byte . class ) ) ) || ( c == ( char . class ) ) ) || ( c == ( Character . class ) ) ) { c = fmds [ i ] . getDeclaredType ( ) ; break ; } case JavaTypes . PC_UNTYPED : case JavaTypes . COLLECTION : case JavaTypes . MAP : case JavaTypes . OID : throw new org . apache . openjpa . util . MetaDataException ( ClassMetaData . _loc . get ( "bad-pk-type" , fmds [ i ] ) ) ; default : c = fmds [ i ] . getObjectIdFieldType ( ) ; } if ( ( meta . getAccessType ( ) ) == ( ClassMetaData . ACCESS_FIELD ) ) { f = Reflection . findField ( oid , fmds [ i ] . getName ( ) , false ) ; if ( ( f == null ) || ( ! ( f . getType ( ) . isAssignableFrom ( c ) ) ) ) throw new org . apache . openjpa . util . MetaDataException ( ClassMetaData . _loc . get ( "invalid-id" , _type , fmds [ i ] . getName ( ) ) ) ; } else if ( ( meta . getAccessType ( ) ) == ( ClassMetaData . ACCESS_PROPERTY ) ) { m = Reflection . findGetter ( oid , fmds [ i ] . getName ( ) , false ) ; if ( ( m == null ) || ( ! ( m . getReturnType ( ) . isAssignableFrom ( c ) ) ) ) throw new org . apache . openjpa . util . MetaDataException ( ClassMetaData . _loc . get ( "invalid-id" , _type , fmds [ i ] . getName ( ) ) ) ; <START_BUG> m = Reflection . findSetter ( oid , fmds [ i ] . getName ( ) , fmds [ i ] . getDeclaredType ( ) , false ) ; <END_BUG> if ( ( m == null ) || ( ( m . getReturnType ( ) ) != ( void . class ) ) ) throw new org . apache . openjpa . util . MetaDataException ( ClassMetaData . _loc . get ( "invalid-id" , _type , fmds [ i ] . getName ( ) ) ) ; } } } private void validateNoPKFields ( ) { } private void validateAccessType ( ) { } private void validateDetachable ( ) { } public FetchGroup [ ] getDeclaredFetchGroups ( ) { } public FetchGroup [ ] getCustomFetchGroups ( ) { } public FetchGroup getFetchGroup ( String name ) { } public FetchGroup addDeclaredFetchGroup ( String name ) { } public boolean removeDeclaredFetchGroup ( FetchGroup fg ) { } public File getSourceFile ( ) { } public Object getSourceScope ( ) { } public int getSourceType ( ) { } public void setSource ( File file , int srcType ) { } public String getResourceName ( ) { } public int getSourceMode ( ) { } public void setSourceMode ( int mode ) { } public void setSourceMode ( int mode , boolean on ) { } public int getListingIndex ( ) { } public void setListingIndex ( int index ) { } public String [ ] getComments ( ) { } public void setComments ( String [ ] comments ) { } public void copy ( ClassMetaData meta ) { } private static void copy ( ClassMetaData embed , ClassMetaData dec ) { }

Fix:
m = Reflection . findSetter ( oid , fmds [ i ] . getName ( ) , fmds [ i ] . getObjectIdFieldType ( ) , false ) ;