Skip to content
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

Remove Java's unnecessary languaget::parse peculiarity #8407

Merged
merged 1 commit into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions jbmc/src/janalyzer/janalyzer_parse_options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -380,8 +380,8 @@

log.status() << "Parsing ..." << messaget::eom;

if(static_cast<java_bytecode_languaget *>(language.get())
->parse(ui_message_handler))
std::istringstream unused;

Check warning on line 383 in jbmc/src/janalyzer/janalyzer_parse_options.cpp

View check run for this annotation

Codecov / codecov/patch

jbmc/src/janalyzer/janalyzer_parse_options.cpp#L383

Added line #L383 was not covered by tests
if(language.get()->parse(unused, "", ui_message_handler))
{
log.error() << "PARSING ERROR" << messaget::eom;
return CPROVER_EXIT_PARSE_ERROR;
Expand Down
11 changes: 0 additions & 11 deletions jbmc/src/java_bytecode/java_bytecode_language.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -362,17 +362,6 @@ void java_bytecode_languaget::parse_from_main_class(
}
}

/// We set the main class (i.e.\ class to start the class loading analysis,
/// see \ref java_class_loadert) when we have have been given a main class.
bool java_bytecode_languaget::parse(message_handlert &message_handler)
{
PRECONDITION(language_options.has_value());
initialize_class_loader(message_handler);
main_class = config.java.main_class;
parse_from_main_class(message_handler);
return false;
}

/// We set the main class (i.e.\ class to start the class loading analysis,
/// see \ref java_class_loadert)
/// when we have a JAR file given via the -jar option:
Expand Down
6 changes: 0 additions & 6 deletions jbmc/src/java_bytecode/java_bytecode_language.h
Original file line number Diff line number Diff line change
Expand Up @@ -267,12 +267,6 @@ class java_bytecode_languaget:public languaget
std::ostream &outstream,
message_handlert &message_handler) override;

// This is an extension to languaget
// required because parsing of Java programs can be initiated without
// opening a file first or providing a path to a file
// as dictated by \ref languaget.
virtual bool parse(message_handlert &);

bool parse(
std::istream &instream,
const std::string &path,
Expand Down
3 changes: 2 additions & 1 deletion jbmc/src/java_bytecode/lazy_goto_model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ void lazy_goto_modelt::initialize(

msg.status() << "Parsing ..." << messaget::eom;

if(dynamic_cast<java_bytecode_languaget &>(language).parse(message_handler))
std::istringstream unused;
if(language.parse(unused, "", message_handler))
{
throw invalid_input_exceptiont("PARSING ERROR");
}
Expand Down
4 changes: 2 additions & 2 deletions jbmc/src/jbmc/jbmc_parse_options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -458,8 +458,8 @@

log.status() << "Parsing ..." << messaget::eom;

if(static_cast<java_bytecode_languaget *>(language.get())
->parse(ui_message_handler))
std::istringstream unused;

Check warning on line 461 in jbmc/src/jbmc/jbmc_parse_options.cpp

View check run for this annotation

Codecov / codecov/patch

jbmc/src/jbmc/jbmc_parse_options.cpp#L461

Added line #L461 was not covered by tests
if(language.get()->parse(unused, "", ui_message_handler))
{
log.error() << "PARSING ERROR" << messaget::eom;
return CPROVER_EXIT_PARSE_ERROR;
Expand Down
Loading