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

review 1: feature: CtTypeParameter#getTypeDeclarer() #1217

Merged
merged 3 commits into from
Mar 14, 2017

Conversation

pvojtechovsky
Copy link
Collaborator

During work with CtTypeParameter I always needed to know where this parameter is declared. I suggest to introduce this new API method into CtTypeParameter.

	/**
	 * @return the {@link CtFormalTypeDeclarer}, which declares this {@link CtTypeParameter}
	 */
	@DerivedProperty
	CtFormalTypeDeclarer getTypeDeclarer();

This PR fixes bug in TypeFactory#createReference(CtTypeParameter), which created reference without parent, so there was lost information about type parameter declarer. CtTypeParameterReference without declarer is useless.

@pvojtechovsky pvojtechovsky changed the title feature: CtTypeParameter#getTypeDeclarer() review 1: feature: CtTypeParameter#getTypeDeclarer() Mar 13, 2017
@monperrus
Copy link
Collaborator

This method is good.

Two questions before merge:

  • rename as getTypeParameterDeclarer?
  • could you add one test?

Thanks.

@pvojtechovsky
Copy link
Collaborator Author

Rename done:
2 tests added

  • one for getTypeParameterDeclarer
  • second for CtTypeParameter.getReference().getDeclaration(), which did not worked before and is fixed by this PR too.

I am done. Please review

@spoon-bot
Copy link
Collaborator

Revapi Analysis results

Old API: fr.inria.gforge.spoon:spoon-core:jar:5.6.0-20170313.234505-78

New API: fr.inria.gforge.spoon:spoon-core:jar:5.6.0-SNAPSHOT

Detected changes: 1.

Change 1

Name Element
Old none
New method spoon.reflect.declaration.CtFormalTypeDeclarer spoon.reflect.declaration.CtTypeParameter::getTypeParameterDeclarer()
Code java.method.addedToInterface
Description Method was added to an interface.
Breaking source: breaking, binary: non_breaking, semantic: potentially_breaking

@spoon-bot
Copy link
Collaborator

Revapi Analysis results

Old API: fr.inria.gforge.spoon:spoon-core:jar:5.6.0-20170313.234505-78

New API: fr.inria.gforge.spoon:spoon-core:jar:5.6.0-SNAPSHOT

Detected changes: 1.

Change 1

Name Element
Old none
New method spoon.reflect.declaration.CtFormalTypeDeclarer spoon.reflect.declaration.CtTypeParameter::getTypeParameterDeclarer()
Code java.method.addedToInterface
Description Method was added to an interface.
Breaking binary: non_breaking, source: breaking, semantic: potentially_breaking

@monperrus monperrus merged commit f87ba4f into INRIA:master Mar 14, 2017
@monperrus
Copy link
Collaborator

thanks

@pvojtechovsky pvojtechovsky deleted the getTypeDeclarer branch March 14, 2017 20:21
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.

None yet

3 participants