Conversation
CatarinaGamboa
left a comment
There was a problem hiding this comment.
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.
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.
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.

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