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

not throw exceptions when class of annotation not found #726

Merged
merged 7 commits into from
Nov 20, 2023

Conversation

Liyw979
Copy link
Contributor

@Liyw979 Liyw979 commented Oct 27, 2023

When analysing single jar package, Sootup throws exceptions when some class of the annotation is missing.
In this PR:

  1. Remove prefetch in getAnnotations since getDefaultValues is called in resolveDefaultsForAnnotationType.
  2. Return empty map when the corresponding class is not found.
  3. Allow users to do getAnnotations without the default values.

@codecov
Copy link

codecov bot commented Oct 27, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (647da14) 63.95% compared to head (21a0928) 63.68%.
Report is 122 commits behind head on develop.

Additional details and impacted files
@@              Coverage Diff              @@
##             develop     #726      +/-   ##
=============================================
- Coverage      63.95%   63.68%   -0.28%     
+ Complexity      3424     3342      -82     
=============================================
  Files            317      317              
  Lines          15391    15071     -320     
  Branches        2609     2542      -67     
=============================================
- Hits            9844     9598     -246     
+ Misses          4639     4588      -51     
+ Partials         908      885      -23     

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

@Liyw979 Liyw979 marked this pull request as draft October 30, 2023 14:18
@Liyw979 Liyw979 marked this pull request as ready for review November 15, 2023 14:19
@Liyw979 Liyw979 changed the title partial analysis for annotation not throw exceptions when class of annotation not found Nov 15, 2023
Copy link
Collaborator

@JonasKlauke JonasKlauke left a comment

Choose a reason for hiding this comment

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

Thanks for the small fix. Could you add a warning showing the missing annotation. So User will know that SootUp might need more data.

Copy link
Collaborator

@JonasKlauke JonasKlauke left a comment

Choose a reason for hiding this comment

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

Thanks 👍

@JonasKlauke JonasKlauke merged commit 0d2d469 into soot-oss:develop Nov 20, 2023
8 checks passed
@Liyw979 Liyw979 deleted the allow-partial-annotation branch February 28, 2024 16:29
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