#vulnerable code 
                                public AsteriskChannel getLinkedChannel()
    {
        return linkedChannel;
    } 
                            #location 3 
                            #vulnerability type THREAD_SAFETY_VIOLATION
#fixed code
                                public AsteriskChannel getLinkedChannel()
    {
        synchronized(linkedChannels) {
          if (linkedChannels.isEmpty()) return null;
          return linkedChannels.get(0);
        }
    }