Skip to content

generate toString() in mooseEntities #22

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

Open
NicolasAnquetil opened this issue Dec 11, 2020 · 4 comments
Open

generate toString() in mooseEntities #22

NicolasAnquetil opened this issue Dec 11, 2020 · 4 comments

Comments

@NicolasAnquetil
Copy link
Contributor

it really helps in Eclipse debugger as clicking on the entity would give its name.
For example for method I manually created:

@Override
public String toString() {
  return ((parentType != null) ? ((NamedEntity)parentType).getName() + "." : "") + name;
}

So the debugger can tell me PrintStream.println instead of org.moosetechnology.model.famixjava.famixjavaentities.Class@15f77a8b

@badetitou
Copy link
Member

If we want to generate the toString, maybe this issue should be moved to FameJava (that is is charge of generating the code)

@badetitou
Copy link
Member

The only question is, how can you define toString if there is no "name" ?

( The logic of parents entity can be used )!

@NicolasAnquetil
Copy link
Contributor Author

1st solution: Don't

But it is not that easy anyway, because Fame does not know about "name"
So it will have to be some kind of hack ...

@badetitou
Copy link
Member

Maybe add a toString method to every metadescription that use the FamixTNamed trait ( should be easy to know by using the new game meta meta model with trait concept )

Still it is a hack. But if it offers great value, why not?

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

No branches or pull requests

2 participants