@@ -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,20 +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- // we use full.class_name.class_name(...) as pretty name
369- // for constructors
370- method_symbol.pretty_name =
371- id2string (class_symbol.pretty_name )+" ." +
372- id2string (class_symbol.base_name )+" ()" ;
373- member_type.set_is_constructor ();
374- }
375- else
376- method_symbol.pretty_name =
377- id2string (class_symbol.pretty_name )+" ." +
378- id2string (m.base_name )+" ()" ;
379-
380367 // do we need to add 'this' as a parameter?
381368 if (!m.is_static )
382369 {
@@ -389,6 +376,23 @@ void java_bytecode_convert_method_lazy(
389376 parameters.insert (parameters.begin (), this_p);
390377 }
391378
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.class_name(...) as pretty name
384+ // for constructors
385+ method_symbol.pretty_name =
386+ id2string (class_symbol.pretty_name ) + " ." +
387+ id2string (class_symbol.base_name ) + signature_string;
388+ member_type.set_is_constructor ();
389+ }
390+ else
391+ {
392+ method_symbol.pretty_name = id2string (class_symbol.pretty_name ) + " ." +
393+ id2string (m.base_name ) + signature_string;
394+ }
395+
392396 // Load annotations
393397 if (!m.annotations .empty ())
394398 {
@@ -561,22 +565,27 @@ void java_bytecode_convert_methodt::convert(
561565 method_symbol.location =m.source_location ;
562566 method_symbol.location .set_function (method_identifier);
563567
568+ const std::string signature_string = pretty_signature (code_type);
569+
564570 // Set up the pretty name for the method entry in the symbol table.
565571 // The pretty name of a constructor includes the base name of the class
566572 // instead of the internal method name "<init>". For regular methods, it's
567573 // just the base name of the method.
568574 if (is_constructor (method_symbol.base_name ))
569575 {
570- method_symbol.pretty_name = id2string (class_symbol.pretty_name ) + " ." +
571- id2string (class_symbol.base_name ) + " ()" ;
576+ // we use full.class_name(...) as pretty name
577+ // for constructors -- the idea is that they have
578+ // an empty declarator.
579+ method_symbol.pretty_name =
580+ id2string (class_symbol.pretty_name ) + signature_string;
572581 INVARIANT (
573582 code_type.get_is_constructor (),
574583 " Member type should have already been marked as a constructor" );
575584 }
576585 else
577586 {
578587 method_symbol.pretty_name = id2string (class_symbol.pretty_name ) + " ." +
579- id2string (method_symbol .base_name ) + " () " ;
588+ id2string (m .base_name ) + signature_string ;
580589 }
581590
582591 method_symbol.type = code_type;
0 commit comments