-
Notifications
You must be signed in to change notification settings - Fork 55
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
Delete old deprecated code #859
Conversation
retest this please |
Apache jenkins failed with:
The last thing in the console before that was the log below (looks like it hung when trying to execute
|
retest this please |
I ran this test many times ( |
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.
Built and tested locally. Look really good and glad to see -3594
for only +179
:)
I have only few minor comments
* | ||
* @see {@link #getConfig(ConfigKey)} | ||
*/ | ||
<T> T getConfig(HasConfigKey<T> key); |
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.
Ooops, went a bit too far on this one, isn't 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.
Great spot - thanks for checking thoroughly!
@Deprecated /** @deprecated since 0.9.0; becoming private because we should now always have a registered type callers can pass instead of the catalog item id */ | ||
public static BrooklynClassLoadingContext newClassLoadingContext(@Nullable ManagementContext mgmt, String catalogItemId, Collection<? extends OsgiBundleWithUrl> libraries, BrooklynClassLoadingContext loader) { | ||
@Deprecated /** @deprecated since 0.9.0; we should now always have a registered type callers can pass instead of the catalog item id */ | ||
private static BrooklynClassLoadingContext newClassLoadingContext(@Nullable ManagementContext mgmt, String catalogItemId, Collection<? extends OsgiBundleWithUrl> libraries, BrooklynClassLoadingContext loader) { |
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.
Keeping for persistence reason I suppose?
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 other three public methods all delegate to this; we just want this one to be private.
I expect there's scope to re-write the methods to delete this, but I've not looked closely (hence leaving it as deprecated).
public static <T> Predicate<Entity> withLocation(final Location location) { | ||
return locationsIncludes(location); | ||
} | ||
|
||
/** @deprecated since 0.7.0 use {@link #locationsIncludes(Location)}, introduced to allow deserialization of anonymous inner class */ | ||
@SuppressWarnings("unused") @Deprecated | ||
private static <T> Predicate<Entity> withLocationOld(final Location location) { |
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.
Can we remove this one? Don't think it is use for rebind
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.
If someone has really old historic persisted state then they might reference this anonymous class!
At some point (when we have a way for the user to fix their persisted state easily?!) we'll delete this stuff.
public static <T> Predicate<Entity> managed() { | ||
return isManaged(); | ||
} | ||
|
||
/** @deprecated since 0.7.0 use {@link #isManaged()}, introduced to allow deserialization of anonymous inner class */ | ||
@SuppressWarnings("unused") @Deprecated | ||
private static <T> Predicate<Entity> managedOld() { |
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.
Can we remove this one? Don't think it is use for rebind
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.
As above: playing it safe in case someone has extremely old persisted state (until we have a nicer way to walk users though detecting/fixing such problems).
@@ -110,8 +110,6 @@ public File createJarFromClasspathDir(String path) { | |||
addUrlItemRecursively(zout, path, path, Predicates.alwaysTrue()); | |||
} | |||
|
|||
Streams.closeQuietly(zout); |
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.
Should this be removed?
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.
Yes - it's done in the finally block as well, so this line is redundant (admittedly not to do with deprecated code, but is general code cleanup).
8594e65
to
847a4da
Compare
Yup @aledsage, LGTM. |
@aledsage Build failure seems related though:
|
847a4da
to
4f86cfd
Compare
retest this please |
1 similar comment
retest this please |
Test failure looked unrelated, and I couldn't reproduce locally (or see why this would fail!):
|
retest this please |
Failed again, this time when running
Higher in the test log, it says:
|
retest this please |
In this PR, I've only deleted things deprecated in 0.9.0 or before. I haven't deleted all of it either - I didn't delete the deprecated code that was still in use in non-trivial ways.
We could do with another look through the code for more things to delete, and could also look at deleting things deprecated since 0.10.0 (released 21 Dec 2016 - http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22org.apache.brooklyn%22%20AND%20a%3A%22brooklyn-core%22).
I've tried to be conservative, to not delete anything that might affect historic persisted state. For example, the only classes I've deleted are ones that I'd really hope are not referenced in anyone's really old persisted state!
This will require some other minor changes in brooklyn-library etc (to remove use of deprecated code), and will likely affect some downstream projects (e.g. https://github.com/brooklyncentral/advanced-networking).