Buggy code:
public class PrimaryRow extends RowImpl { private static final byte PK_SET = 2 << 1 ; private static final byte PK_WHERE = 2 << 2 ; private static final byte DEPENDENT = 2 << 4 ; private static final Localizer _loc = Localizer . forPackage ( PrimaryRow . class ) ; private OpenJPAStateManager _pk = null ; private ColumnIO _pkIO = null ; private OpenJPAStateManager [ ] _fkSet = null ; private ColumnIO [ ] _fkIO = null ; private OpenJPAStateManager [ ] _fkWhere = null ; private OpenJPAStateManager [ ] _relSet = null ; private RelationId [ ] _callbacks = null ; private Object _failed = null ; private int _idx = - 1 ; public PrimaryRow ( Table table , int action , OpenJPAStateManager owner ) { } protected PrimaryRow ( Column [ ] cols , int action , OpenJPAStateManager owner ) { } public boolean isDependent ( ) { } public void setDependent ( boolean dependent ) { } public int getIndex ( ) { } public void setIndex ( int idx ) { } public Object getFailedObject ( ) { } public void setFailedObject ( Object failed ) { } public OpenJPAStateManager getPrimaryKey ( ) { } public void setPrimaryKey ( OpenJPAStateManager sm ) throws SQLException { } public void setPrimaryKey ( ColumnIO io , OpenJPAStateManager sm ) { } public void wherePrimaryKey ( OpenJPAStateManager sm ) throws SQLException { } public ColumnIO getForeignKeyIO ( ForeignKey fk ) { } public OpenJPAStateManager getForeignKeySet ( ForeignKey fk ) { } public OpenJPAStateManager getForeignKeyWhere ( ForeignKey fk ) { } public void setForeignKey ( ForeignKey fk , OpenJPAStateManager sm ) throws SQLException { } public void setForeignKey ( ForeignKey fk , ColumnIO io , OpenJPAStateManager sm ) throws SQLException { } public void whereForeignKey ( ForeignKey fk , OpenJPAStateManager sm ) throws SQLException { } public void clearForeignKey ( ForeignKey fk ) throws SQLException { } private boolean delayForeignKey ( ForeignKey fk , OpenJPAStateManager sm , boolean set ) { } private void recordForeignKey ( ForeignKey fk , ColumnIO io , OpenJPAStateManager sm , boolean set ) { } public OpenJPAStateManager getRelationIdSet ( Column col ) { } public RelationId getRelationIdCallback ( Column col ) { } public void setRelationId ( Column col , OpenJPAStateManager sm , RelationId rel ) throws SQLException { } public void clearRelationId ( Column col ) throws SQLException { } private int getRelationIdIndex ( Column col ) { } private static boolean isPrimaryKeyAutoAssigned ( OpenJPAStateManager sm ) { } protected void setObject ( Column col , Object val , int metaType , boolean overrideDefault ) throws SQLException { Object prev = getSet ( col ) ; if ( prev != null ) { if ( prev == ( NULL ) ) prev = null ; if ( ! ( PrimaryRow . rowValueEquals ( prev , val ) ) ) { if ( allowsUpdate ( col , prev , val ) ) { super . setObject ( col , val , metaType , overrideDefault ) ; } else if ( ! ( isDefaultValue ( val ) ) ) { <START_BUG> throw new org . apache . openjpa . util . InvalidStateException ( PrimaryRow . _loc . get ( "diff-values" , new Object [ ] { col . getFullName ( ) , prev == null ? null : prev . getClass ( ) , prev , val == null ? null : val . getClass ( ) , val } ) ) . setFatal ( true ) ; <END_BUG> } else { return ; } } } super . setObject ( col , val , metaType , overrideDefault ) ; } boolean allowsUpdate ( Column col , Object old , Object cur ) { } boolean isDefaultValue ( Object val ) { } private static boolean rowValueEquals ( Object o1 , Object o2 ) { } protected String generateSQL ( DBDictionary dict ) { } protected RowImpl newInstance ( Column [ ] cols , int action ) { } public void copyInto ( RowImpl row , boolean whereOnly ) { } }

Fix:
throw new org . apache . openjpa . util . InvalidStateException ( PrimaryRow . _loc . get ( "diff-values" , new Object [ ] { col . getFullDBIdentifier ( ) . getName ( ) , prev == null ? null : prev . getClass ( ) , prev , val == null ? null : val . getClass ( ) , val } ) ) . setFatal ( true ) ;