Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(183)

Issue 1690049: Set default for Fetcher proxy injection to be null

Can't Edit
Can't Publish+Mail
Start Review
Created:
15 years, 8 months ago by zhoresh
Modified:
15 years, 8 months ago
Reviewers:
johnfargo, dev-remailer
Base URL:
http://svn.apache.org/repos/asf/shindig/trunk/
Visibility:
Public.

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+8 lines, -3 lines) Patch
java/gadgets/src/main/java/org/apache/shindig/gadgets/http/BasicHttpFetcher.java View 7 chunks +8 lines, -3 lines 0 comments Download

Messages

Total messages: 2
zhoresh
15 years, 8 months ago (2010-06-28 23:09:24 UTC) #1
johnfargo
15 years, 8 months ago (2010-06-28 23:21:35 UTC) #2
LGTM

On Mon, Jun 28, 2010 at 4:09 PM, <zhoresh@gmail.com> wrote:

> Reviewers: dev-remailer_shindig.apache.org, johnfargo,
>
>
>
> Please review this at http://codereview.appspot.com/1690049/show
>
> Affected files:
>
> 
java/gadgets/src/main/java/org/apache/shindig/gadgets/http/BasicHttpFetcher.java
>
>
> ### Eclipse Workspace Patch 1.0
> #P shindig-project
> Index:
>
java/gadgets/src/main/java/org/apache/shindig/gadgets/http/BasicHttpFetcher.java
> ===================================================================
> ---
>
java/gadgets/src/main/java/org/apache/shindig/gadgets/http/BasicHttpFetcher.java
>    (revision 957768)
> +++
>
java/gadgets/src/main/java/org/apache/shindig/gadgets/http/BasicHttpFetcher.java
>    (working copy)
> @@ -20,6 +20,7 @@
>  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 @@
>    * @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 @@
>       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 @@
>       return new GZIPInputStream(wrappedin);
>     }
>
> +    @Override
>     public long getContentLength() {
>       // length of ungzipped content is not known
>       return -1;
> @@ -245,6 +248,7 @@
>       super(entity);
>     }
>
> +    @Override
>     public InputStream getContent()
>         throws IOException, IllegalStateException {
>
> @@ -254,13 +258,14 @@
>       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 @@
>
>       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 {
>
>
>
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b