title: Replace if else with ternary not working
body: <p>I am trying to replace this piece of code with ternary expressions :</p>
  
  <pre><code>if (m_dataSource instanceof URL) {
          m_audioInputStream = AudioSystem.getAudioInputStream((URL) m_dataSource);
          m_audioFileFormat = AudioSystem.getAudioFileFormat((URL) m_dataSource);
  
      } else if (m_dataSource instanceof File) {
          m_audioInputStream = AudioSystem.getAudioInputStream((File) m_dataSource);
          m_audioFileFormat = AudioSystem.getAudioFileFormat((File) m_dataSource);
  
      } else if (m_dataSource instanceof InputStream) {
          m_audioInputStream = AudioSystem.getAudioInputStream((InputStream) m_dataSource);
          m_audioFileFormat = AudioSystem.getAudioFileFormat((InputStream) m_dataSource);
      }
  </code></pre>
  
  <p>what i am trying:</p>
  
  <pre><code>  m_audioInputStream = AudioSystem.getAudioInputStream(
                           m_dataSource instanceof URL?(URL)m_dataSource
                             :m_dataSource instanceof File?(File) m_dataSource
                               :m_dataSource instanceof InputStream ?(InputStream) m_dataSource
                                 :(something other));
  </code></pre>
  
  <p>but i am getting this error:</p>
  
  <p><strong>The method getAudioInputStream(InputStream) in the type AudioSystem is not applicable for the arguments (((m_dataSource instanceof URL) ? (URL) m_dataSource : ((m_dataSource instanceof File) ? (File) m_dataSource : ((m_dataSource instanceof InputStream) ? (InputStream) m_dataSource : null))))</strong></p>
  
  <p>Why it choose InputStream by default?</p>
  
  <p>Edit :
  <strong>m_dataSource is Object.</strong></p>