You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by al...@apache.org on 2015/07/02 18:26:10 UTC

[1/2] incubator-brooklyn git commit: BROOKLYN-154: Don't call methods that might not be there

Repository: incubator-brooklyn
Updated Branches:
  refs/heads/master da6d887f9 -> b3bdacb64


BROOKLYN-154: Don't call methods that might not be there

This code attempted to call non-standard extensions on the
javax.ws.rs.core.Response class. This change does the appropriate
instanceof checks to ensure that no non-standard methods are called if
we have a plain old Response object.


Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/94b031e2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/94b031e2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/94b031e2

Branch: refs/heads/master
Commit: 94b031e24d9f9984ea79840d2249964090b991e3
Parents: ea1d6cb
Author: Richard Downer <ri...@apache.org>
Authored: Wed Jul 1 12:43:05 2015 +0100
Committer: Richard Downer <ri...@apache.org>
Committed: Thu Jul 2 02:28:11 2015 +0100

----------------------------------------------------------------------
 .../java/brooklyn/util/http/BuiltResponsePreservingError.java | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/94b031e2/usage/rest-client/src/main/java/brooklyn/util/http/BuiltResponsePreservingError.java
----------------------------------------------------------------------
diff --git a/usage/rest-client/src/main/java/brooklyn/util/http/BuiltResponsePreservingError.java b/usage/rest-client/src/main/java/brooklyn/util/http/BuiltResponsePreservingError.java
index c3ad96a..3bd88e6 100644
--- a/usage/rest-client/src/main/java/brooklyn/util/http/BuiltResponsePreservingError.java
+++ b/usage/rest-client/src/main/java/brooklyn/util/http/BuiltResponsePreservingError.java
@@ -22,6 +22,7 @@ import java.lang.annotation.Annotation;
 
 import javax.ws.rs.core.Response;
 
+import org.jboss.resteasy.client.core.BaseClientResponse;
 import org.jboss.resteasy.core.Headers;
 import org.jboss.resteasy.specimpl.BuiltResponse;
 
@@ -51,7 +52,8 @@ public class BuiltResponsePreservingError extends BuiltResponse {
         Object entity = null;
         try {
             status = source.getStatus();
-            headers.putAll(source.getHeaders());
+            if (source instanceof BaseClientResponse)
+                headers.putAll(((BaseClientResponse<?>)source).getMetadata());
             if (source instanceof org.jboss.resteasy.client.ClientResponse) {
                 entity = ((org.jboss.resteasy.client.ClientResponse<?>)source).getEntity(type);
             } else {
@@ -62,7 +64,8 @@ public class BuiltResponsePreservingError extends BuiltResponse {
             Exceptions.propagateIfFatal(e);
             return new BuiltResponsePreservingError(status, headers, entity, new Annotation[0], e);
         } finally {
-            source.close();
+            if (source instanceof BaseClientResponse)
+                ((BaseClientResponse<?>)source).close();
         }
     }
     


[2/2] incubator-brooklyn git commit: This closes #730

Posted by al...@apache.org.
This closes #730


Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/b3bdacb6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/b3bdacb6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/b3bdacb6

Branch: refs/heads/master
Commit: b3bdacb641f80d713d0f72f08171d7eb8221a999
Parents: da6d887 94b031e
Author: Aled Sage <al...@gmail.com>
Authored: Thu Jul 2 17:25:56 2015 +0100
Committer: Aled Sage <al...@gmail.com>
Committed: Thu Jul 2 17:25:56 2015 +0100

----------------------------------------------------------------------
 .../java/brooklyn/util/http/BuiltResponsePreservingError.java | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------