src/share/classes/com/sun/corba/se/impl/encoding/CDRInputStream_1_0.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 1997, 2004, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 2410,2442 ****
// If they sharing the same ByteBuffer we need to ensure only
// one of those ByteBuffers are released to the ByteBufferPool.
if (bbwi != null && getByteBuffer() != null)
{
- int bbHash = System.identityHashCode(bbwi.byteBuffer);
MessageMediator messageMediator = parent.getMessageMediator();
if (messageMediator != null)
{
CDROutputObject outputObj =
(CDROutputObject)messageMediator.getOutputObject();
if (outputObj != null)
{
! ByteBuffer outputBb = outputObj.getByteBuffer();
!
! int oBbHash = 0;
! if (outputBb != null)
{
- oBbHash = System.identityHashCode(outputBb);
- if (bbHash == oBbHash) // shared?
- {
// Set OutputStream's ByteBuffer and bbwi to null
// so its ByteBuffer cannot be released to the pool
outputObj.setByteBuffer(null);
outputObj.setByteBufferWithInfo(null);
}
}
- }
}
// release this stream's ByteBuffer to the pool
ByteBufferPool byteBufferPool = orb.getByteBufferPool();
if (debug)
--- 2410,2434 ----
// If they sharing the same ByteBuffer we need to ensure only
// one of those ByteBuffers are released to the ByteBufferPool.
if (bbwi != null && getByteBuffer() != null)
{
MessageMediator messageMediator = parent.getMessageMediator();
if (messageMediator != null)
{
CDROutputObject outputObj =
(CDROutputObject)messageMediator.getOutputObject();
if (outputObj != null)
{
! if (outputObj.isSharing(getByteBuffer()))
{
// Set OutputStream's ByteBuffer and bbwi to null
// so its ByteBuffer cannot be released to the pool
outputObj.setByteBuffer(null);
outputObj.setByteBufferWithInfo(null);
}
}
}
// release this stream's ByteBuffer to the pool
ByteBufferPool byteBufferPool = orb.getByteBufferPool();
if (debug)