Skip to content

Commit 8254a3f

Browse files
Merge pull request #1312 from peterschrammel/bugfix/java-is-internal
Flag java internal functions as internal in JSON/XML output
2 parents 052c149 + b934a13 commit 8254a3f

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

src/goto-programs/show_goto_functions_json.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,11 @@ json_objectt show_goto_functions_jsont::convert(
4848
json_function["name"]=json_stringt(id2string(function_name));
4949
json_function["isBodyAvailable"]=
5050
jsont::json_boolean(function.body_available());
51-
bool is_internal=(has_prefix(id2string(function_name), CPROVER_PREFIX) ||
52-
function_name==goto_functions.entry_point());
51+
bool is_internal=
52+
has_prefix(id2string(function_name), CPROVER_PREFIX) ||
53+
has_prefix(id2string(function_name), "java::array[") ||
54+
has_prefix(id2string(function_name), "java::org.cprover") ||
55+
has_prefix(id2string(function_name), "java::java");
5356
json_function["isInternal"]=jsont::json_boolean(is_internal);
5457

5558
if(function.body_available())

src/goto-programs/show_goto_functions_xml.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,11 @@ xmlt show_goto_functions_xmlt::convert(
4949
xml_function.set_attribute("name", id2string(function_name));
5050
xml_function.set_attribute_bool(
5151
"is_body_available", function.body_available());
52-
bool is_internal=(has_prefix(id2string(function_name), CPROVER_PREFIX) ||
53-
function_name==goto_functions.entry_point());
52+
bool is_internal=
53+
has_prefix(id2string(function_name), CPROVER_PREFIX) ||
54+
has_prefix(id2string(function_name), "java::array[") ||
55+
has_prefix(id2string(function_name), "java::org.cprover") ||
56+
has_prefix(id2string(function_name), "java::java");
5457
xml_function.set_attribute_bool("is_internal", is_internal);
5558

5659
if(function.body_available())

0 commit comments

Comments
 (0)