Object getInternal(int index)
                    throws JMFSchemaViolationException, JMFModelNotImplementedException, JMFMessageCorruptionException, JMFUninitializedAccessException {

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            JmfTr.entry(this, tc, "getInternal", new Object[] { Integer.valueOf(index) });

        Object ans;

        synchronized (getMessageLockArtefact()) {
            ans = cache[index];

            // If there is nothing in the cache, but we do have an assembled message,
            // decode the field and put it in the cache.
            if ((ans == null) && (contents != null)) {
                JSField field = getFieldDef(index, true);

                if (field == null) {
                    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                        JmfTr.exit(this, tc, "getInternal", null);
                    return null;
                }

                ans = ownership(field.decodeValue(contents, getAbsoluteOffset(index), indirect, master), sharedContents);

                if (ans == null) {
                    ans = nullIndicator;
                }
                // PM68797 - To avoid deadlock, do copyCache() before we create the new object and then adding  
                // to the shared cache. This will avoid the JSMessageData instances (source and target) in a 
                // shared cache being shared between two threads.
                else if (sharedCache && (ans instanceof JSMessageData || ans instanceof JMFEncapsulation)) {
                    copyCache();
                }
                // PM68797 ends

                cache[index] = ans;
            }

            // If we've found the singleton empty unboxed JSVaryingList, we need to replace
            // it with a real one, as someone may be about to update it.
            // We need to update the cache to point to the real one.
            else if (ans == JSVaryingListImpl.EMPTY_UNBOXED_VARYINGLIST) {
                JSField field = getFieldDef(index, false);
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                    JmfTr.debug(this, tc, "Replacing field " + field + " with real JSVaryingListImpl");
                ans = new JSVaryingListImpl(field, 0, null);
                cache[index] = ans;
            }

            // If we've found the singleton empty unboxed JSFixedList, we need to replace
            // it with a real one, as someone may be about to update it.
            // We need to update the cache to point to the real one.
            else if (ans == JSFixedListImpl.EMPTY_FIXEDLIST) {
                JSField field = getFieldDef(index, false);
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                    JmfTr.debug(this, tc, "Replacing field " + field + " with real JSFixedListImpl");
                ans = new JSFixedListImpl(field, null);
                cache[index] = ans;
            }

            // If we have a shared cache and the item we are going to return is a JSMessageData
            // subclass, we must break the sharing at this point (rather than waiting until an
            // update is later made) otherwise we risk two or more independent messages
            // referencing the same part.
            // PM68797 - add else for if condition
            else if (sharedCache && (ans instanceof JSMessageData || ans instanceof JMFEncapsulation)) {
                copyCache();
                ans = cache[index];
            }
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            JmfTr.exit(this, tc, "getInternal", ans);
        return ans;
    }
Object getInternal ( int index ) throws JMFSchemaViolationException , JMFModelNotImplementedException , JMFMessageCorruptionException , JMFUninitializedAccessException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) JmfTr . entry ( this , tc , "getInternal" , new Object [ ] { Integer . valueOf ( index ) } ) ; Object ans ; synchronized ( getMessageLockArtefact ( ) ) { ans = cache [ index ] ; if ( ( ans == null ) && ( contents != null ) ) { JSField field = getFieldDef ( index , true ) ; if ( field == null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) JmfTr . exit ( this , tc , "getInternal" , null ) ; return null ; } ans = ownership ( field . decodeValue ( contents , getAbsoluteOffset ( index ) , indirect , master ) , sharedContents ) ; if ( ans == null ) { ans = nullIndicator ; } else if ( sharedCache && ( ans instanceof JSMessageData || ans instanceof JMFEncapsulation ) ) { copyCache ( ) ; } cache [ index ] = ans ; } else if ( ans == JSVaryingListImpl . EMPTY_UNBOXED_VARYINGLIST ) { JSField field = getFieldDef ( index , false ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) JmfTr . debug ( this , tc , "Replacing field " + field + " with real JSVaryingListImpl" ) ; ans = new JSVaryingListImpl ( field , 0 , null ) ; cache [ index ] = ans ; } else if ( ans == JSFixedListImpl . EMPTY_FIXEDLIST ) { JSField field = getFieldDef ( index , false ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) JmfTr . debug ( this , tc , "Replacing field " + field + " with real JSFixedListImpl" ) ; ans = new JSFixedListImpl ( field , null ) ; cache [ index ] = ans ; } else if ( sharedCache && ( ans instanceof JSMessageData || ans instanceof JMFEncapsulation ) ) { copyCache ( ) ; ans = cache [ index ] ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) JmfTr . exit ( this , tc , "getInternal" , ans ) ; return ans ; }
from the contents.