diff --git a/content/language/guarded-patterns.yaml b/content/language/guarded-patterns.yaml index b73288d..b9e613c 100644 --- a/content/language/guarded-patterns.yaml +++ b/content/language/guarded-patterns.yaml @@ -10,7 +10,8 @@ modernLabel: "Java 21+" oldApproach: "Nested if" modernApproach: "when Clause" oldCode: |- - if (shape instanceof Circle c) { + if (shape instanceof Circle) { + Circle c = (Circle) shape; if (c.radius() > 10) { return "large circle"; } else {