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

interclass interfaces is empty #128

Closed
f4nx1ng opened this issue Nov 7, 2024 · 2 comments
Closed

interclass interfaces is empty #128

f4nx1ng opened this issue Nov 7, 2024 · 2 comments

Comments

@f4nx1ng
Copy link

f4nx1ng commented Nov 7, 2024

📝 Overall Description

When I was analyzing a file named aspectjweaver-1.9.4.jar, there was a class named org.aaspectj.weaver.tools.comach When I debugged SimpleCache $StoreableCachingMap to see the implementation information of the interface of this class, I found that the content was empty. As shown in the picture below, may I ask if this is a mechanism or an error
image

🎯 Expected Behavior

As shown in the previous image, this class inherits HashMap, so it should also inherit the interface implemented by HashMap. However, I did not find a corresponding item from the variable pool.

🐛 Current Behavior

image

🔄 Reproducible Example

You can see more details in my repo
https://github.com/f4nx1ng/Tai-e/tree/master/mybeanchmark/AspectJWeaver
https://github.com/f4nx1ng/Tai-e/blob/master/src/main/java/pascal/taie/analysis/pta/plugin/TestHandler.java

⚙️ Tai-e Arguments

🔍 Click here to see Tai-e Options
optionsFile: null
printHelp: false
classPath: []
appClassPath:
- mybeanchmark/AspectJWeaver
- mybeanchmark/AspectJWeaver/aspectjweaver-1.9.4.jar
- mybeanchmark/AspectJWeaver/commons-collections-3.2.2.jar
mainClass: AspectJWeaver
inputClasses: []
javaVersion: 8
prependJVM: false
allowPhantom: true
worldBuilderClass: pascal.taie.frontend.soot.SootWorldBuilder
outputDir: output
preBuildIR: true
worldCacheMode: false
scope: ALL
nativeModel: true
planFile: null
analyses:
pta: cs:ci;implicit-entries:false;distinguish-string-constants:null;reflection-inference:solar;taint-config:mybeanchmark/AspectJWeaver/taint-config.yml; #dump-ci:true;
onlyGenPlan: false
keepResult:
- $KEEP-ALL
🔍 Click here to see Tai-e Analysis Plan
- id: pta
options:
  cs: ci
  only-app: false
  implicit-entries: false
  distinguish-string-constants: null
  merge-string-objects: true
  merge-string-builders: true
  merge-exception-objects: true
  handle-invokedynamic: false
  propagate-types:
  - reference
  advanced: null
  dump: false
  dump-ci: false
  dump-yaml: false
  expected-file: null
  reflection-inference: solar
  reflection-log: null
  taint-config: mybeanchmark/AspectJWeaver/taint-config.yml
  taint-config-providers: []
  taint-interactive-mode: false
  plugins: []
  time-limit: -1

📜 Tai-e Log

🔍 Click here to see Tai-e Log
{{The content of 'output/tai-e.log' file}}

ℹ️ Additional Information

No response

@jjppp
Copy link
Member

jjppp commented Nov 7, 2024

The getInterfaces() method of JClass simply returns the direct superinterfaces of a class.
Algorithms related to class hierarchy are located in ClassHierarchy, but currently Tai-e does not have an implementation of such an algorithm to obtain all the superinterfaces (both direct and indirect) of a given class.

A quick (but inefficent) solution to your goals may be something like this:

private static Collection<JClass> obtainAllSuperInterfaces(JClass cls) {
    ClassHierarchy hierarchy = World.get().getClassHierarchy();
    return hierarchy.allClasses()
            .filter(JClass::isInterface)
            .filter(superInterface -> hierarchy.isSubclass(superInterface, cls))
            .toList();
}

For more detailed on ClassHierarchy, please refer to ClassHierarchyTest.

@f4nx1ng
Copy link
Author

f4nx1ng commented Nov 8, 2024

Thank you very much for your reply

@f4nx1ng f4nx1ng closed this as completed Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants