commit | e8b2235c46ec0277d183865fcb38c86f4b9ee511 | [log] [tgz] |
---|---|---|
author | Ryo Hashimoto <hashimoto@google.com> | Fri Nov 13 12:21:22 2020 +0900 |
committer | Ryo Hashimoto <hashimoto@google.com> | Fri Nov 13 16:06:48 2020 +0900 |
tree | dbc5db20b68af986e7b86a8fefe89151c05e0e39 | |
parent | 71a2fd0f21dd0b7ffbc0a745307961a9c6020fe6 [diff] |
mojo: Fix Java binding generator for array<enum> Values should be validated by iterating with i{{level+1}}. This is a cherry-pick of http://crrev.com/c/2532547 Bug: 173033003 Test: build Change-Id: I896799dd408000c4f391e66dfeba92f0378a0f4e
diff --git a/mojo/public/tools/bindings/generators/java_templates/data_types_definition.tmpl b/mojo/public/tools/bindings/generators/java_templates/data_types_definition.tmpl index 7af57bd..568db8e 100644 --- a/mojo/public/tools/bindings/generators/java_templates/data_types_definition.tmpl +++ b/mojo/public/tools/bindings/generators/java_templates/data_types_definition.tmpl
@@ -100,8 +100,8 @@ {%- else %} { {%- endif %} - for (int i{{level}} = 0; i{{level}} < {{variable}}.length; ++i{{level}}) { - {{kind.kind|java_class_for_enum}}.validate({{variable}}[i{{level}}]); + for (int i{{level+1}} = 0; i{{level+1}} < {{variable}}.length; ++i{{level+1}}) { + {{kind.kind|java_class_for_enum}}.validate({{variable}}[i{{level+1}}]); } } {%- elif kind|is_enum_kind %}