File tree Expand file tree Collapse file tree
packages/plugins/java/java Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -237,7 +237,15 @@ export class JavaResolversVisitor extends BaseVisitor<
237237 }
238238 return indentMultiline (
239239 `if (args.get("${ arg . name . value } ") != null) {
240- this.${ arg . name . value } = (${ this . config . listType } <${ typeToUse . baseType } >) args.get("${ arg . name . value } ");
240+ this.${ arg . name . value } = new ArrayList<${ typeToUse . baseType } >();
241+ for (var o : (${ this . config . listType } ) args.get("${ arg . name . value } ")) {
242+ if (o != null) {
243+ this.${ arg . name . value } .add(new ${ typeToUse . baseType } (o));
244+ }
245+ else {
246+ this.${ arg . name . value } .add(null);
247+ }
248+ }
241249}` ,
242250 3 ,
243251 ) ;
Original file line number Diff line number Diff line change @@ -158,7 +158,15 @@ describe('Java', () => {
158158 if (args != null) {
159159 this.f = (Iterable<String>) args.get("f");
160160 if (args.get("g") != null) {
161- this.g = (Iterable<SearchUserInput>) args.get("g");
161+ this.g = new ArrayList<SearchUserInput>();
162+ for (var o : (Iterable) args.get("g")) {
163+ if (o != null) {
164+ this.g.add(new SearchUserInput(o));
165+ }
166+ else {
167+ this.g.add(null);
168+ }
169+ }
162170 }
163171 }
164172 }
You can’t perform that action at this time.
0 commit comments