Skip to content

Commit 3f2407d

Browse files
committed
fix test, class variables with no init value are set to None
1 parent 28f039a commit 3f2407d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

java2python/compiler/visitor.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,10 @@ def acceptVarDeclaration(self, node, memo):
228228
if node.firstChildOfType(tokens.TYPE).firstChildOfType(tokens.ARRAY_DECLARATOR_LIST):
229229
val = assgnExp.pushRight('[]')
230230
else:
231-
val = assgnExp.pushRight('{0}()'.format(identExp.type))
231+
if node.firstChildOfType(tokens.TYPE).firstChild().type != tokens.QUALIFIED_TYPE_IDENT:
232+
val = assgnExp.pushRight('{0}()'.format(identExp.type))
233+
else:
234+
val = assgnExp.pushRight('None')
232235
return self
233236

234237

0 commit comments

Comments
 (0)