@@ -354,6 +354,7 @@ void java_bytecode_convert_method_lazy(
354354 method_symbol.mode =ID_java;
355355 method_symbol.location =m.source_location ;
356356 method_symbol.location .set_function (method_identifier);
357+
357358 if (m.is_public )
358359 member_type.set_access (ID_public);
359360 else if (m.is_protected )
@@ -363,18 +364,6 @@ void java_bytecode_convert_method_lazy(
363364 else
364365 member_type.set_access (ID_default);
365366
366- if (is_constructor (method_symbol.base_name ))
367- {
368- method_symbol.pretty_name =
369- id2string (class_symbol.pretty_name )+" ." +
370- id2string (class_symbol.base_name )+" ()" ;
371- member_type.set_is_constructor ();
372- }
373- else
374- method_symbol.pretty_name =
375- id2string (class_symbol.pretty_name )+" ." +
376- id2string (m.base_name )+" ()" ;
377-
378367 // do we need to add 'this' as a parameter?
379368 if (!m.is_static )
380369 {
@@ -387,6 +376,24 @@ void java_bytecode_convert_method_lazy(
387376 parameters.insert (parameters.begin (), this_p);
388377 }
389378
379+ const std::string signature_string = pretty_signature (member_type);
380+
381+ if (is_constructor (method_symbol.base_name ))
382+ {
383+ // we use full.class_name(...) as pretty name
384+ // for constructors -- the idea is that they have
385+ // an empty declarator.
386+ method_symbol.pretty_name =
387+ id2string (class_symbol.pretty_name ) + signature_string;
388+
389+ member_type.set_is_constructor ();
390+ }
391+ else
392+ {
393+ method_symbol.pretty_name = id2string (class_symbol.pretty_name ) + " ." +
394+ id2string (m.base_name ) + signature_string;
395+ }
396+
390397 // Load annotations
391398 if (!m.annotations .empty ())
392399 {
@@ -559,22 +566,27 @@ void java_bytecode_convert_methodt::convert(
559566 method_symbol.location =m.source_location ;
560567 method_symbol.location .set_function (method_identifier);
561568
569+ const std::string signature_string = pretty_signature (code_type);
570+
562571 // Set up the pretty name for the method entry in the symbol table.
563572 // The pretty name of a constructor includes the base name of the class
564573 // instead of the internal method name "<init>". For regular methods, it's
565574 // just the base name of the method.
566575 if (is_constructor (method_symbol.base_name ))
567576 {
568- method_symbol.pretty_name = id2string (class_symbol.pretty_name ) + " ." +
569- id2string (class_symbol.base_name ) + " ()" ;
577+ // we use full.class_name(...) as pretty name
578+ // for constructors -- the idea is that they have
579+ // an empty declarator.
580+ method_symbol.pretty_name =
581+ id2string (class_symbol.pretty_name ) + signature_string;
570582 INVARIANT (
571583 code_type.get_is_constructor (),
572584 " Member type should have already been marked as a constructor" );
573585 }
574586 else
575587 {
576588 method_symbol.pretty_name = id2string (class_symbol.pretty_name ) + " ." +
577- id2string (method_symbol .base_name ) + " () " ;
589+ id2string (m .base_name ) + signature_string ;
578590 }
579591
580592 method_symbol.type = code_type;
0 commit comments