The issue is with how object references are currently logged, meaning StringReference, ArrayReference, and ClassReference
For example, for an array reference, the current JSON structure looks like this:
"reference": {
"type": "java.lang.String[]",
"uniqueId": 72,
"refered": {
"elements": []
}
}
- reference being an object reference
- refered can be :
- the fields of a class reference
- elements of an array reference
- value of the String reference
This design makes it hard to quickly understand what kind of object we’re dealing with.
Proposal 1: Flatten the structure
Instead of having a generic "reference" object with a "refered" field, we can directly log the specific type of reference.
Example for an array:
"ArrayReference":{
"type": "java.lang.String[]",
"uniqueId": 72,
"elements": []
}
This way, there’s no extra “wrapper” for all ObjectReference types.
Proposal 2: Keep a wrapper but be explicit
If we still want a generic ObjectReference container, we can make the type explicit inside it:
"ObjectReference":{
"type": "java.lang.String[]",
"uniqueId": 72,
"ArrayReference":{
"elements": []
}
}
This option could be helpfull for the importer for FamixCallStack, but is less space efficient for the outputted file
The issue is with how object references are currently logged, meaning StringReference, ArrayReference, and ClassReference
For example, for an array reference, the current JSON structure looks like this:
This design makes it hard to quickly understand what kind of object we’re dealing with.
Proposal 1: Flatten the structure
Instead of having a generic "reference" object with a "refered" field, we can directly log the specific type of reference.
Example for an array:
This way, there’s no extra “wrapper” for all ObjectReference types.
Proposal 2: Keep a wrapper but be explicit
If we still want a generic ObjectReference container, we can make the type explicit inside it:
This option could be helpfull for the importer for FamixCallStack, but is less space efficient for the outputted file