File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -177,12 +177,14 @@ exprt::operandst java_build_arguments(
177
177
bool named_main=has_suffix (config.main , " .main" );
178
178
const typet &string_array_type=
179
179
java_type_from_string (" [Ljava.lang.String;" );
180
+ // checks whether the function is static and has a single String[] parameter
180
181
bool has_correct_type=
181
182
to_code_type (function.type ).return_type ().id ()==ID_empty &&
182
183
(!to_code_type (function.type ).has_this ()) &&
183
184
parameters.size ()==1 &&
184
185
parameters[0 ].type ().full_eq (string_array_type);
185
- is_main=(named_main && has_correct_type);
186
+ bool public_access = function.type .get (ID_access) == ID_public;
187
+ is_main=(named_main && has_correct_type && public_access);
186
188
}
187
189
188
190
// we iterate through all the parameters of the function under test, allocate
You can’t perform that action at this time.
0 commit comments