Author: markt
Date: Fri Jan 12 13:34:13 2018
New Revision: 1820981
URL: http://svn.apache.org/viewvc?rev=1820981&view=rev
Log:
Fix formatting. No functional change.
Modified:
tomcat/trunk/java/org/apache/tomcat/util/buf/ByteChunk.java
tomcat/trunk/java/org/apache/tomcat/util/buf/CharChunk.java
Modified: tomcat/trunk/java/org/apache/tomcat/util/buf/ByteChunk.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/buf/ByteChunk.java?rev=1820981&r1=1820980&r2=1820981&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/buf/ByteChunk.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/buf/ByteChunk.java Fri Jan 12
13:34:13 2018
@@ -546,38 +546,38 @@ public final class ByteChunk implements
/**
* Make space for len bytes. If len is small, allocate a reserve space too.
* Never grow bigger than limit.
- * @param count The size
+ *
+ * @param count
+ * The size
*/
public void makeSpace(int count) {
byte[] tmp = null;
int newSize;
- int desiredSize=end + count;
+ int desiredSize = end + count;
// Can't grow above the limit
- if( limit > 0 &&
- desiredSize > limit) {
- desiredSize=limit;
+ if (limit > 0 && desiredSize > limit) {
+ desiredSize = limit;
}
- if( buff==null ) {
- if( desiredSize < 256 )
- {
- desiredSize=256; // take a minimum
+ if (buff == null) {
+ if (desiredSize < 256) {
+ desiredSize = 256; // take a minimum
}
- buff=new byte[desiredSize];
+ buff = new byte[desiredSize];
}
// limit < buf.length ( the buffer is already big )
// or we already have space XXX
- if( desiredSize <= buff.length ) {
+ if (desiredSize <= buff.length) {
return;
}
// grow in larger chunks
- if( desiredSize < 2 * buff.length ) {
- newSize= buff.length * 2;
+ if (desiredSize < 2 * buff.length) {
+ newSize = buff.length * 2;
} else {
- newSize= buff.length * 2 + count ;
+ newSize = buff.length * 2 + count;
}
if (limit > 0 && newSize > limit) {
@@ -585,11 +585,11 @@ public final class ByteChunk implements
}
tmp = new byte[newSize];
- System.arraycopy(buff, start, tmp, 0, end-start);
+ System.arraycopy(buff, start, tmp, 0, end - start);
buff = tmp;
tmp = null;
- end=end-start;
- start=0;
+ end = end - start;
+ start = 0;
}
// -------------------- Conversion and getters --------------------
Modified: tomcat/trunk/java/org/apache/tomcat/util/buf/CharChunk.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/buf/CharChunk.java?rev=1820981&r1=1820980&r2=1820981&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/buf/CharChunk.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/buf/CharChunk.java Fri Jan 12
13:34:13 2018
@@ -415,41 +415,40 @@ public final class CharChunk implements
}
/**
- * Make space for len chars. If len is small, allocate
- * a reserve space too. Never grow bigger than limit.
- * @param count The size
+ * Make space for len chars. If len is small, allocate a reserve space too.
+ * Never grow bigger than limit.
+ *
+ * @param count
+ * The size
*/
- public void makeSpace(int count)
- {
+ public void makeSpace(int count) {
char[] tmp = null;
int newSize;
- int desiredSize=end + count;
+ int desiredSize = end + count;
// Can't grow above the limit
- if( limit > 0 &&
- desiredSize > limit) {
- desiredSize=limit;
+ if (limit > 0 && desiredSize > limit) {
+ desiredSize = limit;
}
- if( buff==null ) {
- if( desiredSize < 256 )
- {
- desiredSize=256; // take a minimum
+ if (buff == null) {
+ if (desiredSize < 256) {
+ desiredSize = 256; // take a minimum
}
- buff=new char[desiredSize];
+ buff = new char[desiredSize];
}
// limit < buf.length ( the buffer is already big )
// or we already have space XXX
- if( desiredSize <= buff.length) {
+ if (desiredSize <= buff.length) {
return;
}
// grow in larger chunks
- if( desiredSize < 2 * buff.length ) {
- newSize= buff.length * 2;
+ if (desiredSize < 2 * buff.length) {
+ newSize = buff.length * 2;
} else {
- newSize= buff.length * 2 + count ;
+ newSize = buff.length * 2 + count;
}
if (limit > 0 && newSize > limit) {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]