Skip to content

Comments

feat: new CtTypeMemberWildcardImportReference for import package.Type.*#2731

Merged
monperrus merged 2 commits intoINRIA:masterfrom
pvojtechovsky:fixWildSTMR
Nov 5, 2018
Merged

feat: new CtTypeMemberWildcardImportReference for import package.Type.*#2731
monperrus merged 2 commits intoINRIA:masterfrom
pvojtechovsky:fixWildSTMR

Conversation

@pvojtechovsky
Copy link
Collaborator

Fixes implementation of CtWildcardStaticTypeMemberReferenceImpl to be a real spoon model element.

I also change the semantic of this element. Before it was kind of a CtTypeReference. Now it is only CtReference, because it references all static type members of the referred type.

It also have a new method (main reason why I needed it): getTypeReference(), which returns type reference to the type whose static type members are included.

@pvojtechovsky pvojtechovsky changed the title WIP fix: model of CtWildcardStaticTypeMemberReference fix: model of CtWildcardStaticTypeMemberReference Oct 31, 2018
@monperrus
Copy link
Collaborator

I like this idea, but maybe not the name:

what do you think of CtWildcardTypeMemberImport or CtTypeMemberWildcardImport?
(will we have CtPackageWildcardImport in the future?)

WDYT?

@pvojtechovsky
Copy link
Collaborator Author

name

All suggesttions ends with *Import, but it is not an import, it is really a kind of reference to all static type members. Note that we have CtImport#setReference method, which accepts reference ... (CtWildcardStaticTypeMemberReference) as an argument.

I would prefer to have a name which ends with Reference.

And note that name is already invented and committed by Simon. So any change causes little incompatibility, because we should change also CoreFactory#createWildcardStaticTypeMemberReference ...

@monperrus
Copy link
Collaborator

it is really a kind of reference to all static type members

not really. The definition of a reference is something for which you can get a declaration (getDeclaration). There is no meaningful declaration in this case.

And note that name is already invented and committed by Simon

That was the implementation class (which can stay as is, and, you're right, I'm less rigorous for naming of implementation classes than for naming of public interfaces), it's perfectly OK to improve the name for the promoted interface.

what about CtTypeMemberWildcardImportReference?

@spoon-bot
Copy link
Collaborator

API changes: 5 (Detected by Revapi)

Old API: fr.inria.gforge.spoon:spoon-core:jar:7.2.0-20181101.234717-66 / New API: fr.inria.gforge.spoon:spoon-core:jar:7.2.0-SNAPSHOT

Method was added to an interface.
Old none
New method CoreFactory#createTypeMemberWildcardImportReference()
Breaking binary: non_breaking,
Method was added to an interface.
Old none
New method Factory#createTypeMemberWildcardImportReference(CtTypeReference)
Breaking binary: non_breaking,
Method was removed.
Old method CoreFactory#createWildcardStaticTypeMemberReference()
New none
Breaking binary: breaking,
Method was removed.
Old method Factory#createWildcardStaticTypeMemberReference(CtTypeReference)
New none
Breaking binary: breaking,
Method was added to an interface.
Old none
New method CtVisitor#visitCtTypeMemberWildcardImportReference(CtTypeMemberWildcardImportReference)
Breaking binary: non_breaking,

@pvojtechovsky pvojtechovsky changed the title fix: model of CtWildcardStaticTypeMemberReference feat: new CtTypeMemberWildcardImportReference for import package.Type.* Nov 5, 2018
@pvojtechovsky
Copy link
Collaborator Author

@monperrus I renamed to new name. It is ready for merge.

@monperrus monperrus merged commit a29633c into INRIA:master Nov 5, 2018
@monperrus
Copy link
Collaborator

Thanks for the progress on import-sniper!

@pvojtechovsky pvojtechovsky deleted the fixWildSTMR branch November 5, 2018 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants