Buggy code:
public DBDictionary getDBDictionary ( ) { } public MappingDefaults getMappingDefaults ( ) { } public void setMappingDefaults ( MappingDefaults defaults ) { } public SchemaGroup getSchemaGroup ( ) { } public void setSchemaGroup ( SchemaGroup schema ) { } public StrategyInstaller getStrategyInstaller ( ) { } public void setStrategyInstaller ( StrategyInstaller installer ) { } public QueryResultMapping getQueryResultMapping ( Class < ? > cls , String name , ClassLoader loader , boolean mustExist ) { } private QueryResultMapping getQueryResultMappingInternal ( Class < ? > cls , String name , ClassLoader envLoader ) { } public QueryResultMapping [ ] getQueryResultMappings ( ) { } public QueryResultMapping getCachedQueryResultMapping ( Class cls , String name ) { } public QueryResultMapping addQueryResultMapping ( Class cls , String name ) { } private QueryResultMapping addQueryResultMappingInternal ( Class cls , String name ) { } public boolean removeQueryResultMapping ( QueryResultMapping res ) { } public boolean removeQueryResultMapping ( Class cls , String name ) { } private static Object getQueryResultKey ( QueryResultMapping res ) { } private static Object getQueryResultKey ( Class < ? > cls , String name ) { } public ClassMapping getMapping ( Class < ? > cls , ClassLoader envLoader , boolean mustExist ) { } public ClassMapping [ ] getMappings ( ) { } public ClassMapping getMapping ( Object oid , ClassLoader envLoader , boolean mustExist ) { } public ClassMapping [ ] getImplementorMappings ( Class < ? > cls , ClassLoader envLoader , boolean mustExist ) { } public void clear ( ) { } protected void prepareMapping ( ClassMetaData meta ) { } 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 SequenceMetaData newSequenceMetaData ( String name ) { } protected Order newValueOrder ( FieldMetaData owner , boolean asc ) { } protected Order newRelatedFieldOrder ( FieldMetaData owner , FieldMetaData rel , boolean asc ) { } protected Order [ ] newOrderArray ( int size ) { } protected Version newVersion ( ClassMapping cls ) { } protected Discriminator newDiscriminator ( ClassMapping cls ) { } protected ClassMappingInfo newMappingInfo ( ClassMapping cls ) { } protected FieldMappingInfo newMappingInfo ( FieldMapping fm ) { } protected ValueMappingInfo newMappingInfo ( ValueMapping vm ) { } protected VersionMappingInfo newMappingInfo ( Version version ) { } protected DiscriminatorMappingInfo newMappingInfo ( Discriminator disc ) { } protected ClassStrategy namedStrategy ( ClassMapping cls ) { } protected ClassStrategy instantiateClassStrategy ( String name , ClassMapping cls ) { } protected FieldStrategy namedStrategy ( FieldMapping field , boolean installHandlers ) { } protected DiscriminatorStrategy namedStrategy ( Discriminator discrim ) { } protected DiscriminatorStrategy instantiateDiscriminatorStrategy ( String name , Discriminator discrim ) { } protected VersionStrategy namedStrategy ( Version version ) { } protected VersionStrategy instantiateVersionStrategy ( String name , Version version ) { } protected VersionStrategy instantiateVersionStrategy ( Class < ? > strat , Version version , String props ) { } protected ClassStrategy defaultStrategy ( ClassMapping cls ) { } protected ClassStrategy defaultStrategy ( ClassMapping cls , boolean adapting ) { } protected FieldStrategy defaultStrategy ( FieldMapping field , boolean installHandlers ) { } protected FieldStrategy defaultStrategy ( FieldMapping field , boolean installHandlers , boolean adapting ) { } protected FieldStrategy defaultTypeStrategy ( FieldMapping field , boolean installHandlers , boolean adapting ) { } protected FieldStrategy handlerCollectionStrategy ( FieldMapping field , ValueHandler ehandler , boolean installHandlers ) { } protected FieldStrategy handlerMapStrategy ( FieldMapping field , ValueHandler khandler , ValueHandler vhandler , boolean krel , boolean vrel , boolean installHandlers ) { } private boolean useInverseKeyMapping ( FieldMapping field ) { FieldMapping mapped = field . getMappedByMapping ( ) ; if ( mapped != null ) { if ( isBiMTo1JT ( field ) ) return false ; <START_BUG> if ( ( mapped . getTypeCode ( ) ) == ( JavaTypes . PC ) ) <END_BUG> return true ; if ( ( mapped . getElement ( ) . getTypeCode ( ) ) == ( JavaTypes . PC ) ) return false ; throw new org . apache . openjpa . util . MetaDataException ( MappingRepository . _loc . get ( "bad-mapped-by" , field , mapped ) ) ; } FieldMappingInfo info = field . getMappingInfo ( ) ; ValueMapping elem = field . getElementMapping ( ) ; boolean useInverseKeyMapping = ( ( DBIdentifier . isNull ( info . getTableIdentifier ( ) ) ) && ( info . getColumns ( ) . isEmpty ( ) ) ) && ( ! ( elem . getValueInfo ( ) . getColumns ( ) . isEmpty ( ) ) ) ; if ( isUni1ToMFK ( field ) ) { return true ; } return useInverseKeyMapping ; } public boolean isNonDefaultMappingAllowed ( ) { } public boolean isUniMTo1JT ( FieldMapping field ) { } public boolean isUni1To1JT ( FieldMapping field ) { } public boolean isBi1To1JT ( FieldMapping field ) { } public boolean isUni1ToMFK ( FieldMapping field ) { } public boolean isBiMTo1JT ( FieldMapping field ) { } public FieldMapping getBi_1ToM_JoinTableField ( FieldMapping field ) { } public FieldMapping getBi_MTo1_JoinTableField ( FieldMapping field ) { } public boolean hasJoinColumn ( FieldMapping field ) { } public boolean hasJoinTable ( FieldMapping field ) { } public boolean isBidirectional ( FieldMapping field ) { } private Object mappedStrategy ( ValueMapping val , Class < ? > type , boolean adapting ) { } protected ValueHandler namedHandler ( ValueMapping val ) { } protected ValueHandler defaultHandler ( ValueMapping val ) { } protected ValueHandler defaultHandler ( ValueMapping val , boolean adapting ) { } private boolean useUntypedPCHandler ( ValueMapping val ) { } private boolean isClob ( ValueMapping val , boolean warn ) { }

Fix:
if ( ( ( mapped . getTypeCode ( ) ) == ( JavaTypes . PC ) ) || ( ( mapped . getTypeCode ( ) ) == ( JavaTypes . PC_UNTYPED ) ) )