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