-
Notifications
You must be signed in to change notification settings - Fork 142
Clean Code for resources/bundles/org.eclipse.core.resources #1917
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
base: master
Are you sure you want to change the base?
Clean Code for resources/bundles/org.eclipse.core.resources #1917
Conversation
This pull request changes some projects for the first time in this development cycle.
An additional commit containing all the necessary changes was pushed to the top of this PR's branch. To obtain these changes (for example if you want to push more changes) either fetch from your fork or apply the git patch. Git patch
Further information are available in Common Build Issues - Missing version increments. |
cbfa141
to
913c00c
Compare
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.
Compilation fails because the cleanup that inlines calls to deprecated methods leads to a deprecated method that is unused afterwards. The affected method is Workspace#computeFullBuildConfigOrder
:
Lines 878 to 909 in a0e851b
/** | |
* Computes the global total ordering of all project buildConfigs in the workspace based | |
* on build config references. If an existing and open build config P | |
* references another existing and open project build config Q, then Q should come before P | |
* in the resulting ordering. Closed and non-existent projects/buildConfigs are | |
* ignored, and will not appear in the result. References to non-existent or closed | |
* projects/buildConfigs are also ignored, as are any self-references. | |
* <p> | |
* When there are choices, the choice is made in a reasonably stable way. For | |
* example, given an arbitrary choice between two project buildConfigs, the one with the | |
* lower collating project name and build config name will appear earlier in the list. | |
* </p> | |
* <p> | |
* When the build config reference graph contains cyclic references, it is | |
* impossible to honor all of the relationships. In this case, the result | |
* ignores as few relationships as possible. For example, if P2 references P1, | |
* P4 references P3, and P2 and P3 reference each other, then exactly one of the | |
* relationships between P2 and P3 will have to be ignored. The outcome will be | |
* either [P1, P2, P3, P4] or [P1, P3, P2, P4]. The result also contains | |
* complete details of any cycles present. | |
* </p> | |
* | |
* @return result describing the global project build configuration order | |
* @deprecated Use {@link #computeFullBuildConfigGraph()} instead | |
*/ | |
@Deprecated | |
private VertexOrder<IBuildConfiguration> computeFullBuildConfigOrder() { | |
Digraph<IBuildConfiguration> graph = computeFullBuildConfigGraph(); | |
return ComputeProjectOrder.computeVertexOrder(graph, IBuildConfiguration.class); | |
} | |
private Digraph<IBuildConfiguration> computeFullBuildConfigGraph() { |
Technically, it is of course fine to inline the method body of the deprecated method body, but I wonder why the method was actively deprecated and not directly inlined. I guess it's because actually some further rework of the functionality may be made. And also the documentation of the deprecated method would get lost, of which I am not sure how valid and relevant it still is after previous reworks of that code.
@mickaelistria you have been reworking the calculation of the build orders in the Workspace
class several years ago, which also introduced the deprecation. Do you know what is appropriate here? Can we just inline and remove the deprecated method?
913c00c
to
96916d3
Compare
Even though it turns out to be needing some investigation its the first time I see the inline feature to actually kick in, so interesting use-case example. @jjohnstn can something be made that an unused method is cleaned up as well? |
96916d3
to
168968e
Compare
That would be beyond the scope of the cleanup to remove a deprecated method before it is scheduled to be removed. I think one simple possibility is to add a SuppressWarnings(unused). |
@jjohnstn I don't think it should be one clenaup, so maybe the question is more, can we have a "remove unused methods" cleanup (that then has to run after the inlining if enabled). |
28395d8
to
9676171
Compare
9676171
to
ddb78ad
Compare
The following cleanups were applied: