[Bug]: Inconsistent parent for CtTypeReferenceImpl
in CtRecordComponentImpl
which points to a CtMethodImpl
#5868
Labels
CtTypeReferenceImpl
in CtRecordComponentImpl
which points to a CtMethodImpl
#5868
Describe the bug
When visiting all elements (keeping track of the parents) in the model, one encounters an element (I guess it is the Type of the Record Field) where its parent doesn't match the one that was kept track of.
It scans the elements like this:
and for some reason the
CtTypeReferenceImpl#getParent
does not point toCtRecordComponentImpl
, but to aCtMethodImpl
.For some reason the
CtMethodImpl
has the same reference to the type as theCtRecordComponentImpl
, butCtFieldImpl
has a distinct one:This is likely the result of a missing clone somewhere in the code?
My guess is that it is this line in the
CtRecordComponentImpl
:Source code you are trying to analyze/transform
Source code for your Spoon processing
Actual output
Expected output
Spoon Version
11.0.0
JVM Version
openjdk version "21.0.2" 2024-01-16 LTS OpenJDK Runtime Environment Zulu21.32+17-CA (build 21.0.2+13-LTS) OpenJDK 64-Bit Server VM Zulu21.32+17-CA (build 21.0.2+13-LTS, mixed mode, sharing)
What operating system are you using?
Windows 11
The text was updated successfully, but these errors were encountered: