-
-
Notifications
You must be signed in to change notification settings - Fork 352
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
[Bug]: Unable to parse CtElement
from a JDK-runtime-element by CtPath
#4984
Comments
JDK classes are generated on the fly as needed by reflection. |
Thanks for replying. I am trying to analysis invocations in executables and describe them in a graph database, I choose Of course I can code a function that transform from A JDK How do you think about it? |
Besides, I noticed that |
After some additional consideration, I concluded that the user would benefit from this. The implementation of CtPath is way before I worked on spoon, and I never used it. So, I cannot really tell how much work it is to implement this feature.
To my understanding the empty list simply uses the root element for the search so yes this could be reused for CtPath lookups for jdk elements. Do you want to give the implementation of the feature a try? |
Describe the bug
Ideally, there's a one-to-one relationship between a
CtElement
and a specific completeCtPath
.It works well with user-defined classes, but not with a JDK-runtime element.
For example, I can't get
CtType
forjava.lang.System
from itsCtPath
:#subPackage[name=java]#subPackage[name=lang]#containedType[name=System]
Source code you are trying to analyze/transform
Source code for your Spoon processing
Actual output
Expected output
Spoon Version
10.2.0-beta-21
JVM Version
11
What operating system are you using?
Windows 11
The text was updated successfully, but these errors were encountered: