[GitHub] brooklyn-server pull request #859: Delete old deprecated code

2017-10-18 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/brooklyn-server/pull/859


---


[GitHub] brooklyn-server pull request #859: Delete old deprecated code

2017-10-17 Thread aledsage
Github user aledsage commented on a diff in the pull request:

https://github.com/apache/brooklyn-server/pull/859#discussion_r145067746
  
--- Diff: api/src/main/java/org/apache/brooklyn/api/location/Location.java 
---
@@ -89,29 +86,6 @@
 boolean containsLocation(Location potentialDescendent);
 
 /**
- * Convenience method for {@code config().get(key)}
- * 
- * @see {@link #getConfig(ConfigKey)}
- */
- T getConfig(HasConfigKey key);
--- End diff --

Great spot - thanks for checking thoroughly!


---


[GitHub] brooklyn-server pull request #859: Delete old deprecated code

2017-10-17 Thread aledsage
Github user aledsage commented on a diff in the pull request:

https://github.com/apache/brooklyn-server/pull/859#discussion_r145067457
  
--- Diff: 
core/src/main/java/org/apache/brooklyn/util/core/osgi/BundleMaker.java ---
@@ -110,8 +110,6 @@ public File createJarFromClasspathDir(String path) {
 addUrlItemRecursively(zout, path, path, 
Predicates.alwaysTrue());
 }
 
-Streams.closeQuietly(zout);
--- End diff --

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).


---


[GitHub] brooklyn-server pull request #859: Delete old deprecated code

2017-10-17 Thread aledsage
Github user aledsage commented on a diff in the pull request:

https://github.com/apache/brooklyn-server/pull/859#discussion_r145066673
  
--- Diff: 
core/src/main/java/org/apache/brooklyn/core/entity/EntityPredicates.java ---
@@ -488,11 +482,6 @@ public String toString() {
 }
 }
 
-/** @deprecated since 0.7.0 use {@link #isManaged()} */ @Deprecated
-public static  Predicate managed() {
-return isManaged();
-}
-
 /** @deprecated since 0.7.0 use {@link #isManaged()}, introduced to 
allow deserialization of anonymous inner class */
 @SuppressWarnings("unused") @Deprecated
 private static  Predicate managedOld() {
--- End diff --

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).


---


[GitHub] brooklyn-server pull request #859: Delete old deprecated code

2017-10-17 Thread aledsage
Github user aledsage commented on a diff in the pull request:

https://github.com/apache/brooklyn-server/pull/859#discussion_r145064284
  
--- Diff: 
core/src/main/java/org/apache/brooklyn/core/entity/EntityPredicates.java ---
@@ -454,12 +454,6 @@ public String toString() {
 }
 }
 
-/** @deprecated since 0.7.0 use {@link #locationsIncludes(Location)} */
-@Deprecated 
-public static  Predicate 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  Predicate withLocationOld(final Location 
location) {
--- End diff --

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.


---


[GitHub] brooklyn-server pull request #859: Delete old deprecated code

2017-10-17 Thread aledsage
Github user aledsage commented on a diff in the pull request:

https://github.com/apache/brooklyn-server/pull/859#discussion_r145063507
  
--- Diff: 
core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogUtils.java 
---
@@ -112,8 +112,8 @@ public static BrooklynClassLoadingContext 
newClassLoadingContext(@Nullable Manag
 return newClassLoadingContext(mgmt, catalogItemId, libraries, 
JavaBrooklynClassLoadingContext.create(mgmt));
 }
 
-@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 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 libraries, BrooklynClassLoadingContext 
loader) {
--- End diff --

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).


---


[GitHub] brooklyn-server pull request #859: Delete old deprecated code

2017-10-13 Thread tbouron
Github user tbouron commented on a diff in the pull request:

https://github.com/apache/brooklyn-server/pull/859#discussion_r144663987
  
--- Diff: 
core/src/main/java/org/apache/brooklyn/util/core/osgi/BundleMaker.java ---
@@ -110,8 +110,6 @@ public File createJarFromClasspathDir(String path) {
 addUrlItemRecursively(zout, path, path, 
Predicates.alwaysTrue());
 }
 
-Streams.closeQuietly(zout);
--- End diff --

Should this be removed?


---


[GitHub] brooklyn-server pull request #859: Delete old deprecated code

2017-10-13 Thread tbouron
Github user tbouron commented on a diff in the pull request:

https://github.com/apache/brooklyn-server/pull/859#discussion_r144589344
  
--- Diff: 
core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogUtils.java 
---
@@ -112,8 +112,8 @@ public static BrooklynClassLoadingContext 
newClassLoadingContext(@Nullable Manag
 return newClassLoadingContext(mgmt, catalogItemId, libraries, 
JavaBrooklynClassLoadingContext.create(mgmt));
 }
 
-@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 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 libraries, BrooklynClassLoadingContext 
loader) {
--- End diff --

Keeping for persistence reason I suppose?


---


[GitHub] brooklyn-server pull request #859: Delete old deprecated code

2017-10-13 Thread tbouron
Github user tbouron commented on a diff in the pull request:

https://github.com/apache/brooklyn-server/pull/859#discussion_r144662800
  
--- Diff: 
core/src/main/java/org/apache/brooklyn/core/entity/EntityPredicates.java ---
@@ -454,12 +454,6 @@ public String toString() {
 }
 }
 
-/** @deprecated since 0.7.0 use {@link #locationsIncludes(Location)} */
-@Deprecated 
-public static  Predicate 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  Predicate withLocationOld(final Location 
location) {
--- End diff --

Can we remove this one? Don't think it is use for rebind


---


[GitHub] brooklyn-server pull request #859: Delete old deprecated code

2017-10-10 Thread aledsage
GitHub user aledsage opened a pull request:

https://github.com/apache/brooklyn-server/pull/859

Delete old deprecated code

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).

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/aledsage/brooklyn-server 
delete-old-deprecated-code

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/brooklyn-server/pull/859.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #859


commit 6b25fd86e959c5bbd00448bcbe6e9bab1874
Author: Aled Sage 
Date:   2017-10-09T09:59:10Z

Deletes old deprecated code

commit 8594e655161ddd308080085f91d4a5f316e1bf6e
Author: Aled Sage 
Date:   2017-10-09T22:46:52Z

Regenerate osgi bundles, fixing deprecation usage




---