@@ -354,6 +354,7 @@ void java_bytecode_convert_method_lazy(
354
354
method_symbol.mode =ID_java;
355
355
method_symbol.location =m.source_location ;
356
356
method_symbol.location .set_function (method_identifier);
357
+
357
358
if (m.is_public )
358
359
member_type.set_access (ID_public);
359
360
else if (m.is_protected )
@@ -363,18 +364,6 @@ void java_bytecode_convert_method_lazy(
363
364
else
364
365
member_type.set_access (ID_default);
365
366
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
-
378
367
// do we need to add 'this' as a parameter?
379
368
if (!m.is_static )
380
369
{
@@ -387,6 +376,24 @@ void java_bytecode_convert_method_lazy(
387
376
parameters.insert (parameters.begin (), this_p);
388
377
}
389
378
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
+
390
397
// Load annotations
391
398
if (!m.annotations .empty ())
392
399
{
@@ -559,22 +566,27 @@ void java_bytecode_convert_methodt::convert(
559
566
method_symbol.location =m.source_location ;
560
567
method_symbol.location .set_function (method_identifier);
561
568
569
+ const std::string signature_string = pretty_signature (code_type);
570
+
562
571
// Set up the pretty name for the method entry in the symbol table.
563
572
// The pretty name of a constructor includes the base name of the class
564
573
// instead of the internal method name "<init>". For regular methods, it's
565
574
// just the base name of the method.
566
575
if (is_constructor (method_symbol.base_name ))
567
576
{
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;
570
582
INVARIANT (
571
583
code_type.get_is_constructor (),
572
584
" Member type should have already been marked as a constructor" );
573
585
}
574
586
else
575
587
{
576
588
method_symbol.pretty_name = id2string (class_symbol.pretty_name ) + " ." +
577
- id2string (method_symbol .base_name ) + " () " ;
589
+ id2string (m .base_name ) + signature_string ;
578
590
}
579
591
580
592
method_symbol.type = code_type;
0 commit comments