Skip to content

Commit b673ebb

Browse files
committed
Add storage of final modifier status of java classes in java_class_typet.
1 parent d069719 commit b673ebb

6 files changed

+15
-0
lines changed

src/java_bytecode/java_bytecode_convert_class.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,7 @@ void java_bytecode_convert_classt::convert(
265265
class_type.set_tag(c.name);
266266
class_type.set(ID_base_name, c.name);
267267
class_type.set(ID_abstract, c.is_abstract);
268+
class_type.set_final(c.is_final);
268269
if(c.is_enum)
269270
{
270271
if(max_array_length != 0 && c.enum_elements > max_array_length)

src/java_bytecode/java_bytecode_parse_tree.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ void java_bytecode_parse_treet::classt::swap(
2929
std::swap(other.is_public, is_public);
3030
std::swap(other.is_protected, is_protected);
3131
std::swap(other.is_private, is_private);
32+
std::swap(other.is_final, is_final);
3233
std::swap(other.signature, signature);
3334
other.implements.swap(implements);
3435
other.fields.swap(fields);

src/java_bytecode/java_bytecode_parse_tree.h

+1
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ class java_bytecode_parse_treet
182182
bool is_abstract=false;
183183
bool is_enum=false;
184184
bool is_public=false, is_protected=false, is_private=false;
185+
bool is_final = false;
185186
bool attribute_bootstrapmethods_read = false;
186187
size_t enum_elements=0;
187188

src/java_bytecode/java_bytecode_parser.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,7 @@ void java_bytecode_parsert::rClassFile()
495495
parsed_class.is_public=(access_flags&ACC_PUBLIC)!=0;
496496
parsed_class.is_protected=(access_flags&ACC_PROTECTED)!=0;
497497
parsed_class.is_private=(access_flags&ACC_PRIVATE)!=0;
498+
parsed_class.is_final = (access_flags & ACC_FINAL) != 0;
498499
parsed_class.name=
499500
constant(this_class).type().get(ID_C_base_name);
500501

src/java_bytecode/java_types.h

+10
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,16 @@ class java_class_typet:public class_typet
111111
return set(ID_access, access);
112112
}
113113

114+
bool get_final()
115+
{
116+
return get_bool(ID_final);
117+
}
118+
119+
void set_final(bool is_final)
120+
{
121+
set(ID_final, is_final);
122+
}
123+
114124
typedef std::vector<symbol_exprt> java_lambda_method_handlest;
115125

116126
const java_lambda_method_handlest &lambda_method_handles() const

src/util/irep_ids.def

+1
Original file line numberDiff line numberDiff line change
@@ -667,6 +667,7 @@ IREP_ID_TWO(C_no_initialization_required, #no_initialization_required)
667667
IREP_ID_TWO(overlay_class, java::com.diffblue.OverlayClassImplementation)
668668
IREP_ID_TWO(overlay_method, java::com.diffblue.OverlayMethodImplementation)
669669
IREP_ID_TWO(C_annotations, #annotations)
670+
IREP_ID_ONE(final)
670671

671672
// Projects depending on this code base that wish to extend the list of
672673
// available ids should provide a file local_irep_ids.h in their source tree and

0 commit comments

Comments
 (0)