private T retain0 ( T instance , final int increment , final int rawIncrement ) { int oldRef = updater ( ) . getAndAdd ( instance , rawIncrement ) ; if ( oldRef != 2 && oldRef != 4 && ( oldRef & 1 ) != 0 ) { throw new IllegalReferenceCountException ( 0 , increment ) ; } // don't pass 0! if ( ( oldRef <= 0 && oldRef + rawIncrement >= 0 ) || ( oldRef >= 0 && oldRef + rawIncrement < oldRef ) ) { // overflow case updater ( ) . getAndAdd ( instance , - rawIncrement ) ; throw new IllegalReferenceCountException ( realRefCnt ( oldRef ) , increment ) ; } return instance ; }
rawIncrement == increment << 1