title: Lambda expression results in warning in Eclipse Luna
body: <p>I have a very similar problem as described in this unanswered question:
  <a href="https://stackoverflow.com/questions/26579881/nested-lambda-expressions-results-in-a-warning-in-eclipse-luna">Nested lambda expressions results in a warning in Eclipse Luna</a></p>
  
  <p>I am using Eclipse Luna (Service Release 1, 4.4.1) with Windows 7 and Java 8 (jdk 1.8.0_05). The following (<strong>edited</strong>) code:</p>
  
  <pre><code>Collections.sort(new LinkedList&lt;&gt;(), (c1, c2) -&gt; {
      return c1.equals(c2)? 1 : 0;
  });
  </code></pre>
  
  <p>yields in a warning:</p>
  
  <pre><code>(Recovered) Internal inconsistency detected during lambda shape analysis
  </code></pre>
  
  <p>The warning is assigned to this part of the code: "(c1, c2) ->".</p>
  
  <p><strong>Note</strong>: interestingly, the shorter version omitting the return statement compiles fine without any warnings:</p>
  
  <pre><code>Collections.sort(new LinkedList&lt;&gt;(), (c1, c2) -&gt; c1.equals(c2)? 1 : 0);
  </code></pre>
  
  <p>The same is true for this code where the types of c1 and c2 are given explicitly</p>
  
  <pre><code>Collections.sort(new LinkedList&lt;&gt;(), (Object c1, Object c2) -&gt; {
      return c1.equals(c2)? 1 : 0;
  });
  </code></pre>
  
  <p>What is going on here? (I don't believe that this bug suggestion: <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=432110" rel="nofollow noreferrer">https://bugs.eclipse.org/bugs/show_bug.cgi?id=432110</a> (given in a comment of the related question) is of any help as there the warning occurrs in the context of an error.)</p>
  
  <p><strong>EDIT:</strong> The above code is a MWE, the original code that caused the problem looks like this:</p>
  
  <pre><code>    Collections.sort(list, (c1, c2) -&gt; {
          Method m1 = this.allMethods.get(c1);
          Method m2 = this.allMethods.get(c2);
  
          int c = new Integer(m1.getParameterCount()).compareTo(
                  new Integer(m2.getParameterCount()));
  
          if (c == 0) {
              Integer i1 = 0;
              Integer i2 = 0;
              if (ConstructorFactory.isTypeAcceptable(m1.getReturnType())) {
                  i1 = 1;
              }
              if (ConstructorFactory.isTypeAcceptable(m2.getReturnType())) {
                  i2 = 1;
              }
  
              c = i1.compareTo(i2);
          }
  
          if (c == 0) {
              c = m1.getName().compareTo(m2.getName());
          }
  
          return c;
      });
  </code></pre>
  
  <p><strong>EDIT 2:</strong> Eclipse Kepler did NOT show this warning (same Java version).</p>