-
Notifications
You must be signed in to change notification settings - Fork 0
Element position in LogInfo #16
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
Conversation
CatarinaGamboa
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to keep the unknowns? can we be more specific? or maybe just not include them in the log since they do not provide much information.
Please rebase and run the tests
| */ | ||
| protected void logInfo(String text, CtElement ce) { | ||
| if(ce.getPosition().getFile() == null) | ||
| logger.info(" ".repeat(4*loggingSpaces) + "|- " + text + " " + ce.getPosition()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use ce.getPosition().isValidPosition() so we don't have unknowns? Do you know why the unknowns appear? Some of them are probably class files, but are there other reasons for the unknowns?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those AST nodes could also have been created by a previous processor (not the case of latte).
I do not see other reason than it being reflected from bytecode. Even then, there should be a Synthesized or Reversed source location object. Maybe that can be discussed in the Spoon repo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CatarinaGamboa
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm

Description
Added the analysed element's source position to the log, both for known and unknown file positions
Example
|- [ Latte Type checker initialized ]
(MyStackTest.java:6)|- Visiting class: MyStackTest (MyStackTest.java:4)
|- Visiting constructor (unknown file)
|- Visiting invocation <super()> (unknown file)
|- Visiting method
|- Visiting parameter (MyStackTest.java:6)
|- args: Ø£ê2
|- Ø£ê2: SHARED
Related Issue
#4
Type of change