Skip to content

add HasAnnotation for JavaSootClass, JavaSootField and JavaSootMethod#1107

Merged
swissiety merged 5 commits intosoot-oss:developfrom
Liyw979:feature/has-annoation
Oct 22, 2024
Merged

add HasAnnotation for JavaSootClass, JavaSootField and JavaSootMethod#1107
swissiety merged 5 commits intosoot-oss:developfrom
Liyw979:feature/has-annoation

Conversation

@Liyw979
Copy link
Copy Markdown
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 .....
}

@codecov
Copy link
Copy Markdown

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
Copy Markdown
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
@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