From eb0700c603b94e066c1c9b6a0252babaf4f3bd8a Mon Sep 17 00:00:00 2001 From: Saloni Gupta Date: Sat, 12 Sep 2026 00:40:07 +0200 Subject: [PATCH 1/2] fixed the new try-catch style with indentations and closing-paren placement for multi-resource try-with-resources --- .../java/JavaInputAstVisitor.java | 55 +- .../googlejavaformat/java/FormatterTest.java | 647 +++++++++--------- .../java/testdata/B21465217.output | 7 +- .../java/testdata/B26159561.output | 6 +- .../java/testdata/TryWithResources.input | 2 +- .../java/testdata/TryWithResources.output | 2 +- 6 files changed, 375 insertions(+), 344 deletions(-) diff --git a/core/src/main/java/com/google/googlejavaformat/java/JavaInputAstVisitor.java b/core/src/main/java/com/google/googlejavaformat/java/JavaInputAstVisitor.java index d138011f0..07eb3ee89 100644 --- a/core/src/main/java/com/google/googlejavaformat/java/JavaInputAstVisitor.java +++ b/core/src/main/java/com/google/googlejavaformat/java/JavaInputAstVisitor.java @@ -2091,28 +2091,30 @@ public Void visitTry(TryTree node, Void unused) { builder.space(); if (!node.getResources().isEmpty()) { token("("); - builder.open(node.getResources().size() > 1 ? plusFour : ZERO); + boolean multiVariable = node.getResources().size() > 1; + builder.open(multiVariable ? plusFour : ZERO); + if (multiVariable) { + builder.forcedBreak(); + } boolean afterFirstToken = false; for (Tree resource : node.getResources()) { if (afterFirstToken) { builder.forcedBreak(); } if (resource instanceof VariableTree variableTree) { - declareOne( - DeclarationKind.PARAMETER, - fieldAnnotationDirection(variableTree.getModifiers()), - Optional.of(variableTree.getModifiers()), - variableTree.getType(), - /* name= */ variableTree.getName(), - "", - "=", - Optional.ofNullable(variableTree.getInitializer()), - /* trailing= */ Optional.empty(), - /* receiverExpression= */ Optional.empty(), - /* typeWithDims= */ Optional.empty()); + DeclarationKind.PARAMETER, + fieldAnnotationDirection(variableTree.getModifiers()), + Optional.of(variableTree.getModifiers()), + variableTree.getType(), + /* name= */ variableTree.getName(), + "", + "=", + Optional.ofNullable(variableTree.getInitializer()), + /* trailing= */ Optional.empty(), + /* receiverExpression= */ Optional.empty(), + /* typeWithDims= */ Optional.empty()); } else { - // TODO(cushon): think harder about what to do with `try (resource1; resource2) {}` scan(resource, null); } if (builder.peekToken().equals(Optional.of(";"))) { @@ -2121,22 +2123,19 @@ public Void visitTry(TryTree node, Void unused) { } afterFirstToken = true; } - if (builder.peekToken().equals(Optional.of(";"))) { - token(";"); - builder.space(); + builder.close(); + if (multiVariable) { + builder.forcedBreak(); } token(")"); - builder.close(); builder.space(); } - // An empty try-with-resources body can collapse to "{}" if there are no trailing catch or - // finally blocks. boolean trailingClauses = !node.getCatches().isEmpty() || node.getFinallyBlock() != null; visitBlock( - node.getBlock(), - CollapseEmptyOrNot.valueOf(!trailingClauses), - AllowLeadingBlankLine.YES, - AllowTrailingBlankLine.valueOf(trailingClauses)); + node.getBlock(), + CollapseEmptyOrNot.valueOf(!trailingClauses), + AllowLeadingBlankLine.YES, + AllowTrailingBlankLine.valueOf(trailingClauses)); for (int i = 0; i < node.getCatches().size(); i++) { CatchTree catchClause = node.getCatches().get(i); trailingClauses = i < node.getCatches().size() - 1 || node.getFinallyBlock() != null; @@ -2147,10 +2146,10 @@ public Void visitTry(TryTree node, Void unused) { token("finally"); builder.space(); visitBlock( - node.getFinallyBlock(), - CollapseEmptyOrNot.NO, - AllowLeadingBlankLine.YES, - AllowTrailingBlankLine.NO); + node.getFinallyBlock(), + CollapseEmptyOrNot.NO, + AllowLeadingBlankLine.YES, + AllowTrailingBlankLine.NO); } builder.close(); return null; diff --git a/core/src/test/java/com/google/googlejavaformat/java/FormatterTest.java b/core/src/test/java/com/google/googlejavaformat/java/FormatterTest.java index 9ba460428..e3abece56 100644 --- a/core/src/test/java/com/google/googlejavaformat/java/FormatterTest.java +++ b/core/src/test/java/com/google/googlejavaformat/java/FormatterTest.java @@ -39,25 +39,26 @@ @RunWith(JUnit4.class) public final class FormatterTest { - @Rule public TemporaryFolder testFolder = new TemporaryFolder(); + @Rule + public TemporaryFolder testFolder = new TemporaryFolder(); @Test public void testFormatAosp() throws Exception { // don't forget to misspell "long", or you will be mystified for a while String input = - "class A{void b(){while(true){weCanBeCertainThatThisWillEndUpGettingWrapped(" - + "because, it, is, just, so, very, very, very, very, looong);}}}"; + "class A{void b(){while(true){weCanBeCertainThatThisWillEndUpGettingWrapped(" + + "because, it, is, just, so, very, very, very, very, looong);}}}"; String expectedOutput = - """ - class A { - void b() { - while (true) { - weCanBeCertainThatThisWillEndUpGettingWrapped( - because, it, is, just, so, very, very, very, very, looong); - } - } - } - """; + """ + class A { + void b() { + while (true) { + weCanBeCertainThatThisWillEndUpGettingWrapped( + because, it, is, just, so, very, very, very, very, looong); + } + } + } + """; Path tmpdir = testFolder.newFolder().toPath(); Path path = tmpdir.resolve("A.java"); @@ -90,19 +91,19 @@ public void testFormatNonJavaFiles() throws Exception { @Test public void testFormatStdinStdoutWithDashFlag() throws Exception { String input = - """ - class Foo{ - void f - () { - } - } - """; + """ + class Foo{ + void f + () { + } + } + """; String expectedOutput = - """ - class Foo { - void f() {} - } - """; + """ + class Foo { + void f() {} + } + """; InputStream in = new ByteArrayInputStream(input.getBytes(UTF_8)); StringWriter out = new StringWriter(); @@ -121,19 +122,19 @@ void f() {} @Test public void testFormatLengthUpToEOF() throws Exception { String input = - """ - class Foo{ - void f - () { - } - }\n\n\n\n\n - """; + """ + class Foo{ + void f + () { + } + }\n\n\n\n\n + """; String expectedOutput = - """ - class Foo { - void f() {} - } - """; + """ + class Foo { + void f() {} + } + """; Path tmpdir = testFolder.newFolder().toPath(); Path path = tmpdir.resolve("Foo.java"); @@ -163,7 +164,7 @@ public void testFormatLengthOutOfRange() throws Exception { String[] args = {"--offset", "0", "--length", "9999", path.toString()}; assertThat(main.format(args)).isEqualTo(1); assertThat(err.toString()) - .contains("error: invalid offset (0) or length (9999); offset + length (9999)"); + .contains("error: invalid offset (0) or length (9999); offset + length (9999)"); } @Test @@ -181,137 +182,137 @@ public void testFormatOffsetOutOfRange() throws Exception { String[] args = {"--offset", "9998", "--length", "1", path.toString()}; assertThat(main.format(args)).isEqualTo(1); assertThat(err.toString()) - .contains("error: invalid offset (9998) or length (1); offset + length (9999)"); + .contains("error: invalid offset (9998) or length (1); offset + length (9999)"); } @Test public void blankInClassBody() throws FormatterException { String input = - """ - package test; - class T { - - } - """; + """ + package test; + class T { + + } + """; String output = new Formatter().formatSource(input); String expect = - """ - package test; - - class T {} - """; + """ + package test; + + class T {} + """; assertThat(output).isEqualTo(expect); } @Test public void blankInClassBodyNoTrailing() throws FormatterException { String input = - """ - package test; - class T { - - }\ - """; + """ + package test; + class T { + + }\ + """; String output = new Formatter().formatSource(input); String expect = - """ - package test; - - class T {} - """; + """ + package test; + + class T {} + """; assertThat(output).isEqualTo(expect); } @Test public void docCommentTrailingBlank() throws FormatterException { String input = - """ - class T { - /** asd */ - - int x; - }\ - """; + """ + class T { + /** asd */ + + int x; + }\ + """; String output = new Formatter().formatSource(input); String expect = - """ - class T { - /** asd */ - int x; - } - """; + """ + class T { + /** asd */ + int x; + } + """; assertThat(output).isEqualTo(expect); } @Test public void blockCommentInteriorTrailingBlank() throws FormatterException { String input = - """ - class T { - /* - * asd - * fgh - */ - - int x; - }\ - """; + """ + class T { + /* + * asd + * fgh + */ + + int x; + }\ + """; String output = new Formatter().formatSource(input); String expect = - """ - class T { - /* - * asd - * fgh - */ - - int x; - } - """; + """ + class T { + /* + * asd + * fgh + */ + + int x; + } + """; assertThat(output).isEqualTo(expect); } @Test public void blockCommentTrailingBlank() throws FormatterException { String input = - """ - class T { - /* asd */ - - int x; - }\ - """; + """ + class T { + /* asd */ + + int x; + }\ + """; String output = new Formatter().formatSource(input); String expect = - """ - class T { - /* asd */ - - int x; - } - """; + """ + class T { + /* asd */ + + int x; + } + """; assertThat(output).isEqualTo(expect); } @Test public void lineCommentTrailingBlank() throws FormatterException { String input = - """ - class T { - // asd - - int x; - }\ - """; + """ + class T { + // asd + + int x; + }\ + """; String output = new Formatter().formatSource(input); String expect = - """ - class T { - // asd - - int x; - } - """; + """ + class T { + // asd + + int x; + } + """; assertThat(output).isEqualTo(expect); } @@ -321,35 +322,35 @@ public void lineCommentTrailingThinSpace() throws FormatterException { String input = "class T {\n // asd\u2009\n}\n"; String output = new Formatter().formatSource(input); String expect = - """ - class T { - // asd - } - """; + """ + class T { + // asd + } + """; assertThat(output).isEqualTo(expect); } @Test public void noBlankAfterLineCommentWithInteriorBlankLine() throws FormatterException { String input = - """ - class T { - // asd - - // dsa - int x; - }\ - """; + """ + class T { + // asd + + // dsa + int x; + }\ + """; String output = new Formatter().formatSource(input); String expect = - """ - class T { - // asd - - // dsa - int x; - } - """; + """ + class T { + // asd + + // dsa + int x; + } + """; assertThat(output).isEqualTo(expect); } @@ -358,11 +359,11 @@ public void badConstructor() throws FormatterException { String input = "class X { Y() {} }"; String output = new Formatter().formatSource(input); String expect = - """ - class X { - Y() {} - } - """; + """ + class X { + Y() {} + } + """; assertThat(output).isEqualTo(expect); } @@ -371,68 +372,68 @@ public void voidMethod() throws FormatterException { String input = "class X { void Y() {} }"; String output = new Formatter().formatSource(input); String expect = - """ - class X { - void Y() {} - } - """; + """ + class X { + void Y() {} + } + """; assertThat(output).isEqualTo(expect); } private static final String UNORDERED_IMPORTS = - """ - import com.google.common.base.Preconditions; - - import static org.junit.Assert.fail; - import static com.google.truth.Truth.assertThat; - - import org.junit.runners.JUnit4; - import org.junit.runner.RunWith; - - import java.util.List; - - import javax.annotation.Nullable; - """; + """ + import com.google.common.base.Preconditions; + + import static org.junit.Assert.fail; + import static com.google.truth.Truth.assertThat; + + import org.junit.runners.JUnit4; + import org.junit.runner.RunWith; + + import java.util.List; + + import javax.annotation.Nullable; + """; @Test public void importsNotReorderedByDefault() throws FormatterException { String input = - "package com.google.example;\n" + UNORDERED_IMPORTS + "public class ExampleTest {}\n"; + "package com.google.example;\n" + UNORDERED_IMPORTS + "public class ExampleTest {}\n"; String output = new Formatter().formatSource(input); String expect = - "package com.google.example;\n\n" + UNORDERED_IMPORTS + "\npublic class ExampleTest {}\n"; + "package com.google.example;\n\n" + UNORDERED_IMPORTS + "\npublic class ExampleTest {}\n"; assertThat(output).isEqualTo(expect); } @Test public void importsFixedIfRequested() throws FormatterException { String input = - "package com.google.example;\n" - + UNORDERED_IMPORTS - + """ - public class ExampleTest { - @Nullable List xs; - } - """; + "package com.google.example;\n" + + UNORDERED_IMPORTS + + """ + public class ExampleTest { + @Nullable List xs; + } + """; String output = new Formatter().formatSourceAndFixImports(input); String expect = - """ - package com.google.example; - - import java.util.List; - import javax.annotation.Nullable; - - public class ExampleTest { - @Nullable List xs; - } - """; + """ + package com.google.example; + + import java.util.List; + import javax.annotation.Nullable; + + public class ExampleTest { + @Nullable List xs; + } + """; assertThat(output).isEqualTo(expect); } @Test public void importOrderingWithoutFormatting() throws IOException, UsageException { importOrdering( - "--fix-imports-only", "com/google/googlejavaformat/java/testimports/A.imports-only"); + "--fix-imports-only", "com/google/googlejavaformat/java/testimports/A.imports-only"); } @Test @@ -443,19 +444,19 @@ public void importOrderingAndFormatting() throws IOException, UsageException { @Test public void formattingWithoutImportOrdering() throws IOException, UsageException { importOrdering( - "--skip-sorting-imports", - "com/google/googlejavaformat/java/testimports/A.formatting-and-unused-import-removal"); + "--skip-sorting-imports", + "com/google/googlejavaformat/java/testimports/A.formatting-and-unused-import-removal"); } @Test public void formattingWithoutRemovingUnusedImports() throws IOException, UsageException { importOrdering( - "--skip-removing-unused-imports", - "com/google/googlejavaformat/java/testimports/A.formatting-and-import-sorting"); + "--skip-removing-unused-imports", + "com/google/googlejavaformat/java/testimports/A.formatting-and-import-sorting"); } private void importOrdering(String sortArg, String outputResourceName) - throws IOException, UsageException { + throws IOException, UsageException { Path tmpdir = testFolder.newFolder().toPath(); Path path = tmpdir.resolve("Foo.java"); @@ -468,9 +469,9 @@ private void importOrdering(String sortArg, String outputResourceName) StringWriter err = new StringWriter(); Main main = new Main(new PrintWriter(out, true), new PrintWriter(err, true), System.in); String[] args = - sortArg != null - ? new String[] {sortArg, "-i", path.toString()} - : new String[] {"-i", path.toString()}; + sortArg != null + ? new String[]{sortArg, "-i", path.toString()} + : new String[]{"-i", path.toString()}; main.format(args); assertThat(err.toString()).isEmpty(); @@ -490,132 +491,132 @@ private String getResource(String resourceName) throws IOException { @Test public void testTrailingCommentWithoutTerminalNewline() throws Exception { assertThat(new Formatter().formatSource("/*\n * my comment */")) - .isEqualTo("/*\n * my comment */\n"); + .isEqualTo("/*\n * my comment */\n"); } @Test public void testEmptyArray() throws Exception { assertThat(new Formatter().formatSource("class T { int x[] = {,}; }")) - .isEqualTo( - """ - class T { - int x[] = {,}; - } - """); + .isEqualTo( + """ + class T { + int x[] = {,}; + } + """); } @Test public void stringEscapeLength() throws Exception { assertThat(new Formatter().formatSource("class T {{ f(\"\\\"\"); }}")) - .isEqualTo( - """ - class T { - { - f(\"\\\"\"); - } - } - """); + .isEqualTo( + """ + class T { + { + f(\"\\\"\"); + } + } + """); } @Test public void wrapLineComment() throws Exception { assertThat( new Formatter() - .formatSource( -""" -class T { - public static void main(String[] args) { // one long incredibly unbroken sentence moving from topic to topic so that no-one had a chance to interrupt; - } -} -""")) - .isEqualTo( -""" -class T { - public static void main( - String[] - args) { // one long incredibly unbroken sentence moving from topic to topic so that no-one - // had a chance to interrupt; - } -} -"""); + .formatSource( + """ + class T { + public static void main(String[] args) { // one long incredibly unbroken sentence moving from topic to topic so that no-one had a chance to interrupt; + } + } + """)) + .isEqualTo( + """ + class T { + public static void main( + String[] + args) { // one long incredibly unbroken sentence moving from topic to topic so that no-one + // had a chance to interrupt; + } + } + """); } @Test public void onlyWrapLineCommentOnWhitespace() throws Exception { assertThat( new Formatter() - .formatSource( -""" -class T { - public static void main(String[] args) { // one_long_incredibly_unbroken_sentence_moving_from_topic_to_topic_so_that_no-one_had_a_chance_to_interrupt; - } -} -""")) - .isEqualTo( -""" -class T { - public static void main( - String[] - args) { // one_long_incredibly_unbroken_sentence_moving_from_topic_to_topic_so_that_no-one_had_a_chance_to_interrupt; - } -} -"""); + .formatSource( + """ + class T { + public static void main(String[] args) { // one_long_incredibly_unbroken_sentence_moving_from_topic_to_topic_so_that_no-one_had_a_chance_to_interrupt; + } + } + """)) + .isEqualTo( + """ + class T { + public static void main( + String[] + args) { // one_long_incredibly_unbroken_sentence_moving_from_topic_to_topic_so_that_no-one_had_a_chance_to_interrupt; + } + } + """); } @Test public void onlyWrapLineCommentOnWhitespace_noLeadingWhitespace() throws Exception { assertThat( new Formatter() - .formatSource( -""" -class T { - public static void main(String[] args) { //one_long_incredibly_unbroken_sentence_moving_from_topic_to_topic_so_that_no-one_had_a_chance_to_interrupt; - } -} -""")) - .isEqualTo( -""" -class T { - public static void main( - String[] - args) { // one_long_incredibly_unbroken_sentence_moving_from_topic_to_topic_so_that_no-one_had_a_chance_to_interrupt; - } -} -"""); + .formatSource( + """ + class T { + public static void main(String[] args) { //one_long_incredibly_unbroken_sentence_moving_from_topic_to_topic_so_that_no-one_had_a_chance_to_interrupt; + } + } + """)) + .isEqualTo( + """ + class T { + public static void main( + String[] + args) { // one_long_incredibly_unbroken_sentence_moving_from_topic_to_topic_so_that_no-one_had_a_chance_to_interrupt; + } + } + """); } @Test public void throwsFormatterException() throws Exception { assertThrows( - FormatterException.class, - () -> new Formatter().formatSourceAndFixImports("package foo; public class {")); + FormatterException.class, + () -> new Formatter().formatSourceAndFixImports("package foo; public class {")); } @Test public void blankLinesImportComment() throws FormatterException { String withBlank = - """ - package p; - - /** test */ - - import a.A; - - class T { - A a; - } - """; + """ + package p; + + /** test */ + + import a.A; + + class T { + A a; + } + """; String withoutBlank = - """ - package p; - - /** test */ - import a.A; - - class T { - A a; - } - """; + """ + package p; + + /** test */ + import a.A; + + class T { + A a; + } + """; // Formatting deletes the blank line between the "javadoc" and the first import. assertThat(new Formatter().formatSource(withBlank)).isEqualTo(withoutBlank); @@ -634,39 +635,67 @@ class T { public void dontWrapMoeLineComments() throws Exception { assertThat( new Formatter() - .formatSource( -""" -class T { - // MOE: one long incredibly unbroken sentence moving from topic to topic so that no-one had a chance to interrupt; -} -""")) - .isEqualTo( -""" -class T { - // MOE: one long incredibly unbroken sentence moving from topic to topic so that no-one had a chance to interrupt; -} -"""); + .formatSource( + """ + class T { + // MOE: one long incredibly unbroken sentence moving from topic to topic so that no-one had a chance to interrupt; + } + """)) + .isEqualTo( + """ + class T { + // MOE: one long incredibly unbroken sentence moving from topic to topic so that no-one had a chance to interrupt; + } + """); } @Test public void removeTrailingTabsInComments() throws Exception { assertThat( new Formatter() - .formatSource( - "class Foo {\n" - + " void f() {\n" - + " int x = 0; // comment\t\t\t\n" - + " return;\n" - + " }\n" - + "}\n")) - .isEqualTo( - """ - class Foo { - void f() { - int x = 0; // comment - return; - } - } - """); + .formatSource( + "class Foo {\n" + + " void f() {\n" + + " int x = 0; // comment\t\t\t\n" + + " return;\n" + + " }\n" + + "}\n")) + .isEqualTo( + """ + class Foo { + void f() { + int x = 0; // comment + return; + } + } + """); + } + + @Test + public void multivariableTryWithResources() throws Exception { + String input = + "class Test {\n" + + " void m() {\n" + + " try (var input = Files.newInputStream(Path.of(\"./input\"));\n" + + " var output = Files.newOutputStream(Path.of(\"./output\"));) {\n" + + " output.write(input.read());\n" + + " } catch (IOException _) {\n" + + " }\n" + + " }\n" + + "}\n"; + String expected = + "class Test {\n" + + " void m() {\n" + + " try (\n" + + " var input = Files.newInputStream(Path.of(\"./input\"));\n" + + " var output = Files.newOutputStream(Path.of(\"./output\"));\n" + + " ) {\n" + + " output.write(input.read());\n" + + " } catch (IOException _) {\n" + + " }\n" + + " }\n" + + "}\n"; + + assertThat(new Formatter().formatSource(input)).isEqualTo(expected); } } diff --git a/core/src/test/resources/com/google/googlejavaformat/java/testdata/B21465217.output b/core/src/test/resources/com/google/googlejavaformat/java/testdata/B21465217.output index add19d3db..df207a74d 100644 --- a/core/src/test/resources/com/google/googlejavaformat/java/testdata/B21465217.output +++ b/core/src/test/resources/com/google/googlejavaformat/java/testdata/B21465217.output @@ -1,9 +1,10 @@ class B21465217 { void m() { - try (JimfsOutputStream out2 = newOutputStream(false); + try ( + JimfsOutputStream out2 = newOutputStream(false); BufferedOutputStream bout = new BufferedOutputStream(out2); - OutputStreamWriter writer = - new OutputStreamWriter(bout, UTF_8___________________________)) {} + OutputStreamWriter writer = new OutputStreamWriter(bout, UTF_8___________________________) + ) {} try (Writer sourceWriter = env.getFiler().createSourceFile(qualifiedNamezzzzzzzz).openWriter()) { diff --git a/core/src/test/resources/com/google/googlejavaformat/java/testdata/B26159561.output b/core/src/test/resources/com/google/googlejavaformat/java/testdata/B26159561.output index d9ae26904..8aa6a4f53 100644 --- a/core/src/test/resources/com/google/googlejavaformat/java/testdata/B26159561.output +++ b/core/src/test/resources/com/google/googlejavaformat/java/testdata/B26159561.output @@ -1,7 +1,9 @@ class B26159561 { { - try (A a = a(); - B b = b()) {} + try ( + A a = a(); + B b = b() + ) {} try (A a = a(); ) {} } } diff --git a/core/src/test/resources/com/google/googlejavaformat/java/testdata/TryWithResources.input b/core/src/test/resources/com/google/googlejavaformat/java/testdata/TryWithResources.input index 5d294f94a..01a63b6d0 100644 --- a/core/src/test/resources/com/google/googlejavaformat/java/testdata/TryWithResources.input +++ b/core/src/test/resources/com/google/googlejavaformat/java/testdata/TryWithResources.input @@ -1,4 +1,4 @@ -class TryWtihResources { +class TryWithResources { { try (@A C c = c(); ) {} try (final @A C c = c(); ) {} diff --git a/core/src/test/resources/com/google/googlejavaformat/java/testdata/TryWithResources.output b/core/src/test/resources/com/google/googlejavaformat/java/testdata/TryWithResources.output index 5d294f94a..01a63b6d0 100644 --- a/core/src/test/resources/com/google/googlejavaformat/java/testdata/TryWithResources.output +++ b/core/src/test/resources/com/google/googlejavaformat/java/testdata/TryWithResources.output @@ -1,4 +1,4 @@ -class TryWtihResources { +class TryWithResources { { try (@A C c = c(); ) {} try (final @A C c = c(); ) {} From 5d8af08db9473b658aa9df330c8e9921ec773500 Mon Sep 17 00:00:00 2001 From: Saloni Gupta Date: Sat, 12 Sep 2026 00:47:58 +0200 Subject: [PATCH 2/2] Re-trigger CLA check