Skip to content
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

feature: CtPackageReference should have a getQualifiedName in addition to getSimpleName #1330

Closed
surli opened this issue May 29, 2017 · 6 comments
Labels

Comments

@surli
Copy link
Collaborator

surli commented May 29, 2017

No description provided.

@monperrus monperrus changed the title Refactor: CtPackageReference should have a getQualifiedName in addition to getSimpleName feature: CtPackageReference should have a getQualifiedName in addition to getSimpleName May 29, 2017
@surli
Copy link
Collaborator Author

surli commented Oct 25, 2017

Looking on this feature request: shouldn't we put getQualifiedName directly in CtReference ?

@surli
Copy link
Collaborator Author

surli commented Oct 25, 2017

I answer myself: it's a bad idea. We got a lot of different references for which it makes no sense to have a FQN.

@monperrus
Copy link
Collaborator

monperrus commented Oct 25, 2017 via email

@surli
Copy link
Collaborator Author

surli commented Oct 26, 2017

In fact CtPackageReference already reference the FQN of package in its simpleName, see:

return createReference(pack.getQualifiedName());

So, should we align its behaviour on the class behaviour: simpleName with only the last package simple name, and a FQN computed from it.
Or it does not make any sense to use simpleName in CtPackageReference, and we should only document the fact the FQN is always returned and close this issue?

@monperrus
Copy link
Collaborator

monperrus commented Oct 26, 2017 via email

@surli
Copy link
Collaborator Author

surli commented Oct 26, 2017

If this line is always used

Yes, a PackageReference is always created using a FQN name, either from the CtPackage FQN or from a reflect Package FQN.

  1. we document 2) we still add the new method for improving the API, that would simply delegate to getSimpleName

I'll change the PR and test in that way then.

surli added a commit to surli/spoon that referenced this issue Oct 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants