public void setInt(int accessor, int val)
      throws JMFSchemaViolationException, JMFModelNotImplementedException, JMFUninitializedAccessException, JMFMessageCorruptionException {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) JmfTr.entry(this, tc, "setInt", new Object[]{Integer.valueOf(accessor), Integer.valueOf(val)});

    synchronized (getMessageLockArtefact()) {
      if (map == null) {
        // pure delegation
        encoding.setInt(accessor, val);
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) JmfTr.exit(this, tc, "setInt");
        return;
      }
      int encAccessor = map.indices[accessor];
      if (encAccessor == -1) {
        // setting a field that doesn't exist ... transition to delegation.
        becomeDelegator();
        encoding.setInt(accessor, val);
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) JmfTr.exit(this, tc, "setInt");
        return;
      }
      if (encAccessor >= map.varBias) {
        val = map.setCases[encAccessor - map.varBias][val];
      }
      encoding.setInt(encAccessor, val);

      if (encoding instanceof JSMessageData && ((JSMessageData)encoding).contents == null) {
        becomeDelegator();
      }
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) JmfTr.exit(this, tc, "setInt");
  }
public void setInt ( int accessor , int val ) throws JMFSchemaViolationException , JMFModelNotImplementedException , JMFUninitializedAccessException , JMFMessageCorruptionException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) JmfTr . entry ( this , tc , "setInt" , new Object [ ] { Integer . valueOf ( accessor ) , Integer . valueOf ( val ) } ) ; synchronized ( getMessageLockArtefact ( ) ) { if ( map == null ) { encoding . setInt ( accessor , val ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) JmfTr . exit ( this , tc , "setInt" ) ; return ; } int encAccessor = map . indices [ accessor ] ; if ( encAccessor == - 1 ) { becomeDelegator ( ) ; encoding . setInt ( accessor , val ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) JmfTr . exit ( this , tc , "setInt" ) ; return ; } if ( encAccessor >= map . varBias ) { val = map . setCases [ encAccessor - map . varBias ] [ val ] ; } encoding . setInt ( encAccessor , val ) ; if ( encoding instanceof JSMessageData && ( ( JSMessageData ) encoding ) . contents == null ) { becomeDelegator ( ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) JmfTr . exit ( this , tc , "setInt" ) ; }
Locking: Relies on map remaining not-null, so must not run coincidentally with becomeDelegator()