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

add HasAnnotation for JavaSootClass, JavaSootField and JavaSootMethod #1107

Merged
merged 5 commits into from
Oct 22, 2024

Conversation

Liyw979
Copy link
Contributor

@Liyw979 Liyw979 commented Oct 13, 2024

like sootup.core.model.HasPosition

In the follwing case, I want to get urls from class(/fruit) and method (/lychee) and get the full url.

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/fruits")
public class LycheeController {

    @GetMapping("/lychee")
    public String getLychee() {
        return "Here is a fresh lychee!";
    }
}

by adding the HasPosition interface, users could write functions like

String getUrl(has: HasAnnotation) { // "has" could be JavaSootClass or JavaSootMethod
    has.getAnnotations .....
}

Copy link

codecov bot commented Oct 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 72.26%. Comparing base (ba277d8) to head (df89fa8).
Report is 100 commits behind head on develop.

Additional details and impacted files
@@              Coverage Diff               @@
##             develop    #1107       +/-   ##
==============================================
+ Coverage      39.69%   72.26%   +32.57%     
- Complexity      4446     4975      +529     
==============================================
  Files            657      439      -218     
  Lines          29522    18671    -10851     
  Branches        4803     3091     -1712     
==============================================
+ Hits           11719    13493     +1774     
+ Misses         16894     4096    -12798     
- Partials         909     1082      +173     

☔ 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.

thx!

@swissiety swissiety merged commit 57a57a5 into soot-oss:develop Oct 22, 2024
7 checks passed
@Liyw979 Liyw979 deleted the feature/has-annoation branch October 22, 2024 12:54
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