Commit aecb4b4
authored
C#: Use safe pattern-match in CSharpVisitor for VisitExpression/VisitStatement (#7133)
* C#: Use safe pattern-match in CSharpVisitor for VisitExpression/VisitStatement
Replace unsafe direct casts with pattern-match early returns in all
CSharpVisitor methods that call VisitExpression() or VisitStatement(),
matching the established pattern in JavaVisitor.cs.
* C#: Add tests for safe VisitStatement/VisitExpression type replacement
Verify that when VisitStatement or VisitExpression returns a different
type, the visitor method returns that result gracefully instead of
throwing a ClassCastException.
* C#: Add JavaVisitor tests for safe VisitStatement/VisitExpression type replacement1 parent 48d403b commit aecb4b4
File tree
3 files changed
+851
-505
lines changed- rewrite-csharp/csharp/OpenRewrite
- CSharp
- Tests
- CSharp
- Java
3 files changed
+851
-505
lines changed
0 commit comments