It's the other way round: spaces, not tabs. Andreas
On Sun, May 29, 2016 at 8:28 PM, <dus...@apache.org> wrote: > Author: dushan > Date: Sun May 29 19:28:02 2016 > New Revision: 1746052 > > URL: http://svn.apache.org/viewvc?rev=1746052&view=rev > Log: > correcting code styles for the fix SYNAPSE-1025 > > Modified: > synapse/trunk/java/modules/transports/core/nhttp/pom.xml > > synapse/trunk/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/nhttp/NhttpConstants.java > > synapse/trunk/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/SourceRequest.java > > synapse/trunk/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/SourceResponse.java > > synapse/trunk/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/TargetRequest.java > > synapse/trunk/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/TargetResponse.java > > synapse/trunk/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/util/PassThroughTransportUtils.java > > synapse/trunk/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/util/TargetRequestFactory.java > > Modified: synapse/trunk/java/modules/transports/core/nhttp/pom.xml > URL: > http://svn.apache.org/viewvc/synapse/trunk/java/modules/transports/core/nhttp/pom.xml?rev=1746052&r1=1746051&r2=1746052&view=diff > ============================================================================== > --- synapse/trunk/java/modules/transports/core/nhttp/pom.xml (original) > +++ synapse/trunk/java/modules/transports/core/nhttp/pom.xml Sun May 29 > 19:28:02 2016 > @@ -157,13 +157,11 @@ > <dependency> > <groupId>commons-lang</groupId> > <artifactId>commons-lang</artifactId> > - </dependency> > - > - <dependency> > - <groupId>commons-collections</groupId> > - <artifactId>commons-collections</artifactId> > - </dependency> > - > + </dependency> > + <dependency> > + <groupId>commons-collections</groupId> > + <artifactId>commons-collections</artifactId> > + </dependency> > <!-- BouncyCastle API which is required when validating > Certificates. --> > <dependency> > <groupId>org.bouncycastle</groupId> > > Modified: > synapse/trunk/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/nhttp/NhttpConstants.java > URL: > http://svn.apache.org/viewvc/synapse/trunk/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/nhttp/NhttpConstants.java?rev=1746052&r1=1746051&r2=1746052&view=diff > ============================================================================== > --- > synapse/trunk/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/nhttp/NhttpConstants.java > (original) > +++ > synapse/trunk/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/nhttp/NhttpConstants.java > Sun May 29 19:28:02 2016 > @@ -167,9 +167,9 @@ public class NhttpConstants { > //property name of nhttp log directory > public static final String NHTTP_LOG_DIRECTORY = "nhttp.log.directory"; > > - /** > - * This holds a MultiValue Map, which keeps transport headers' values > other than last value > - * (in order they appear) against the transport header. > - */ > - public static final String EXCESS_TRANSPORT_HEADERS = > "EXCESS_TRANSPORT_HEADERS"; > + /** > + * This holds a MultiValue Map, which keeps transport headers' values > other > + * than last value (in order they appear) against the transport > header. > + */ > + public static final String EXCESS_TRANSPORT_HEADERS = > "EXCESS_TRANSPORT_HEADERS"; > } > > Modified: > synapse/trunk/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/SourceRequest.java > URL: > http://svn.apache.org/viewvc/synapse/trunk/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/SourceRequest.java?rev=1746052&r1=1746051&r2=1746052&view=diff > ============================================================================== > --- > synapse/trunk/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/SourceRequest.java > (original) > +++ > synapse/trunk/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/SourceRequest.java > Sun May 29 19:28:02 2016 > @@ -67,9 +67,8 @@ public class SourceRequest { > /** The connection from the client */ > private NHttpServerConnection connection = null; > > - /** Excess headers of the request */ > - private Map excessHeaders = new MultiValueMap(); > - > + /** Excess headers of the request */ > + private Map excessHeaders = new MultiValueMap(); > > public SourceRequest(SourceConfiguration sourceConfiguration, > HttpRequest request, > @@ -89,16 +88,16 @@ public class SourceRequest { > this.version = HttpVersion.HTTP_1_1; > } > > - Header[] headers = request.getAllHeaders(); > - if (headers != null) { > - for (Header header : headers) { > - if(this.headers.containsKey(header.getName())) { > - addExcessHeader(header); > - } else { > - this.headers.put(header.getName(), > header.getValue()); > - } > - } > - } > + Header[] headers = request.getAllHeaders(); > + if (headers != null) { > + for (Header header : headers) { > + if > (this.headers.containsKey(header.getName())) { > + addExcessHeader(header); > + } else { > + this.headers.put(header.getName(), > header.getValue()); > + } > + } > + } > } > > /** > @@ -191,11 +190,11 @@ public class SourceRequest { > return entityEnclosing; > } > > - public Map getExcessHeaders() { > - return this.excessHeaders; > - } > + public Map getExcessHeaders() { > + return this.excessHeaders; > + } > > - public void addExcessHeader(Header h) { > - this.excessHeaders.put(h.getName(), h.getValue()); > - } > + public void addExcessHeader(Header h) { > + this.excessHeaders.put(h.getName(), h.getValue()); > + } > } > > Modified: > synapse/trunk/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/SourceResponse.java > URL: > http://svn.apache.org/viewvc/synapse/trunk/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/SourceResponse.java?rev=1746052&r1=1746051&r2=1746052&view=diff > ============================================================================== > --- > synapse/trunk/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/SourceResponse.java > (original) > +++ > synapse/trunk/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/SourceResponse.java > Sun May 29 19:28:02 2016 > @@ -40,8 +40,8 @@ public class SourceResponse { > > private Pipe pipe = null; > > - /** Transport headers */ > - private Map<String, TreeSet<String>> headers = new HashMap<String, > TreeSet<String>>(); > + /** Transport headers */ > + private Map<String, TreeSet<String>> headers = new HashMap<String, > TreeSet<String>>(); > > /** Status of the response */ > private int status = HttpStatus.SC_OK; > @@ -122,17 +122,17 @@ public class SourceResponse { > > response.setEntity(entity); > > - // set any transport headers > - Set<Map.Entry<String, TreeSet<String>>> entries = headers.entrySet(); > + // set any transport headers > + Set<Map.Entry<String, TreeSet<String>>> entries = > headers.entrySet(); > > - for (Map.Entry<String, TreeSet<String>> entry : entries) { > - if (entry.getKey() != null) { > - Iterator<String> i = entry.getValue().iterator(); > - while(i.hasNext()) { > - response.addHeader(entry.getKey(), i.next()); > - } > - } > - } > + for (Map.Entry<String, TreeSet<String>> entry : entries) { > + if (entry.getKey() != null) { > + Iterator<String> i = > entry.getValue().iterator(); > + while (i.hasNext()) { > + response.addHeader(entry.getKey(), > i.next()); > + } > + } > + } > > > SourceContext.updateState(conn, ProtocolState.RESPONSE_HEAD); > > Modified: > synapse/trunk/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/TargetRequest.java > URL: > http://svn.apache.org/viewvc/synapse/trunk/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/TargetRequest.java?rev=1746052&r1=1746051&r2=1746052&view=diff > ============================================================================== > --- > synapse/trunk/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/TargetRequest.java > (original) > +++ > synapse/trunk/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/TargetRequest.java > Sun May 29 19:28:02 2016 > @@ -62,9 +62,9 @@ public class TargetRequest { > > private Pipe pipe = null; > > - /** Headers map */ > - private Map<String, TreeSet<String>> headers = new HashMap<String, > TreeSet<String>>(); > - > + /** Headers map */ > + private Map<String, TreeSet<String>> headers = new HashMap<String, > TreeSet<String>>(); > + > /** URL */ > private URL url; > > @@ -129,14 +129,14 @@ public class TargetRequest { > long contentLength = -1; > String contentLengthHeader = null; > > - if(headers.get(HTTP.CONTENT_LEN) != null && > headers.get(HTTP.CONTENT_LEN).size() > 0) { > - contentLengthHeader = headers.get(HTTP.CONTENT_LEN).first(); > - } > - > - if (contentLengthHeader != null) { > - contentLength = Integer.parseInt(contentLengthHeader); > - headers.remove(HTTP.CONTENT_LEN); > - } > + if (headers.get(HTTP.CONTENT_LEN) != null && > headers.get(HTTP.CONTENT_LEN).size() > 0) { > + contentLengthHeader = > headers.get(HTTP.CONTENT_LEN).first(); > + } > + > + if (contentLengthHeader != null) { > + contentLength = Integer.parseInt(contentLengthHeader); > + headers.remove(HTTP.CONTENT_LEN); > + } > > > MessageContext requestMsgCtx = > TargetContext.get(conn).getRequestMsgCtx(); > @@ -193,15 +193,15 @@ public class TargetRequest { > } > > > - Set<Map.Entry<String, TreeSet<String>>> entries = headers.entrySet(); > - for (Map.Entry<String, TreeSet<String>> entry : entries) { > - if (entry.getKey() != null) { > - Iterator<String> i = entry.getValue().iterator(); > - while(i.hasNext()) { > - request.addHeader(entry.getKey(), i.next()); > - } > - } > - } > + Set<Map.Entry<String, TreeSet<String>>> entries = > headers.entrySet(); > + for (Map.Entry<String, TreeSet<String>> entry : entries) { > + if (entry.getKey() != null) { > + Iterator<String> i = > entry.getValue().iterator(); > + while (i.hasNext()) { > + request.addHeader(entry.getKey(), > i.next()); > + } > + } > + } > > //setup wsa action.. > if (request != null){ > @@ -250,7 +250,7 @@ public class TargetRequest { > } > > > - public void addHeader(String name, String value) { > + public void addHeader(String name, String value) { > if (headers.get(name) == null) { > TreeSet<String> values = new TreeSet<String>(); > values.add(value); > > Modified: > synapse/trunk/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/TargetResponse.java > URL: > http://svn.apache.org/viewvc/synapse/trunk/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/TargetResponse.java?rev=1746052&r1=1746051&r2=1746052&view=diff > ============================================================================== > --- > synapse/trunk/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/TargetResponse.java > (original) > +++ > synapse/trunk/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/TargetResponse.java > Sun May 29 19:28:02 2016 > @@ -78,16 +78,16 @@ public class TargetResponse { > this.status = response.getStatusLine().getStatusCode(); > this.statusLine = response.getStatusLine().getReasonPhrase(); > > - Header[] headers = response.getAllHeaders(); > - if (headers != null) { > - for (Header header : headers) { > - if(this.headers.containsKey(header.getName())) { > - addExcessHeader(header); > - } else { > - this.headers.put(header.getName(), header.getValue()); > - } > - } > - } > + Header[] headers = response.getAllHeaders(); > + if (headers != null) { > + for (Header header : headers) { > + if > (this.headers.containsKey(header.getName())) { > + addExcessHeader(header); > + } else { > + this.headers.put(header.getName(), > header.getValue()); > + } > + } > + } > > this.expectResponseBody = expectResponseBody; > } > > Modified: > synapse/trunk/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/util/PassThroughTransportUtils.java > URL: > http://svn.apache.org/viewvc/synapse/trunk/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/util/PassThroughTransportUtils.java?rev=1746052&r1=1746051&r2=1746052&view=diff > ============================================================================== > --- > synapse/trunk/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/util/PassThroughTransportUtils.java > (original) > +++ > synapse/trunk/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/util/PassThroughTransportUtils.java > Sun May 29 19:28:02 2016 > @@ -118,8 +118,7 @@ public class PassThroughTransportUtils { > boolean preserveServerHeader, > boolean > preserveUserAgentHeader) { > Map headers = (Map) > msgContext.getProperty(MessageContext.TRANSPORT_HEADERS); > - Map excessHeaders = (Map) > msgContext.getProperty(NhttpConstants.EXCESS_TRANSPORT_HEADERS); > - > + Map excessHeaders = (Map) > msgContext.getProperty(NhttpConstants.EXCESS_TRANSPORT_HEADERS); > > if (headers == null || headers.isEmpty()) { > return; > > Modified: > synapse/trunk/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/util/TargetRequestFactory.java > URL: > http://svn.apache.org/viewvc/synapse/trunk/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/util/TargetRequestFactory.java?rev=1746052&r1=1746051&r2=1746052&view=diff > ============================================================================== > --- > synapse/trunk/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/util/TargetRequestFactory.java > (original) > +++ > synapse/trunk/java/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/util/TargetRequestFactory.java > Sun May 29 19:28:02 2016 > @@ -129,17 +129,17 @@ public class TargetRequestFactory { > request.setFullUrl(true); > } > > - // Add excess respsonse header. > - String excessProp = NhttpConstants.EXCESS_TRANSPORT_HEADERS; > - Map excessHeaders = (Map) msgContext.getProperty(excessProp); > - if (excessHeaders != null) { > - for (Iterator iterator = > excessHeaders.keySet().iterator(); iterator.hasNext();) { > - String key = (String) iterator.next(); > - for (String excessVal : (Collection<String>) > excessHeaders.get(key)) { > - request.addHeader(key, (String) > excessVal); > - } > - } > - } > + // Add excess respsonse header. > + String excessProp = > NhttpConstants.EXCESS_TRANSPORT_HEADERS; > + Map excessHeaders = (Map) > msgContext.getProperty(excessProp); > + if (excessHeaders != null) { > + for (Iterator iterator = > excessHeaders.keySet().iterator(); iterator.hasNext();) { > + String key = (String) iterator.next(); > + for (String excessVal : > (Collection<String>) excessHeaders.get(key)) { > + request.addHeader(key, > (String) excessVal); > + } > + } > + } > > return request; > } catch (MalformedURLException e) { > > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@synapse.apache.org For additional commands, e-mail: dev-h...@synapse.apache.org