code: private int getCase(int varIndex) {
  
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) JmfTr.entry(this, tc, "getCase", new Object[]{Integer.valueOf(varIndex)});
      int result;
  
      synchronized (getMessageLockArtefact()) {
        if (map != null) {
          result = map.choiceCodes[varIndex];
        }
        else if (choiceCache == null) {
          result = -1;
        }
        else {
          result = choiceCache[varIndex];
        }
      }
  
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) JmfTr.exit(this, tc, "getCase", Integer.valueOf(result));
      return result;
    }
docs: Locking: Needs to lock to ensure map etc don't change in the middle.