Skip to content

remove java_method_typet::final/native #4492

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

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
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
3 changes: 0 additions & 3 deletions jbmc/src/java_bytecode/java_bytecode_convert_method.cpp
Original file line number Diff line number Diff line change
@@ -326,7 +326,6 @@ void java_bytecode_convert_method_lazy(
member_type.set(ID_is_synchronized, true);
if(m.is_static)
member_type.set(ID_is_static, true);
member_type.set_native(m.is_native);
member_type.set_is_varargs(m.is_varargs);
member_type.set_is_synthetic(m.is_synthetic);

@@ -418,7 +417,6 @@ void java_bytecode_convert_methodt::convert(
// to the symbol later.
java_method_typet method_type =
to_java_method_type(symbol_table.lookup_ref(method_identifier).type);
method_type.set_is_final(m.is_final);
method_return_type = method_type.return_type();
java_method_typet::parameterst &parameters = method_type.parameters();

@@ -2231,7 +2229,6 @@ void java_bytecode_convert_methodt::convert_invoke(
id2string(symbol.base_name) + "()";
symbol.type = method_type;
symbol.type.set(ID_access, ID_private);
to_java_method_type(symbol.type).set_is_final(true);
symbol.value.make_nil();
symbol.mode = ID_java;
assign_parameter_names(
20 changes: 0 additions & 20 deletions jbmc/src/java_bytecode/java_types.h
Original file line number Diff line number Diff line change
@@ -136,26 +136,6 @@ class java_method_typet : public code_typet
add(ID_exceptions_thrown_list).get_sub().push_back(irept(exception));
}

bool get_is_final() const
{
return get_bool(ID_final);
}

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

bool get_native() const
{
return get_bool(ID_is_native_method);
}

void set_native(bool is_native)
{
set(ID_is_native_method, is_native);
}

bool get_is_varargs() const
{
return get_bool(ID_is_varargs_method);
Original file line number Diff line number Diff line change
@@ -89,10 +89,6 @@ SCENARIO(
{
REQUIRE(function_type.get_bool(ID_C_java_method_type));
}
THEN("And the method should be marked as a native method")
{
REQUIRE(to_java_method_type(function_type).get_native());
}
THEN("The method should be marked as declared by its class")
{
REQUIRE(
@@ -104,13 +100,6 @@ SCENARIO(
{
const symbolt function_symbol =
symbol_table.lookup_ref(method_name + ":(I)Z");

const java_method_typet &function_type =
require_type::require_java_method(function_symbol.type);
THEN("The method should not be marked as a native method.")
{
REQUIRE_FALSE(to_java_method_type(function_type).get_native());
}
THEN("The method should be marked as declared by its class")
{
REQUIRE(
@@ -134,12 +123,6 @@ SCENARIO(
{
const symbolt function_symbol =
symbol_table.lookup_ref("java::ClassWithFinalMethod.finalFunc:()I");
const java_method_typet &function_type =
require_type::require_java_method(function_symbol.type);
THEN("The method should be marked as final")
{
REQUIRE(function_type.get_is_final());
}
THEN("The method should be marked as declared by its class")
{
REQUIRE(
@@ -151,12 +134,6 @@ SCENARIO(
{
const symbolt function_symbol =
symbol_table.lookup_ref("java::ClassWithFinalMethod.nonFinalFunc:()I");
const java_method_typet &function_type =
require_type::require_java_method(function_symbol.type);
THEN("The method should not be marked as final")
{
REQUIRE(!function_type.get_is_final());
}
THEN("The method should be marked as declared by its class")
{
REQUIRE(
@@ -168,12 +145,6 @@ SCENARIO(
{
const symbolt function_symbol =
symbol_table.lookup_ref("java::OpaqueClass.staticFunc:()I");
const java_method_typet &function_type =
require_type::require_java_method(function_symbol.type);
THEN("The method should be marked as final")
{
REQUIRE(function_type.get_is_final());
}
THEN("The method should be marked as declared by its class")
{
REQUIRE(