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

HasPosition Interface #818

Merged

Conversation

DavidBakerEffendi
Copy link
Contributor

In the old Soot, there is a soot.tagkit.Host interface which defined methods such as getJavaSourceStartLineNumber. Many core classes representing code objects implemented this and allowed libraries implementing Soot to easily define a single method to retrieve position information from various classes.

Such an interface is not present in SootUp, and so this PR presents the sootup.core.model.HasPosition interface to define what many classes already have as getPosition. All classes that already define getPosition now implement HasPosition as a part of this change.

In the old Soot, there is a `soot.tagkit.Host` interface which defined methods such as `getJavaSourceStartLineNumber`. Many core classes representing code objects implemented this and allowed libraries implementing Soot to easily define a single method to retrieve position information from various classes.

Such an interface is not present in SootUp, and so this PR presents the `sootup.core.model.HasPosition` interface to define what many classes already have as `getPosition`. All classes that already define `getPosition` now implement `HasPosition` as a part of this change.
@swissiety
Copy link
Collaborator

sounds reasonable - e.g. for IDE (read: editor) / UI / LSP tooling this would make sense

@DavidBakerEffendi
Copy link
Contributor Author

@swissiety This is largely motivated by Soot's use in Joern. I'm slowly moving over to SootUp: joernio/joern#4054

Copy link

codecov bot commented Jan 15, 2024

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (def460e) 0.00% compared to head (010e272) 63.60%.

Files Patch % Lines
...ore/src/main/java/sootup/core/model/SootField.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff               @@
##             develop     #818       +/-   ##
==============================================
+ Coverage           0   63.60%   +63.60%     
- Complexity         0     3428     +3428     
==============================================
  Files              0      313      +313     
  Lines              0    15146    +15146     
  Branches           0     2565     +2565     
==============================================
+ Hits               0     9633     +9633     
- Misses             0     4607     +4607     
- Partials           0      906      +906     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@swissiety swissiety left a comment

Choose a reason for hiding this comment

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

👍

@swissiety swissiety merged commit cee067b into soot-oss:develop Jan 15, 2024
9 checks passed
@DavidBakerEffendi DavidBakerEffendi deleted the feature/has-position-interface branch January 15, 2024 17:18
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