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

Fix CallGraphAlgorithm.addClass(..) implementation #783

Merged
merged 3 commits into from
Dec 21, 2023

Conversation

swissiety
Copy link
Collaborator

@swissiety swissiety commented Dec 21, 2023

  • in case of non-existing methods in the CG it threw:
Exception in thread "main" java.lang.NullPointerException: Node for <org.apache.poi.ss.formula.functions.FreeRefFunction: org.apache.poi.ss.formula.eval.ValueEval evaluate(org.apache.poi.ss.formula.eval.ValueEval[],org.apache.poi.ss.formula.OperationEvaluationContext)> has not been added yet
  • don't fail if nothing new was added (or a subtask was already calculated before)
  • return more convenient Signature from JavaSootClass.getType()

@swissiety swissiety requested a review from kadirayk December 21, 2023 13:22
@swissiety swissiety force-pushed the fix/CallGraphAlgo_addClass branch 2 times, most recently from 168668f to 4dfe87f Compare December 21, 2023 14:05
@swissiety swissiety force-pushed the fix/CallGraphAlgo_addClass branch from 4dfe87f to 54191f1 Compare December 21, 2023 14:07
Copy link

codecov bot commented Dec 21, 2023

Codecov Report

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

Comparison is base (129eeb7) 63.78% compared to head (54191f1) 63.78%.

Files Patch % Lines
...a/sootup/callgraph/AbstractCallGraphAlgorithm.java 63.63% 1 Missing and 3 partials ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             develop     #783      +/-   ##
=============================================
- Coverage      63.78%   63.78%   -0.01%     
- Complexity      3385     3386       +1     
=============================================
  Files            315      315              
  Lines          15017    15022       +5     
  Branches        2534     2535       +1     
=============================================
+ Hits            9579     9582       +3     
  Misses          4545     4545              
- Partials         893      895       +2     

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

@kadirayk kadirayk merged commit bc81639 into develop Dec 21, 2023
8 checks passed
updated.addCall(callingMethodSig, overridingMethodSig);
if (updated.containsMethod(overriddenMethodSig)) {
for (MethodSignature callingMethodSig : updated.callsTo(overriddenMethodSig)) {
updated.addCall(callingMethodSig, overridingMethodSig);
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is only true for CHA algorithm or for the RTA (if the given classtype is instantiated)
If we want to actually support this function the abstaractcallgraphalgorithm has to be abstract and this method has to be developed for each algorithm.

additionally if this class was already in the view all edges are already included.
I think the only reason for this method if you want to force the call graph to contain the class, even when the algorithm would say it is not contained, and then we could do it like this (like CHA)

@swissiety swissiety deleted the fix/CallGraphAlgo_addClass branch February 20, 2024 09:22
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.

3 participants