You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@abdera.apache.org by Garrett Rooney <ro...@electricjellyfish.net> on 2006/08/07 19:47:29 UTC

Re: svn commit: r429411 - in /incubator/abdera/java/trunk/client/src/main/java: log4j.properties org/apache/abdera/protocol/cache/CacheBase.java org/apache/abdera/protocol/client/CommonsClient.java

On 8/7/06, jmsnell@apache.org <jm...@apache.org> wrote:
> Author: jmsnell
> Date: Mon Aug  7 10:45:17 2006
> New Revision: 429411
>
> URL: http://svn.apache.org/viewvc?rev=429411&view=rev
> Log:
> Had a brain fart on the way to some bitwise operator code.
> Also, get rid of the log4j warning
>
> Added:
>     incubator/abdera/java/trunk/client/src/main/java/log4j.properties
> Modified:
>     incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/cache/CacheBase.java
>     incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/CommonsClient.java
>
> Added: incubator/abdera/java/trunk/client/src/main/java/log4j.properties
> URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/client/src/main/java/log4j.properties?rev=429411&view=auto
> ==============================================================================
> --- incubator/abdera/java/trunk/client/src/main/java/log4j.properties (added)
> +++ incubator/abdera/java/trunk/client/src/main/java/log4j.properties Mon Aug  7 10:45:17 2006
> @@ -0,0 +1,5 @@
> +log4j.appender.stdout=org.apache.log4j.ConsoleAppender
> +log4j.appender.stdout.Target=System.err
> +log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
> +log4j.appender.stdout.layout.ConversionPattern=%c{1}.%M: %m%n
> +log4j.rootLogger=warn, stdout

Huh?  Do we even use log4j?  Is this from one of our dependencies or something?

> \ No newline at end of file
>
> Modified: incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/cache/CacheBase.java
> URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/cache/CacheBase.java?rev=429411&r1=429410&r2=429411&view=diff
> ==============================================================================
> --- incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/cache/CacheBase.java (original)
> +++ incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/cache/CacheBase.java Mon Aug  7 10:45:17 2006
> @@ -122,10 +122,6 @@
>      RequestOptions options,
>      Response response) {
>      CacheKey key = getCacheKey(uri, options,response);
> -System.out.println(response);
> -System.out.println(response.isNoStore());
> -System.out.println(options);
> -System.out.println(options.getNoStore());
>      if ((response != null && response.isNoStore()) ||
>          options != null && options.getNoStore()) {
>       remove(key);
>
> Modified: incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/CommonsClient.java
> URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/CommonsClient.java?rev=429411&r1=429410&r2=429411&view=diff
> ==============================================================================
> --- incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/CommonsClient.java (original)
> +++ incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/CommonsClient.java Mon Aug  7 10:45:17 2006
> @@ -67,11 +67,12 @@
>      RequestEntity entity,
>      RequestOptions options) {
>        try {
> +        if (options == null) options = getDefaultRequestOptions();
>          Response response = null;
>          CachedResponse cached_response = null;
>          Cache cache = getCache();
>          CacheDisposition disp = CacheDisposition.TRANSPARENT;
> -        if (cache != null) {
> +        if (cache != null && options.getNoCache() == false && options.getNoStore() == false) {
>            disp = cache.getDisposition(uri,options);
>            cached_response = cache.get(uri, options);
>            switch(disp) {
> @@ -94,18 +95,16 @@
>          }
>          if (response == null) {
>            HttpMethod httpMethod = createMethod(method, uri, entity);
> -          if (options != null) {
> -            String[] headers = options.getHeaderNames();
> -            for (String header : headers) {
> -              String[] values = options.getHeaders(header);
> -              for (String value : values) {
> -                httpMethod.addRequestHeader(header, value);
> -              }
> +          String[] headers = options.getHeaderNames();
> +          for (String header : headers) {
> +            String[] values = options.getHeaders(header);
> +            for (String value : values) {
> +              httpMethod.addRequestHeader(header, value);
>              }
> -            String cc = options.getCacheControl();
> -            if (cc != null && cc.length() != 0)
> -              httpMethod.setRequestHeader("Cache-Control", cc);
>            }
> +          String cc = options.getCacheControl();
> +          if (cc != null && cc.length() != 0)
> +            httpMethod.setRequestHeader("Cache-Control", cc);
>            int n = client.executeMethod(httpMethod);
>            if (n == 304 || n == 412 &&
>                cached_response != null &&
>

These changes seem totally unrelated to the log message, am I just
missing something here?

-garrett