@@ -2189,18 +2189,13 @@ void java_bytecode_convert_methodt::convert_invoke(
2189
2189
// inherit a definition from a super-class, we create a new symbol and
2190
2190
// insert it in the symbol table. The name and type of the method are
2191
2191
// derived from the information we have in the call.
2192
- // We fix the access attribute to ID_public , because of the following
2192
+ // We fix the access attribute to ID_private , because of the following
2193
2193
// reasons:
2194
- // - We don't know the orignal access attribute and since the .class file
2194
+ // - We don't know the original access attribute and since the .class file is
2195
2195
// unavailable, we have no way to know.
2196
- // - Whatever it was, we assume that the bytecode we are translating
2197
- // compiles correctly, so such a method has to be accessible from this
2198
- // method.
2199
- // - We will never generate code that calls that method unless we
2200
- // translate bytecode that calls that method. As a result we will never
2201
- // generate code that may wrongly assume that such a method is
2202
- // accessible if we assume that its access attribute is "more
2203
- // accessible" than it actually is.
2196
+ // - The translated method could be an inherited protected method, hence
2197
+ // accessible from the original caller, but not from the generated test.
2198
+ // Therefore we must assume that the method is not accessible.
2204
2199
irep_idt id = arg0.get (ID_identifier);
2205
2200
if (
2206
2201
symbol_table.symbols .find (id) == symbol_table.symbols .end () &&
@@ -2213,7 +2208,7 @@ void java_bytecode_convert_methodt::convert_invoke(
2213
2208
symbol.pretty_name = id2string (arg0.get (ID_C_class)).substr (6 ) + " ." +
2214
2209
id2string (symbol.base_name ) + " ()" ;
2215
2210
symbol.type = arg0.type ();
2216
- symbol.type .set (ID_access, ID_public );
2211
+ symbol.type .set (ID_access, ID_private );
2217
2212
symbol.value .make_nil ();
2218
2213
symbol.mode = ID_java;
2219
2214
assign_parameter_names (
0 commit comments