Skip to content
This repository was archived by the owner on Jan 13, 2026. It is now read-only.

Commit 21863c1

Browse files
committed
Add is_acceptable to J
1 parent a50a3a0 commit 21863c1

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

rewrite/rewrite/java/support_types.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ def prefix(self) -> Space:
2626
def with_prefix(self, prefix: Space) -> 'J':
2727
...
2828

29+
def is_acceptable(self, v: TreeVisitor[Any, P], p: P) -> bool:
30+
from .visitor import JavaVisitor
31+
return isinstance(v, JavaVisitor)
32+
2933
def accept(self, v: TreeVisitor[Any, P], p: P) -> Optional[Any]:
3034
from .visitor import JavaVisitor
3135
return self.accept_java(v.adapt(J, JavaVisitor), p)

0 commit comments

Comments
 (0)