Author: elecharny Date: Fri Feb 27 13:45:31 2009 New Revision: 748525 URL: http://svn.apache.org/viewvc?rev=748525&view=rev Log: Removed the EMPTY_* objects are they aren't immutable. That will fix DIRMINA-664
Modified: mina/trunk/core/src/main/java/org/apache/mina/core/buffer/IoBuffer.java Modified: mina/trunk/core/src/main/java/org/apache/mina/core/buffer/IoBuffer.java URL: http://svn.apache.org/viewvc/mina/trunk/core/src/main/java/org/apache/mina/core/buffer/IoBuffer.java?rev=748525&r1=748524&r2=748525&view=diff ============================================================================== --- mina/trunk/core/src/main/java/org/apache/mina/core/buffer/IoBuffer.java (original) +++ mina/trunk/core/src/main/java/org/apache/mina/core/buffer/IoBuffer.java Fri Feb 27 13:45:31 2009 @@ -148,20 +148,9 @@ /** The allocator used to create new buffers */ private static IoBufferAllocator allocator = new SimpleBufferAllocator(); - /** An immutable allocated empty direct buffer */ - private static final IoBuffer EMPTY_DIRECT_BUFFER = allocator.allocate(0, - true); - - /** An immutable allocated empty heap buffer */ - private static final IoBuffer EMPTY_HEAP_BUFFER = allocator.allocate(0, - false); - /** A flag indicating which type of buffer we are using : heap or direct */ private static boolean useDirectBuffer = false; - /** An immutable empty buffer. */ - public static final IoBuffer EMPTY_BUFFER = wrap(new byte[0]); - /** * Returns the allocator used by existing and new buffers */ @@ -224,10 +213,6 @@ * <tt>false</tt> to get a heap buffer. */ public static IoBuffer allocate(int capacity, boolean direct) { - if (capacity == 0) { - return direct ? EMPTY_DIRECT_BUFFER : EMPTY_HEAP_BUFFER; - } - if (capacity < 0) { throw new IllegalArgumentException("capacity: " + capacity); }