Skip to content

Commit 3a45ee9

Browse files
author
svorenova
committed
Improving warnings for unsupported signatures for generics
1 parent f3cdd97 commit 3a45ee9

File tree

2 files changed

+17
-13
lines changed

2 files changed

+17
-13
lines changed

src/java_bytecode/java_bytecode_convert_class.cpp

+15-11
Original file line numberDiff line numberDiff line change
@@ -202,10 +202,12 @@ void java_bytecode_convert_classt::convert(const classt &c)
202202
}
203203
class_type=generic_class_type;
204204
}
205-
catch(unsupported_java_class_signature_exceptiont)
205+
catch(unsupported_java_class_signature_exceptiont &e)
206206
{
207-
warning() << "we currently don't support parsing for example double "
208-
"bounded, recursive and wild card generics" << eom;
207+
warning() << "Class: " << c.name
208+
<< "\n could not parse signature: " << c.signature.value()
209+
<< "\n " << e.what() << "\n ignoring that the class is generic"
210+
<< eom;
209211
}
210212
}
211213

@@ -253,11 +255,12 @@ void java_bytecode_convert_classt::convert(const classt &c)
253255
base, superclass_ref.value(), qualified_classname);
254256
class_type.add_base(generic_base);
255257
}
256-
catch(unsupported_java_class_signature_exceptiont)
258+
catch(unsupported_java_class_signature_exceptiont &e)
257259
{
258-
debug() << "unsupported generic superclass signature "
259-
<< id2string(*superclass_ref)
260-
<< " falling back on using the descriptor" << eom;
260+
warning() << "Superclass: " << c.extends << " of class: " << c.name
261+
<< "\n could not parse signature: " << superclass_ref.value()
262+
<< "\n " << e.what()
263+
<< "\n ignoring that the superclass is generic" << eom;
261264
class_type.add_base(base);
262265
}
263266
}
@@ -292,11 +295,12 @@ void java_bytecode_convert_classt::convert(const classt &c)
292295
base, interface_ref.value(), qualified_classname);
293296
class_type.add_base(generic_base);
294297
}
295-
catch(unsupported_java_class_signature_exceptiont)
298+
catch(unsupported_java_class_signature_exceptiont &e)
296299
{
297-
debug() << "unsupported generic interface signature "
298-
<< id2string(*interface_ref)
299-
<< " falling back on using the descriptor" << eom;
300+
warning() << "Interface: " << interface << " of class: " << c.name
301+
<< "\n could not parse signature: " << interface_ref.value()
302+
<< "\n " << e.what()
303+
<< "\n ignoring that the interface is generic" << eom;
300304
class_type.add_base(base);
301305
}
302306
}

src/java_bytecode/java_bytecode_convert_method.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -286,15 +286,15 @@ code_typet member_type_lazy(
286286
}
287287
else
288288
{
289-
message.warning() << "method: " << class_name << "." << method_name
289+
message.warning() << "Method: " << class_name << "." << method_name
290290
<< "\n signature: " << signature.value() << "\n descriptor: "
291291
<< descriptor << "\n different number of parameters, reverting to "
292292
"descriptor" << message.eom;
293293
}
294294
}
295295
catch(unsupported_java_class_signature_exceptiont &e)
296296
{
297-
message.warning() << "method: " << class_name << "." << method_name
297+
message.warning() << "Method: " << class_name << "." << method_name
298298
<< "\n could not parse signature: " << signature.value() << "\n "
299299
<< e.what() << "\n" << " reverting to descriptor: "
300300
<< descriptor << message.eom;

0 commit comments

Comments
 (0)