File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -96,20 +96,22 @@ def java_field_type(spec, domain):
9696 return javaTypeMap [spec .resolveDomain (domain )]
9797
9898def java_field_default_value (type , value ):
99+ val_map = {"value" : value }
99100 if type == 'int' :
100101 return value
101102 elif type == 'boolean' :
102- return "{0}" .format (value ).lower ()
103+ bool_str = '%(value)s' % val_map
104+ return bool_str .lower ()
103105 elif type == 'String' :
104- return " \" {0} \" " . format (value )
106+ return '"% (value)s"' % val_map
105107 elif type == 'LongString' :
106- return " LongStringHelper.asLongString(\" {0} \" )" . format (value )
108+ return ' LongStringHelper.asLongString("% (value)s")' % val_map
107109 elif type == 'long' :
108- return "{0}L" . format (value )
110+ return '% (value)sL' % val_map
109111 elif type == 'Map<String,Object>' :
110112 return "null"
111113 else :
112- raise BogusDefaultValue ("JSON provided default value {0} for suspicious type {1}" . format ( value , type ) )
114+ raise BogusDefaultValue ("JSON provided default value %(value)s for suspicious type %(type)s" % { " value" : value , " type" : type } )
113115
114116def typeNameDefault (spec , a ):
115117 fieldType = java_field_type (spec , a .domain )
You can’t perform that action at this time.
0 commit comments