@@ -518,25 +518,12 @@ void java_bytecode_convert_methodt::convert(
518
518
param_index==slots_for_parameters,
519
519
" java_parameter_count and local computation must agree" );
520
520
521
- const bool is_virtual=!m.is_static && !m.is_final ;
522
-
523
- // Construct a methodt, which lives within the class type; this object is
524
- // never used for anything useful and could be removed
525
- class_typet::methodt method;
526
- method.set_base_name (m.base_name );
527
- method.set_name (method_identifier);
528
- method.set (ID_abstract, m.is_abstract );
529
- method.set (ID_is_virtual, is_virtual);
530
- method.type ()=member_type;
531
- if (is_constructor (method))
532
- method.set (ID_constructor, true );
533
-
534
521
// Check the fields that can't change are valid
535
522
INVARIANT (
536
- method_symbol.name ==method. get_name () ,
523
+ method_symbol.name ==method_identifier ,
537
524
" Name of method symbol shouldn't change" );
538
525
INVARIANT (
539
- method_symbol.base_name ==method. get_base_name () ,
526
+ method_symbol.base_name ==m. base_name ,
540
527
" Base name of method symbol shouldn't change" );
541
528
INVARIANT (
542
529
method_symbol.module .empty (),
@@ -550,16 +537,21 @@ void java_bytecode_convert_methodt::convert(
550
537
// The pretty name of a constructor includes the base name of the class
551
538
// instead of the internal method name "<init>". For regular methods, it's
552
539
// just the base name of the method.
553
- if (method.get_base_name ()==" <init>" )
554
- method_symbol.pretty_name =id2string (class_symbol.pretty_name )+" ." +
555
- id2string (class_symbol.base_name )+" ()" ;
540
+ if (method_symbol.base_name ==" <init>" )
541
+ {
542
+ method_symbol.pretty_name = id2string (class_symbol.pretty_name ) + " ." +
543
+ id2string (class_symbol.base_name ) + " ()" ;
544
+ INVARIANT (
545
+ member_type.get_bool (ID_constructor),
546
+ " Member type should have already been marked as a constructor" );
547
+ }
556
548
else
557
- method_symbol.pretty_name =id2string (class_symbol.pretty_name )+" ." +
558
- id2string (method.get_base_name ())+" ()" ;
549
+ {
550
+ method_symbol.pretty_name = id2string (class_symbol.pretty_name ) + " ." +
551
+ id2string (m.base_name ) + " ()" ;
552
+ }
559
553
560
554
method_symbol.type =member_type;
561
- if (is_constructor (method))
562
- method_symbol.type .set (ID_constructor, true );
563
555
564
556
current_method=method_symbol.name ;
565
557
method_has_this=code_type.has_this ();
0 commit comments