Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add storage of final modifier status of java classes in java_class_typet. #2011

Merged
merged 1 commit into from
May 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/java_bytecode/java_bytecode_convert_class.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ void java_bytecode_convert_classt::convert(
class_type.set_tag(c.name);
class_type.set(ID_base_name, c.name);
class_type.set(ID_abstract, c.is_abstract);
class_type.set_final(c.is_final);
if(c.is_enum)
{
if(max_array_length != 0 && c.enum_elements > max_array_length)
Expand Down
1 change: 1 addition & 0 deletions src/java_bytecode/java_bytecode_parse_tree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ void java_bytecode_parse_treet::classt::swap(
std::swap(other.is_public, is_public);
std::swap(other.is_protected, is_protected);
std::swap(other.is_private, is_private);
std::swap(other.is_final, is_final);
std::swap(other.signature, signature);
other.implements.swap(implements);
other.fields.swap(fields);
Expand Down
1 change: 1 addition & 0 deletions src/java_bytecode/java_bytecode_parse_tree.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ class java_bytecode_parse_treet
bool is_abstract=false;
bool is_enum=false;
bool is_public=false, is_protected=false, is_private=false;
bool is_final = false;
bool attribute_bootstrapmethods_read = false;
size_t enum_elements=0;

Expand Down
1 change: 1 addition & 0 deletions src/java_bytecode/java_bytecode_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,7 @@ void java_bytecode_parsert::rClassFile()
parsed_class.is_public=(access_flags&ACC_PUBLIC)!=0;
parsed_class.is_protected=(access_flags&ACC_PROTECTED)!=0;
parsed_class.is_private=(access_flags&ACC_PRIVATE)!=0;
parsed_class.is_final = (access_flags & ACC_FINAL) != 0;
parsed_class.name=
constant(this_class).type().get(ID_C_base_name);

Expand Down
10 changes: 10 additions & 0 deletions src/java_bytecode/java_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,16 @@ class java_class_typet:public class_typet
return set(ID_access, access);
}

bool get_final()
{
return get_bool(ID_final);
}

void set_final(bool is_final)
{
set(ID_final, is_final);
}

typedef std::vector<symbol_exprt> java_lambda_method_handlest;

const java_lambda_method_handlest &lambda_method_handles() const
Expand Down
1 change: 1 addition & 0 deletions src/util/irep_ids.def
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,7 @@ IREP_ID_TWO(C_no_initialization_required, #no_initialization_required)
IREP_ID_TWO(overlay_class, java::com.diffblue.OverlayClassImplementation)
IREP_ID_TWO(overlay_method, java::com.diffblue.OverlayMethodImplementation)
IREP_ID_TWO(C_annotations, #annotations)
IREP_ID_ONE(final)

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