@@ -167,16 +167,19 @@ exprt java_bytecode_promotion(const exprt &expr)
167
167
return typecast_exprt (expr, new_type);
168
168
}
169
169
170
- // / Returns the full class name, skipping over the generics
171
- // / \param src: a type descriptor or signature like LOuterClass<TT;>.Inner;
172
- // / \return The full name of the class like OuterClass.Inner
173
- std::string gather_full_class_name (const std::string &src)
170
+ void add_generic_type_information (
171
+ java_generic_typet &generic_type,
172
+ const std::string ¶meters)
174
173
{
175
- PRECONDITION (src[0 ] == ' L' );
176
- PRECONDITION (src[src.size () - 1 ] == ' ;' );
177
-
178
- std::string class_name = src.substr (1 , src.size () - 2 );
174
+ }
179
175
176
+ // / Take a signature string and remove everything in angle brackets allowing
177
+ // / for the type to be parsed normally.
178
+ // / \param src: The input string
179
+ // / \return The input string with everything between angle brackets removed
180
+ std::string erase_type_arguments (const std::string &src)
181
+ {
182
+ std::string class_name = src;
180
183
std::size_t f_pos = class_name.find (' <' , 1 );
181
184
182
185
while (f_pos != std::string::npos)
@@ -196,6 +199,24 @@ std::string gather_full_class_name(const std::string &src)
196
199
// Search the remainder of the string for generic signature
197
200
f_pos = class_name.find (' <' , e_pos + 1 );
198
201
}
202
+ return class_name;
203
+ }
204
+
205
+ // / Returns the full class name, skipping over the generics.
206
+ // / \param src: a type descriptor or signature
207
+ // / 1. Signature: Lcom/package/OuterClass<TT;>.Inner;
208
+ // / 2. Descriptor: Lcom.pacakge.OuterClass$Inner;
209
+ // / \return The full name of the class like com.package.OuterClass.Inner (for
210
+ // / both examples).
211
+ std::string gather_full_class_name (const std::string &src)
212
+ {
213
+ PRECONDITION (src.size () >= 2 );
214
+ PRECONDITION (src[0 ] == ' L' );
215
+ PRECONDITION (src[src.size () - 1 ] == ' ;' );
216
+
217
+ std::string class_name = src.substr (1 , src.size () - 2 );
218
+
219
+ class_name = erase_type_arguments (class_name);
199
220
200
221
std::replace (class_name.begin (), class_name.end (), ' .' , ' $' );
201
222
std::replace (class_name.begin (), class_name.end (), ' /' , ' .' );
0 commit comments