Skip to content

Commit 5d1d024

Browse files
author
Daniel Kroening
committed
remove java_method_typet::final/native
This removes four methods from java_method_typet. They do not belong there, as neither 'native' nor 'final' are part of the type of the method (they are field modifiers). They are never read.
1 parent 2a1c22b commit 5d1d024

File tree

3 files changed

+0
-52
lines changed

3 files changed

+0
-52
lines changed

Diff for: jbmc/src/java_bytecode/java_bytecode_convert_method.cpp

-3
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,6 @@ void java_bytecode_convert_method_lazy(
336336
member_type.set(ID_is_synchronized, true);
337337
if(m.is_static)
338338
member_type.set(ID_is_static, true);
339-
member_type.set_native(m.is_native);
340339
member_type.set_is_varargs(m.is_varargs);
341340
member_type.set_is_synthetic(m.is_synthetic);
342341

@@ -428,7 +427,6 @@ void java_bytecode_convert_methodt::convert(
428427
// to the symbol later.
429428
java_method_typet method_type =
430429
to_java_method_type(symbol_table.lookup_ref(method_identifier).type);
431-
method_type.set_is_final(m.is_final);
432430
method_return_type = method_type.return_type();
433431
java_method_typet::parameterst &parameters = method_type.parameters();
434432

@@ -2242,7 +2240,6 @@ void java_bytecode_convert_methodt::convert_invoke(
22422240
id2string(symbol.base_name) + "()";
22432241
symbol.type = method_type;
22442242
symbol.type.set(ID_access, ID_private);
2245-
to_java_method_type(symbol.type).set_is_final(true);
22462243
symbol.value.make_nil();
22472244
symbol.mode = ID_java;
22482245
assign_parameter_names(

Diff for: jbmc/src/java_bytecode/java_types.h

-20
Original file line numberDiff line numberDiff line change
@@ -136,26 +136,6 @@ class java_method_typet : public code_typet
136136
add(ID_exceptions_thrown_list).get_sub().push_back(irept(exception));
137137
}
138138

139-
bool get_is_final() const
140-
{
141-
return get_bool(ID_final);
142-
}
143-
144-
void set_is_final(bool is_final)
145-
{
146-
set(ID_final, is_final);
147-
}
148-
149-
bool get_native() const
150-
{
151-
return get_bool(ID_is_native_method);
152-
}
153-
154-
void set_native(bool is_native)
155-
{
156-
set(ID_is_native_method, is_native);
157-
}
158-
159139
bool get_is_varargs() const
160140
{
161141
return get_bool(ID_is_varargs_method);

Diff for: jbmc/unit/java_bytecode/java_bytecode_convert_method/convert_method.cpp

-29
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,6 @@ SCENARIO(
8686
{
8787
REQUIRE(function_type.get_bool(ID_C_java_method_type));
8888
}
89-
THEN("And the method should be marked as a native method")
90-
{
91-
REQUIRE(to_java_method_type(function_type).get_native());
92-
}
9389
THEN("The method should be marked as declared by its class")
9490
{
9591
REQUIRE(
@@ -101,13 +97,6 @@ SCENARIO(
10197
{
10298
const symbolt function_symbol =
10399
symbol_table.lookup_ref(method_name + ":(I)Z");
104-
105-
const java_method_typet &function_type =
106-
require_type::require_java_method(function_symbol.type);
107-
THEN("The method should not be marked as a native method.")
108-
{
109-
REQUIRE_FALSE(to_java_method_type(function_type).get_native());
110-
}
111100
THEN("The method should be marked as declared by its class")
112101
{
113102
REQUIRE(
@@ -131,12 +120,6 @@ SCENARIO(
131120
{
132121
const symbolt function_symbol =
133122
symbol_table.lookup_ref("java::ClassWithFinalMethod.finalFunc:()I");
134-
const java_method_typet &function_type =
135-
require_type::require_java_method(function_symbol.type);
136-
THEN("The method should be marked as final")
137-
{
138-
REQUIRE(function_type.get_is_final());
139-
}
140123
THEN("The method should be marked as declared by its class")
141124
{
142125
REQUIRE(
@@ -148,12 +131,6 @@ SCENARIO(
148131
{
149132
const symbolt function_symbol =
150133
symbol_table.lookup_ref("java::ClassWithFinalMethod.nonFinalFunc:()I");
151-
const java_method_typet &function_type =
152-
require_type::require_java_method(function_symbol.type);
153-
THEN("The method should not be marked as final")
154-
{
155-
REQUIRE(!function_type.get_is_final());
156-
}
157134
THEN("The method should be marked as declared by its class")
158135
{
159136
REQUIRE(
@@ -165,12 +142,6 @@ SCENARIO(
165142
{
166143
const symbolt function_symbol =
167144
symbol_table.lookup_ref("java::OpaqueClass.staticFunc:()I");
168-
const java_method_typet &function_type =
169-
require_type::require_java_method(function_symbol.type);
170-
THEN("The method should be marked as final")
171-
{
172-
REQUIRE(function_type.get_is_final());
173-
}
174145
THEN("The method should be marked as declared by its class")
175146
{
176147
REQUIRE(

0 commit comments

Comments
 (0)