--- old/src/share/classes/com/sun/corba/se/impl/encoding/CDROutputStream_1_0.java Mon Nov 7 11:19:58 2011 +++ new/src/share/classes/com/sun/corba/se/impl/encoding/CDROutputStream_1_0.java Mon Nov 7 11:19:58 2011 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2004, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -1902,7 +1902,6 @@ if (getByteBufferWithInfo() != null && getByteBuffer() != null) { - int bbHash = System.identityHashCode(bbwi.byteBuffer); MessageMediator messageMediator = parent.getMessageMediator(); if (messageMediator != null) { @@ -1910,19 +1909,12 @@ (CDRInputObject)messageMediator.getInputObject(); if (inputObj != null) { - ByteBuffer inputBb = inputObj.getByteBuffer(); - - int iBbHash = 0; - if (inputBb != null) + if (inputObj.isSharing(getByteBuffer())) { - iBbHash = System.identityHashCode(inputBb); - if (bbHash == iBbHash) // shared? - { - // Set InputStream's ByteBuffer and bbwi to null - // so its ByteBuffer cannot be released to the pool - inputObj.setByteBuffer(null); - inputObj.setByteBufferWithInfo(null); - } + // Set InputStream's ByteBuffer and bbwi to null + // so its ByteBuffer cannot be released to the pool + inputObj.setByteBuffer(null); + inputObj.setByteBufferWithInfo(null); } } }