From 10539afe714c51f285d304bbdec3578a198b3ac7 Mon Sep 17 00:00:00 2001 From: lkerford Date: Fri, 8 Nov 2024 16:13:40 -0800 Subject: [PATCH] adding test which have been fixed --- .../analysis/controlflow/ControlFlowTest.java | 14 +++++++------- .../analysis/controlflow/GuardTest.java | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/test/java/org/openrewrite/analysis/controlflow/ControlFlowTest.java b/src/test/java/org/openrewrite/analysis/controlflow/ControlFlowTest.java index eca648e38..9aa066fab 100644 --- a/src/test/java/org/openrewrite/analysis/controlflow/ControlFlowTest.java +++ b/src/test/java/org/openrewrite/analysis/controlflow/ControlFlowTest.java @@ -1665,10 +1665,10 @@ void test() /*~~(BB: 22 CN: 12 EX: 1 | 1L)~~>*/{ /*~~(3L)~~>*/if ((/*~~(2C)~~>*/potato)) /*~~(4L)~~>*/{ // ... } - /*~~(5L)~~>*/if (/*~~(3C)~~>*/potato && /*~~(6L)~~>*/turnip) /*~~(7L)~~>*/{ + /*~~(5L)~~>*/if (/*~~(3C)~~>*/potato && /*~~(6L)~~>*//*~~(4C)~~>*/turnip) /*~~(7L)~~>*/{ // ... } - /*~~(8L)~~>*/if (/*~~(5C)~~>*/potato && /*~~(9L)~~>*/turnip || /*~~(10L)~~>*/squash) /*~~(11L)~~>*/{ + /*~~(8L)~~>*/if (/*~~(5C)~~>*/potato && /*~~(9L)~~>*//*~~(6C)~~>*/turnip || /*~~(10L)~~>*//*~~(7C)~~>*/squash) /*~~(11L)~~>*/{ // ... } int a = /*~~(12L)~~>*/1, b = 2; @@ -1925,7 +1925,7 @@ abstract class Test { abstract boolean otherCondition(); void test() /*~~(BB: 3 CN: 2 EX: 1 | 1L)~~>*/{ - while (/*~~(1C)~~>*/condition() && /*~~(2L | 2C)~~>*/otherCondition())/*~~(3L)~~>*/; + while (/*~~(1C)~~>*/condition() && /*~~(2L | 2C)~~>*//*~~(2C)~~>*/otherCondition())/*~~(3L)~~>*/; } } """ @@ -1956,7 +1956,7 @@ abstract class Test { abstract boolean thirdCondition(); void test() /*~~(BB: 4 CN: 3 EX: 1 | 1L)~~>*/{ - while (/*~~(1C)~~>*/condition() && /*~~(2L | 2C)~~>*/otherCondition() && /*~~(3L | 3C)~~>*/thirdCondition())/*~~(4L)~~>*/; + while (/*~~(1C)~~>*/condition() && /*~~(2L | 2C)~~>*//*~~(2C)~~>*/otherCondition() && /*~~(3L | 3C)~~>*//*~~(3C)~~>*/thirdCondition())/*~~(4L)~~>*/; } } """ @@ -2439,7 +2439,7 @@ void test(boolean condition) { """ abstract class Test { abstract String[] array(); - + void test(boolean condition) /*~~(BB: 5 CN: 2 EX: 1 | 1L)~~>*/{ for (String s : /*~~(1C)~~>*/condition ? /*~~(2L)~~>*/array() : new /*~~(3L)~~>*/String[] { "Hello!" }) /*~~(4L)~~>*/{ System.out.println(s); @@ -2698,7 +2698,7 @@ void switchCaseNoDefault() { """ class Test { enum E { A, B, C } - + void test(E x) { switch (x) { case A: @@ -2718,7 +2718,7 @@ void test(E x) { """ class Test { enum E { A, B, C } - + void test(E x) /*~~(BB: 7 CN: 3 EX: 1 | 1L)~~>*/{ switch (x) { /*~~(1C)~~>*/case A: diff --git a/src/test/java/org/openrewrite/analysis/controlflow/GuardTest.java b/src/test/java/org/openrewrite/analysis/controlflow/GuardTest.java index a0b7e14f7..f19719d7c 100644 --- a/src/test/java/org/openrewrite/analysis/controlflow/GuardTest.java +++ b/src/test/java/org/openrewrite/analysis/controlflow/GuardTest.java @@ -283,7 +283,7 @@ void test() { @Test void identifiesGuardsForControlParenthesesWithMissingTypeInformation() { rewriteRun( - spec -> spec.typeValidationOptions(TypeValidation.builder().identifiers(false).build()), + spec -> spec.typeValidationOptions(TypeValidation.none()), java( """ class Test {