title: IDEA Gives warning 'some variable always false'?
body: <p>I wrote following code fragment with loop.But when Variable  'X' given always 'false' in IDEA , this line </p>
  
  <p><code>final boolean isCurrentDoseIsPeriodicOrEO = (CommonToolkit.INSTANCE.isPeriodicDosage(doseDetail) || X)</code>;</p>
  
  <p>I need some explain it is not necessary put that or condition there.</p>
  
  <pre><code>    boolean isFirstDose = true;
      boolean isFirstDoseIsPeriodicOrWholePRNOrEoOrOneOff = false;
  
      for (final DDT: dd)
      {
  
        final boolean X=
          DosageToolkit.INSTANCE.hasEOTypeDosage(new DoseDetailMutableDTOToBaseDoseDetailAdapter(dd));
        final boolean isOneOffDose = CommonToolkit.INSTANCE.isOneOffDose(dd);
  
        if (dd.isWholeWhenNeeded() || X|| isOneOffDose)
        {
          if (isFirstDose)
          {
            isFirstDoseIsPeriodicOrWholePRNOrEoOrOneOff=true;
            isFirstDose = false;
          }
  
          continue;
        }
  
        final List&lt;DIT&gt; doseInstances =
          new ArrayList&lt;DIT&gt;(dd.getDoseInstances());
        Collections.sort(doseInstances, CommonToolkit.INSTANCE.getDoseInstanceComparator());
  
        final boolean isCurrentDoseIsPeriodicOrEO = (CommonToolkit.INSTANCE.isPeriodicDosage(doseDetail) || X);
  
        for (final DITdoseInstance : doseInstances)
            {
      }
  </code></pre>