if ( version == null || version.intValue() < 0 ) throw new ValidationException( "Version must properly be set on managed objects :\n"+ obj.toString() );
if ( version == null || version.intValue() < 0 );
    protected void checkManagedState( IObject obj )    {                if ( obj.getId() == null)            throw new ValidationException(                    "Id required on all detached instances.");        // Throws an exception if does not exist        IObject original = (IObject) ht.load(                     Utils.trueClass( obj.getClass() ),                     obj.getId() );                if ( obj == original)            return; // Early exit. Obj is in session.                Details oldDetails = original.getDetails(); // must exist!        Details updatedDetails = obj.getDetails();                /* FIXME temporary this shouldn't be null */        if ( oldDetails == null )         {            //obj.setDetails( null );            log.warn( " Original details null for: " + original );        }                // TODO perhaps this should throw an exception. But we have         // defaults to handle this kind of thing, so currently, not throwing.        else if ( updatedDetails == null )        {            obj.setDetails( oldDetails );            log.warn( " Updated details null for: " + original );                    // Now we have to make sure certain things do not happen:        } else {                        if ( ! idEqual(                     oldDetails.getOwner(),                     updatedDetails.getOwner() ))            {                updatedDetails.setOwner( oldDetails.getOwner() );                log.warn( " Resetting owner for: " + original );            }            if ( ! idEqual(                     oldDetails.getGroup(),                     updatedDetails.getGroup() ))            {                updatedDetails.setGroup( oldDetails.getGroup() );                log.warn( " Resetting group for: " + original );            }                        if ( ! idEqual(                     oldDetails.getCreationEvent(),                     updatedDetails.getCreationEvent()))            {                updatedDetails.setCreationEvent( oldDetails.getCreationEvent() );                log.warn( " Resetting creation for: " + original );            }                    }                if ( obj instanceof IMutable )        {            Integer version = ((IMutable) obj).getVersion();            if ( version == null || version.intValue() < 0 )                throw new ValidationException(                        "Version must properly be set on managed objects :\n"+                        obj.toString()                        );        }                }