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

Handle case where two paths resolve to the same class #696

Closed
Col-E opened this issue Nov 23, 2021 · 2 comments
Closed

Handle case where two paths resolve to the same class #696

Col-E opened this issue Nov 23, 2021 · 2 comments
Labels
enhancement ux User interface/experience specific

Comments

@Col-E
Copy link
Owner

Col-E commented Nov 23, 2021

This can occur in jars that have version-specific implementations.

Consider multi-release jars:

src/
    main/
        java/
            com/
                baeldung/
                    multireleaseapp/
                        App.java
                        DateHelper.java
        java9/
            com/
                baeldung/
                    multireleaseapp/
                        DateHelper.java

Both DateHelper classes will need to be available to the user. The problem is the current workspace setup is based on a 1-to-1 relation of .class files to actual resource classes. So depending on the ZIP entry iteration order, only one will be chosen.

Some ideas for addressing this:

  • Attach a Collection<ClassInfo> to resource class entries, which also get updated when the base is updated.

  • On load detect duplicates and let users choose which they want to keep

    • Will break multi-release jars
  • Rework the resource entries so instead of ItemInfo it will have ItemFamily

Things to consider about any one fix:

  • How much refactoring will it require?
  • How much of a pain in the ass will it be to use the "fix" as the new standard going forward?
  • Does it make it easy for the user to undeerstand what happened, and how to get to the data they want?
  • How does this work for intended Java usage, such as multi-release jars?
  • How does this work for obfuscated usage, such as intentional zip file shenanigans and tricky JVM ZIP edge case handling?
@Col-E
Copy link
Owner Author

Col-E commented Aug 30, 2023

Addressed by 4x's new workspace model.

@Col-E Col-E closed this as completed Aug 30, 2023
@Col-E Col-E transferred this issue from Col-E/recaf-3x-issues Aug 30, 2023
@Col-E
Copy link
Owner Author

Col-E commented Aug 30, 2023

How much refactoring will it require?

The answer is: "An entire rewrite"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ux User interface/experience specific
Projects
None yet
Development

No branches or pull requests

1 participant