title: Checkstyle and JAVA8 lambdas
body: <p>I'm preparing large migration to JAVA8. Part of it is configuring checkstyle to properly work with JAVA8 constructions. I try to keep checkstyle synchronized with a default autoformatting tool in IntelliJ. Unfortunately it doesn't accept automatic IntelliJ indentation of lambda expressions.</p>
  
  <p>checkstyle.xml</p>
  
  <pre><code>&lt;module name="Indentation"&gt;
       &lt;property name="caseIndent" value="0"/&gt;
  &lt;/module&gt;
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code>public class Java8CheckstyleTest {
      public void java8Elements(String ala) {
          Collections.sort(names, (String a, String b) -&gt; {
              return b.compareTo(a); // &lt;&lt;&lt;25 line
          }); // &lt;&lt;&lt;26 line
      }
  }
  </code></pre>
  
  <p>Checkstyle report:</p>
  
  <blockquote>
    <p>Java8CheckstyleTest.java:25: 'block' child have incorrect indentation
    level 12, expected level should be 16.</p>
    
    <p>Java8CheckstyleTest.java:26: 'block rcurly' have incorrect indentation
    level 16, expected level should be 12.</p>
  </blockquote>
  
  <p>If I break "})" with a new line and autoformat:</p>
  
  <pre><code>public class Java8CheckstyleTest {
      public void java8Elements(String ala) {
          Collections.sort(names, (String a, String b) -&gt; {
                      return b.compareTo(a); // &lt;&lt;&lt;25 line
                  } // &lt;&lt;&lt;26 line
          ); 
      }
  }
  </code></pre>
  
  <p>i get:</p>
  
  <blockquote>
    <p>Java8CheckstyleTest.java:25: 'block' child have incorrect indentation
    level 20, expected level should be 16.</p>
    
    <p>Java8CheckstyleTest.java:26:'block rcurly' have incorrect indentation level 16, expected level should be 12.</p>
  </blockquote>
  
  <p>How should I configure checkstyle not to break old code and to accept these autoformatting schemes?</p>
  
  <p>EDIT: I updated checkstyle to 6.11.1 and as I see problem is nearly solved. First code is accepted right now. Second produces report:</p>
  
  <blockquote>
    <p>Java8CheckstyleTest.java:32: error: 'block' child have incorrect
    indentation level 20, expected level should be one of the following:
    12, 16.</p>
    
    <p>Java8CheckstyleTest.java:33: error: 'block rcurly' have incorrect
    indentation level 16, expected level should be one of the following:
    8, 12.</p>
  </blockquote>
  
  <p>I assume that it's probably a thing that have to be fixed in the next IntelliJ version. I will close this question. </p>