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

Commit ec760b9

Browse files
committed
Fix bug in visit_container()
In Python referential equality must be checked using `is` rather than `==`.
1 parent 3542912 commit ec760b9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rewrite/rewrite/java/extensions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def visit_container(v: 'JavaVisitor', container: Optional[JContainer[J2]], loc:
2222
js = [v.visit_right_padded(el, loc.element_location, p) for el in container.padding.elements]
2323
v.cursor = v.cursor.parent
2424

25-
return container if js == container.padding.elements and before is container.before else JContainer(before, js, container.markers)
25+
return container if js is container.padding.elements and before is container.before else JContainer(before, js, container.markers)
2626

2727

2828
def visit_right_padded(v: 'JavaVisitor', right: Optional[JRightPadded[T]], loc: JRightPadded.Location, p) -> Optional[JRightPadded[T]]:

0 commit comments

Comments
 (0)