-
-
Notifications
You must be signed in to change notification settings - Fork 355
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
refactor: change ImportScanner interface to add getAllImports #1339
Conversation
Do we have to return the generic type? Would a cast be enough?
(a deprecation should not come with a signature change)
…--Martin
|
Yes, because it can be a
Yes, but how to deprecate the usage of the return type then?... |
*/ | ||
Collection<CtTypeReference<?>> computeImports(CtElement element); | ||
Collection<CtReference> computeImports(CtElement element); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Undo that change
@@ -32,18 +31,27 @@ | |||
* Computes import of a {@link spoon.reflect.declaration.CtElement} | |||
* | |||
* @return class imports computed by Spoon, it does not contain static imports | |||
* @deprecated This method signature will change to return void: Use getAllImports to get the imports after calling it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add the reason: for improving encapsulation and design
Revapi Analysis resultsOld API: fr.inria.gforge.spoon:spoon-core:jar:5.7.0-20170530.131811-139 New API: fr.inria.gforge.spoon:spoon-core:jar:5.7.0-SNAPSHOT Detected changes: 1. Change 1
|
@@ -32,6 +32,7 @@ | |||
* Computes import of a {@link spoon.reflect.declaration.CtElement} | |||
* | |||
* @return class imports computed by Spoon, it does not contain static imports | |||
* @deprecated This method signature will change to return void in order to improve encapsulation: Use getAllImports to get the imports after calling it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the @deprecated should also be outside the javadoc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Revapi Analysis resultsOld API: fr.inria.gforge.spoon:spoon-core:jar:5.7.0-20170531.080348-145 New API: fr.inria.gforge.spoon:spoon-core:jar:5.7.0-SNAPSHOT Detected changes: 1. Change 1
|
This PR fixes #1329 by adding a new method
getAllImports
and by deprecatingcomputeImports
andcomputeAllImports
because their return type will change in the future to void.