@@ -833,13 +833,12 @@ def generate_template_data(data)
833
833
834
834
def append_marshalers ( lines )
835
835
dict_type = is_foundation? ? "NSDictionary" : "CFDictionary"
836
- dict_generics = is_foundation? ? "<NSString, NSObject>" : ""
837
836
base_type = is_foundation? ? "NSObject" : "CFType"
838
837
839
838
lines << "public static class Marshaler {"
840
839
lines << " @MarshalsPointer"
841
840
lines << " public static #{ @name } toObject(Class<#{ @name } > cls, long handle, long flags) {"
842
- lines << " #{ dict_type } #{ dict_generics } o = (#{ dict_type } #{ dict_generics } ) #{ base_type } .Marshaler.toObject(#{ dict_type } .class, handle, flags);"
841
+ lines << " #{ dict_type } o = (#{ dict_type } ) #{ base_type } .Marshaler.toObject(#{ dict_type } .class, handle, flags);"
843
842
lines << " if (o == null) {"
844
843
lines << " return null;"
845
844
lines << " }"
@@ -854,7 +853,7 @@ def append_marshalers(lines)
854
853
lines << " }"
855
854
lines << "}"
856
855
857
- array_type = is_foundation? ? "NSArray<#{ dict_type } #{ dict_generics } >" : "CFArray"
856
+ array_type = is_foundation? ? "NSArray<#{ dict_type } >" : "CFArray"
858
857
array_class = is_foundation? ? "NSArray.class" : "CFArray.class"
859
858
860
859
lines << "public static class AsListMarshaler {"
@@ -876,7 +875,7 @@ def append_marshalers(lines)
876
875
lines << " if (l == null) {"
877
876
lines << " return 0L;"
878
877
lines << " }"
879
- lines << " NSArray<NSDictionary<NSString, NSObject> > array = new NSMutableArray<>();" if is_foundation?
878
+ lines << " NSArray<NSDictionary> array = new NSMutableArray<>();" if is_foundation?
880
879
lines << " CFArray array = CFMutableArray.create();" if !is_foundation?
881
880
lines << " for (#{ @name } i : l) {"
882
881
lines << " array.add(i.getDictionary());"
@@ -887,7 +886,7 @@ def append_marshalers(lines)
887
886
end
888
887
889
888
def append_constructors ( lines )
890
- dict_type = is_foundation? ? "NSDictionary<NSString, NSObject> " : "CFDictionary"
889
+ dict_type = is_foundation? ? "NSDictionary" : "CFDictionary"
891
890
892
891
constructor_visibility = @constructor_visibility . nil? ? '' : "#{ @constructor_visibility } "
893
892
@@ -1004,7 +1003,7 @@ def convenience_getter_value(type, type_hint, key_accessor)
1004
1003
s << "return #{ name } .valueOf(val);"
1005
1004
end
1006
1005
elsif resolved_type . is_a? ( GlobalValueDictionaryWrapper ) || type_hint == 'GlobalValueDictionaryWrapper'
1007
- s << "NSDictionary<NSString, NSObject> val = (NSDictionary<NSString, NSObject> ) get(#{ key_accessor } );"
1006
+ s << "NSDictionary val = (NSDictionary) get(#{ key_accessor } );"
1008
1007
s << "return new #{ name } (val);"
1009
1008
elsif resolved_type . is_a? ( Enum )
1010
1009
s << "NSNumber val = (NSNumber) get(#{ key_accessor } );"
@@ -1044,8 +1043,8 @@ def convenience_getter_value(type, type_hint, key_accessor)
1044
1043
generic_type = @model . resolve_type_by_name ( "#{ $1} " )
1045
1044
if generic_type . is_a? ( GlobalValueDictionaryWrapper )
1046
1045
s << "List<#{ $1} > list = new ArrayList<>();"
1047
- s << "NSDictionary<NSString, NSObject> [] array = (NSDictionary<NSString, NSObject> []) val.toArray(new NSDictionary[val.size()]);"
1048
- s << "for (NSDictionary<NSString, NSObject> d : array) {"
1046
+ s << "NSDictionary[] array = (NSDictionary[]) val.toArray(new NSDictionary[val.size()]);"
1047
+ s << "for (NSDictionary d : array) {"
1049
1048
s << " list.add(new #{ $1} (d));"
1050
1049
s << "}"
1051
1050
s << "return list;"
@@ -1173,7 +1172,7 @@ def convenience_setter_value(type, type_hint, param_name)
1173
1172
generic_type = @model . resolve_type_by_name ( "#{ $1} " )
1174
1173
if generic_type . is_a? ( GlobalValueDictionaryWrapper )
1175
1174
s = [ ]
1176
- s << " NSArray<NSDictionary<NSString, NSObject> > val = new NSMutableArray<>();"
1175
+ s << " NSArray<NSDictionary> val = new NSMutableArray<>();"
1177
1176
s << " for (#{ generic_type . name } e : #{ param_name } ) {"
1178
1177
s << " val.add(e.getDictionary());"
1179
1178
s << " }"
0 commit comments