-
Notifications
You must be signed in to change notification settings - Fork 274
Cleanups in loading of jar files #4698
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
Cleanups in loading of jar files #4698
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suspect you'll be asked to remove extract-to-file because it's unused
return { buffer.cbegin(), null_char_it }; | ||
const auto id = static_cast<mz_uint>(index); | ||
mz_uint name_size = mz_zip_reader_get_filename(m_state.get(), id, nullptr, 0); | ||
if(name_size == 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Braces round multi-line if
{ | ||
const auto id = static_cast<mz_uint>(index); | ||
mz_zip_archive_file_stat file_stat; | ||
if(mz_zip_reader_file_stat(m_state.get(), id, &file_stat) != MZ_TRUE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
file_stat
is unused
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✔️
Passed Diffblue compatibility checks (cbmc commit: 31cfb2a).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/112922881
31cfb2a
to
754eba5
Compare
@smowton - happy to remove extract-to-file if you'd like - although there are other bits of functionality in JBMC that are only used by derivative projects. We can keep it for ourselves but it seemed like it might be useful to expose it for other potential users. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy with this as-is, just noting a common complaint re: committing untested / unused code :)
@@ -103,3 +103,16 @@ std::string mz_zip_archivet::extract(const size_t index) | |||
} | |||
throw std::runtime_error("Could not extract the file"); | |||
} | |||
|
|||
void mz_zip_archivet::extract_to_file( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That doesn't seem to match the PR title.
const auto id = static_cast<mz_uint>(index); | ||
mz_uint name_size = mz_zip_reader_get_filename(m_state.get(), id, nullptr, 0); | ||
if(name_size == 0) | ||
return {}; // Failure |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@NathanJPhillips clang-format would like to see one space removed.
e76f912
to
ba7b35a
Compare
@NathanJPhillips Please rebase now that #4729 is in to make CI happy. |
ba7b35a
to
6b5dfb1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✔️
Passed Diffblue compatibility checks (cbmc commit: 6b5dfb1).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/113796715
This can be used to extract nested jar files to a temporary folder.
6b5dfb1
to
72936d1
Compare
Codecov Report
@@ Coverage Diff @@
## develop #4698 +/- ##
==========================================
Coverage ? 68.44%
==========================================
Files ? 1255
Lines ? 104099
Branches ? 0
==========================================
Hits ? 71250
Misses ? 32849
Partials ? 0
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✔️
Passed Diffblue compatibility checks (cbmc commit: 72936d1).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/113895476
This includes adding a wrapper for the extract to file functionality to complement the extract to memory wrapper.