Committing the patch in XALANJ-2321, which was reviewed/approved
by Yash Talwar.
diff --git a/src/org/apache/xalan/templates/AVT.java b/src/org/apache/xalan/templates/AVT.java
index 803dedd..16bc2ef 100644
--- a/src/org/apache/xalan/templates/AVT.java
+++ b/src/org/apache/xalan/templates/AVT.java
@@ -55,11 +55,6 @@
private final static int INIT_BUFFER_CHUNK_BITS = 8;
/**
- * We are caching FastStringBuffer objects if if USE_OBJECT_POOL == false
- */
- private transient FastStringBuffer m_cachedBuf;
-
- /**
* If the AVT is not complex, just hold the simple string.
* @serial
*/
@@ -611,14 +606,9 @@
private final FastStringBuffer getBuffer(){
if(USE_OBJECT_POOL){
- return StringBufferPool.get();
- }else if(m_cachedBuf == null){
- m_cachedBuf = new FastStringBuffer(INIT_BUFFER_CHUNK_BITS);
- return m_cachedBuf;
- }else if(m_cachedBuf.length() != 0){
- return new FastStringBuffer(INIT_BUFFER_CHUNK_BITS);
+ return StringBufferPool.get();
}else{
- return m_cachedBuf;
- }
+ return new FastStringBuffer(INIT_BUFFER_CHUNK_BITS);
+ }
}
}