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

Replace static util class with JarDetails #24

Merged

Conversation

tylerbenson
Copy link

This class is able to be more optimized by using random access file classes depending on if the jar is embedded within another archive file (eg spring boot, war, ear, etc).

* For a given URL representing a Jar directly on the file system or embedded within another
* archive, this class provides methods which expose useful information about it.
*/
class JarDetails {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find the arrangement of all this code into a class with inheritance and where the various extraction bits are distributed across construction and accessors to be harder to reason about than the JarAnalyzerUtil approach, where each extraction task is implemented as a pure function without side affects.

Is there any way to have the best of both worlds? Simple code arrangement and good performance?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some of the things could be extracted to a static method, but many of the significant optimizations were unlocked in the overloaded methods. Do you have anything specific in mind?

This class is able to be more optimized by using random access file classes depending on if the jar is embedded within another archive file (eg spring boot, war, ear, etc).
@jack-berg jack-berg merged commit ceaea0e into jack-berg:emit-package-events Sep 28, 2023
@tylerbenson tylerbenson deleted the emit-package-events branch September 28, 2023 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants