We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e396dec commit db38e58Copy full SHA for db38e58
j2py/addinit.py
@@ -98,12 +98,22 @@ def add_init(ast):
98
overloaded_methods = set()
99
100
cblock = decode("[]")
101
+
102
+ use_class_init = False
103
104
+ for n in body_code:
105
+ if n.name == "StaticInit":
106
+ use_class_init = True
107
+ break
108
109
for n in body_code:
110
if n.name == "FieldDec":
111
dest = block
112
if is_static(n):
- dest = cblock
113
+ if use_class_init:
114
+ dest = cblock
115
+ else:
116
+ continue
117
for v in n.findall("VarDec"):
118
vc=v.copy()
119
vcn = vc.findfirst("Id")
0 commit comments