Skip to content

Conversation

@Pichers
Copy link
Collaborator

@Pichers Pichers commented Apr 23, 2025

Description

Added the analysed element's source position to the log, both for known and unknown file positions

Example

|- [ Latte Type checker initialized ]
|- Visiting class: MyStackTest (MyStackTest.java:4)
|- Visiting constructor (unknown file)
|- Visiting invocation <super()> (unknown file)
|- Visiting method

(MyStackTest.java:6)
|- Visiting parameter (MyStackTest.java:6)
|- args: ­Ø£ê2
|- ­Ø£ê2: SHARED

Related Issue

#4

Type of change

  • Bug fix
  • New feature
  • Documentation update
  • Code refactoring

@Pichers Pichers requested a review from CatarinaGamboa April 24, 2025 12:51
Copy link
Collaborator

@CatarinaGamboa CatarinaGamboa left a 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());
Copy link
Collaborator

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?

Copy link
Collaborator

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.

Copy link
Contributor

@kiranraoboinapally kiranraoboinapally Apr 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unknowns not appearing but,why I don't know its showing only MediaRecord.java
Screenshot (69)

@CatarinaGamboa CatarinaGamboa self-requested a review April 30, 2025 09:57
Copy link
Collaborator

@CatarinaGamboa CatarinaGamboa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

@Pichers Pichers merged commit bb89aec into main Apr 30, 2025
1 check passed
@Pichers Pichers deleted the elementPosInLog branch May 21, 2025 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants