Skip to content

Commit d752fcf

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 e765de3 commit d752fcf

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
@@ -340,7 +340,6 @@ void java_bytecode_convert_method_lazy(
340340
member_type.set(ID_is_synchronized, true);
341341
if(m.is_static)
342342
member_type.set(ID_is_static, true);
343-
member_type.set_native(m.is_native);
344343
member_type.set_is_varargs(m.is_varargs);
345344

346345
if(m.is_bridge)
@@ -431,7 +430,6 @@ void java_bytecode_convert_methodt::convert(
431430
// to the symbol later.
432431
java_method_typet method_type =
433432
to_java_method_type(symbol_table.lookup_ref(method_identifier).type);
434-
method_type.set_is_final(m.is_final);
435433
method_return_type = method_type.return_type();
436434
java_method_typet::parameterst &parameters = method_type.parameters();
437435

@@ -2212,7 +2210,6 @@ void java_bytecode_convert_methodt::convert_invoke(
22122210
id2string(symbol.base_name) + "()";
22132211
symbol.type = method_type;
22142212
symbol.type.set(ID_access, ID_private);
2215-
to_java_method_type(symbol.type).set_is_final(true);
22162213
symbol.value.make_nil();
22172214
symbol.mode = ID_java;
22182215
assign_parameter_names(

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

-20
Original file line numberDiff line numberDiff line change
@@ -364,26 +364,6 @@ class java_method_typet : public code_typet
364364
add(ID_exceptions_thrown_list).get_sub().push_back(irept(exception));
365365
}
366366

367-
bool get_is_final() const
368-
{
369-
return get_bool(ID_final);
370-
}
371-
372-
void set_is_final(bool is_final)
373-
{
374-
set(ID_final, is_final);
375-
}
376-
377-
bool get_native() const
378-
{
379-
return get_bool(ID_is_native_method);
380-
}
381-
382-
void set_native(bool is_native)
383-
{
384-
set(ID_is_native_method, is_native);
385-
}
386-
387367
bool get_is_varargs() const
388368
{
389369
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)