You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@shindig.apache.org by zh...@apache.org on 2010/06/29 03:27:35 UTC
svn commit: r958802 -
/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/http/BasicHttpFetcher.java
Author: zhoresh
Date: Tue Jun 29 01:27:35 2010
New Revision: 958802
URL: http://svn.apache.org/viewvc?rev=958802&view=rev
Log:
Set default injection for fetcher proxy to null
http://codereview.appspot.com/1690049/show
Modified:
shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/http/BasicHttpFetcher.java
Modified: shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/http/BasicHttpFetcher.java
URL: http://svn.apache.org/viewvc/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/http/BasicHttpFetcher.java?rev=958802&r1=958801&r2=958802&view=diff
==============================================================================
--- shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/http/BasicHttpFetcher.java (original)
+++ shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/http/BasicHttpFetcher.java Tue Jun 29 01:27:35 2010
@@ -20,6 +20,7 @@ package org.apache.shindig.gadgets.http;
import com.google.common.collect.ImmutableSet;
import com.google.inject.Inject;
import com.google.inject.Singleton;
+import com.google.inject.internal.Nullable;
import com.google.inject.internal.Preconditions;
import com.google.inject.name.Named;
@@ -117,7 +118,7 @@ public class BasicHttpFetcher implements
* @param basicHttpFetcherProxy The http proxy to use.
*/
@Inject
- public BasicHttpFetcher(@Named("org.apache.shindig.gadgets.http.basicHttpFetcherProxy")
+ public BasicHttpFetcher(@Nullable @Named("org.apache.shindig.gadgets.http.basicHttpFetcherProxy")
String basicHttpFetcherProxy) {
this(DEFAULT_MAX_OBJECT_SIZE, DEFAULT_CONNECT_TIMEOUT_MS, DEFAULT_READ_TIMEOUT_MS,
basicHttpFetcherProxy);
@@ -227,6 +228,7 @@ public class BasicHttpFetcher implements
super(entity);
}
+ @Override
public InputStream getContent() throws IOException, IllegalStateException {
// the wrapped entity's getContent() decides about repeatability
InputStream wrappedin = wrappedEntity.getContent();
@@ -234,6 +236,7 @@ public class BasicHttpFetcher implements
return new GZIPInputStream(wrappedin);
}
+ @Override
public long getContentLength() {
// length of ungzipped content is not known
return -1;
@@ -245,6 +248,7 @@ public class BasicHttpFetcher implements
super(entity);
}
+ @Override
public InputStream getContent()
throws IOException, IllegalStateException {
@@ -254,13 +258,14 @@ public class BasicHttpFetcher implements
return new InflaterInputStream(wrappedin, new Inflater(true));
}
+ @Override
public long getContentLength() {
// length of ungzipped content is not known
return -1;
}
}
- public HttpResponse fetch(org.apache.shindig.gadgets.http.HttpRequest request)
+ public HttpResponse fetch(org.apache.shindig.gadgets.http.HttpRequest request)
throws GadgetException {
HttpUriRequest httpMethod = null;
Preconditions.checkNotNull(request);
@@ -362,7 +367,7 @@ public class BasicHttpFetcher implements
LOG.log(Level.INFO, "Got Exception fetching " + request.getUri() + " - " + (now - started) + "ms", e);
- // Separate shindig error from external error
+ // Separate shindig error from external error
throw new GadgetException(GadgetException.Code.INTERNAL_SERVER_ERROR, e,
HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
} finally {
Re: svn commit: r958802 - /shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/http/BasicHttpFetcher.java
Posted by John Hjelmstad <fa...@google.com>.
Thanks Paul.
On Tue, Jun 29, 2010 at 3:17 AM, Paul Lindner <pl...@linkedin.com> wrote:
> That @Nullable annotation is coming out of the jarjar'd code from guice.
>
> Looks like we have a few of these.. will fix..
>
> On Mon, Jun 28, 2010 at 6:27 PM, <zh...@apache.org> wrote:
>
> > Author: zhoresh
> > Date: Tue Jun 29 01:27:35 2010
> > New Revision: 958802
> >
> > URL: http://svn.apache.org/viewvc?rev=958802&view=rev
> > Log:
> > Set default injection for fetcher proxy to null
> > http://codereview.appspot.com/1690049/show
> >
> > Modified:
> >
> >
> shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/http/BasicHttpFetcher.java
> >
> > Modified:
> >
> shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/http/BasicHttpFetcher.java
> > URL:
> >
> http://svn.apache.org/viewvc/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/http/BasicHttpFetcher.java?rev=958802&r1=958801&r2=958802&view=diff
> >
> >
> ==============================================================================
> > ---
> >
> shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/http/BasicHttpFetcher.java
> > (original)
> > +++
> >
> shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/http/BasicHttpFetcher.java
> > Tue Jun 29 01:27:35 2010
> > @@ -20,6 +20,7 @@ package org.apache.shindig.gadgets.http;
> > import com.google.common.collect.ImmutableSet;
> > import com.google.inject.Inject;
> > import com.google.inject.Singleton;
> > +import com.google.inject.internal.Nullable;
> > import com.google.inject.internal.Preconditions;
> > import com.google.inject.name.Named;
> >
> > @@ -117,7 +118,7 @@ public class BasicHttpFetcher implements
> > * @param basicHttpFetcherProxy The http proxy to use.
> > */
> > @Inject
> > - public
> >
> BasicHttpFetcher(@Named("org.apache.shindig.gadgets.http.basicHttpFetcherProxy")
> > + public BasicHttpFetcher(@Nullable
> > @Named("org.apache.shindig.gadgets.http.basicHttpFetcherProxy")
> > String basicHttpFetcherProxy) {
> > this(DEFAULT_MAX_OBJECT_SIZE, DEFAULT_CONNECT_TIMEOUT_MS,
> > DEFAULT_READ_TIMEOUT_MS,
> > basicHttpFetcherProxy);
> > @@ -227,6 +228,7 @@ public class BasicHttpFetcher implements
> > super(entity);
> > }
> >
> > + @Override
> > public InputStream getContent() throws IOException,
> > IllegalStateException {
> > // the wrapped entity's getContent() decides about repeatability
> > InputStream wrappedin = wrappedEntity.getContent();
> > @@ -234,6 +236,7 @@ public class BasicHttpFetcher implements
> > return new GZIPInputStream(wrappedin);
> > }
> >
> > + @Override
> > public long getContentLength() {
> > // length of ungzipped content is not known
> > return -1;
> > @@ -245,6 +248,7 @@ public class BasicHttpFetcher implements
> > super(entity);
> > }
> >
> > + @Override
> > public InputStream getContent()
> > throws IOException, IllegalStateException {
> >
> > @@ -254,13 +258,14 @@ public class BasicHttpFetcher implements
> > return new InflaterInputStream(wrappedin, new Inflater(true));
> > }
> >
> > + @Override
> > public long getContentLength() {
> > // length of ungzipped content is not known
> > return -1;
> > }
> > }
> >
> > - public HttpResponse fetch(org.apache.shindig.gadgets.http.HttpRequest
> > request)
> > + public HttpResponse fetch(org.apache.shindig.gadgets.http.HttpRequest
> > request)
> > throws GadgetException {
> > HttpUriRequest httpMethod = null;
> > Preconditions.checkNotNull(request);
> > @@ -362,7 +367,7 @@ public class BasicHttpFetcher implements
> >
> > LOG.log(Level.INFO, "Got Exception fetching " + request.getUri() +
> "
> > - " + (now - started) + "ms", e);
> >
> > - // Separate shindig error from external error
> > + // Separate shindig error from external error
> > throw new
> GadgetException(GadgetException.Code.INTERNAL_SERVER_ERROR,
> > e,
> > HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
> > } finally {
> >
> >
> >
>
Re: svn commit: r958802 - /shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/http/BasicHttpFetcher.java
Posted by Paul Lindner <pl...@linkedin.com>.
That @Nullable annotation is coming out of the jarjar'd code from guice.
Looks like we have a few of these.. will fix..
On Mon, Jun 28, 2010 at 6:27 PM, <zh...@apache.org> wrote:
> Author: zhoresh
> Date: Tue Jun 29 01:27:35 2010
> New Revision: 958802
>
> URL: http://svn.apache.org/viewvc?rev=958802&view=rev
> Log:
> Set default injection for fetcher proxy to null
> http://codereview.appspot.com/1690049/show
>
> Modified:
>
> shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/http/BasicHttpFetcher.java
>
> Modified:
> shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/http/BasicHttpFetcher.java
> URL:
> http://svn.apache.org/viewvc/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/http/BasicHttpFetcher.java?rev=958802&r1=958801&r2=958802&view=diff
>
> ==============================================================================
> ---
> shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/http/BasicHttpFetcher.java
> (original)
> +++
> shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/http/BasicHttpFetcher.java
> Tue Jun 29 01:27:35 2010
> @@ -20,6 +20,7 @@ package org.apache.shindig.gadgets.http;
> import com.google.common.collect.ImmutableSet;
> import com.google.inject.Inject;
> import com.google.inject.Singleton;
> +import com.google.inject.internal.Nullable;
> import com.google.inject.internal.Preconditions;
> import com.google.inject.name.Named;
>
> @@ -117,7 +118,7 @@ public class BasicHttpFetcher implements
> * @param basicHttpFetcherProxy The http proxy to use.
> */
> @Inject
> - public
> BasicHttpFetcher(@Named("org.apache.shindig.gadgets.http.basicHttpFetcherProxy")
> + public BasicHttpFetcher(@Nullable
> @Named("org.apache.shindig.gadgets.http.basicHttpFetcherProxy")
> String basicHttpFetcherProxy) {
> this(DEFAULT_MAX_OBJECT_SIZE, DEFAULT_CONNECT_TIMEOUT_MS,
> DEFAULT_READ_TIMEOUT_MS,
> basicHttpFetcherProxy);
> @@ -227,6 +228,7 @@ public class BasicHttpFetcher implements
> super(entity);
> }
>
> + @Override
> public InputStream getContent() throws IOException,
> IllegalStateException {
> // the wrapped entity's getContent() decides about repeatability
> InputStream wrappedin = wrappedEntity.getContent();
> @@ -234,6 +236,7 @@ public class BasicHttpFetcher implements
> return new GZIPInputStream(wrappedin);
> }
>
> + @Override
> public long getContentLength() {
> // length of ungzipped content is not known
> return -1;
> @@ -245,6 +248,7 @@ public class BasicHttpFetcher implements
> super(entity);
> }
>
> + @Override
> public InputStream getContent()
> throws IOException, IllegalStateException {
>
> @@ -254,13 +258,14 @@ public class BasicHttpFetcher implements
> return new InflaterInputStream(wrappedin, new Inflater(true));
> }
>
> + @Override
> public long getContentLength() {
> // length of ungzipped content is not known
> return -1;
> }
> }
>
> - public HttpResponse fetch(org.apache.shindig.gadgets.http.HttpRequest
> request)
> + public HttpResponse fetch(org.apache.shindig.gadgets.http.HttpRequest
> request)
> throws GadgetException {
> HttpUriRequest httpMethod = null;
> Preconditions.checkNotNull(request);
> @@ -362,7 +367,7 @@ public class BasicHttpFetcher implements
>
> LOG.log(Level.INFO, "Got Exception fetching " + request.getUri() + "
> - " + (now - started) + "ms", e);
>
> - // Separate shindig error from external error
> + // Separate shindig error from external error
> throw new GadgetException(GadgetException.Code.INTERNAL_SERVER_ERROR,
> e,
> HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
> } finally {
>
>
>