corba/src/share/classes/com/sun/corba/se/impl/encoding/CDRInputStream_1_0.java

Print this page
rev 502 : 8000631: Restrict access to class constructor
Reviewed-by: alanb, ahgross

*** 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 --- 1,7 ---- /* ! * Copyright (c) 1997, 2012, 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
*** 267,278 **** createRepositoryIdHandlers(); } private final void createRepositoryIdHandlers() { ! repIdUtil = RepositoryIdFactory.getRepIdUtility(orb); ! repIdStrs = RepositoryIdFactory.getRepIdStringsFactory(orb); } public GIOPVersion getGIOPVersion() { return GIOPVersion.V1_0; } --- 267,278 ---- createRepositoryIdHandlers(); } private final void createRepositoryIdHandlers() { ! repIdUtil = RepositoryIdFactory.getRepIdUtility(); ! repIdStrs = RepositoryIdFactory.getRepIdStringsFactory(); } public GIOPVersion getGIOPVersion() { return GIOPVersion.V1_0; }
*** 562,574 **** stringIndirection = get_offset() - 4; } checkForNegativeLength(len); - if (orb != null && ORBUtility.isLegacyORB((ORB)orb)) - return legacyReadString(len); - else return internalReadString(len); } private final String internalReadString(int len) { // Workaround for ORBs which send string lengths of --- 562,571 ----
*** 586,643 **** read_octet(); return new String(result, 0, getCharConverter().getNumChars()); } - private final String legacyReadString(int len) { - - // - // Workaround for ORBs which send string lengths of - // zero to mean empty string. - // - // - // IMPORTANT: Do not replace 'new String("")' with "", it may result - // in a Serialization bug (See serialization.zerolengthstring) and - // bug id: 4728756 for details - if (len == 0) - return new String(""); - - len--; - char[] c = new char[len]; - - int n = 0; - while (n < len) { - int avail; - int bytes; - int wanted; - - avail = bbwi.buflen - bbwi.position(); - if (avail <= 0) { - grow(1, 1); - avail = bbwi.buflen - bbwi.position(); - } - wanted = len - n; - bytes = (wanted < avail) ? wanted : avail; - // Microbenchmarks are showing a loop of ByteBuffer.get(int) being - // faster than ByteBuffer.get(byte[], int, int). - for (int i=0; i<bytes; i++) { - c[n+i] = (char) (bbwi.byteBuffer.get(bbwi.position()+i) & 0xFF); - } - bbwi.position(bbwi.position() + bytes); - n += bytes; - } - - // - // Skip past terminating null byte - // - if (bbwi.position() + 1 > bbwi.buflen) - alignAndCheck(1, 1); - bbwi.position(bbwi.position() + 1); - - return new String(c); - } - public final String read_string() { return readStringOrIndirection(false); } public String read_wstring() { --- 583,592 ----
*** 1043,1053 **** // Must be some form of RMI-IIOP valuetype try { if (valueHandler == null) ! valueHandler = ORBUtility.createValueHandler(orb); value = valueHandler.readValue(parent, indirection, valueClass, repositoryIDString, --- 992,1002 ---- // Must be some form of RMI-IIOP valuetype try { if (valueHandler == null) ! valueHandler = ORBUtility.createValueHandler(); value = valueHandler.readValue(parent, indirection, valueClass, repositoryIDString,