java.io.ObjectInputStream.GetField Java Examples

The following examples show how to use java.io.ObjectInputStream.GetField. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: URL.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * readObject is called to restore the state of the URL from the
 * stream.  It reads the components of the URL and finds the local
 * stream handler.
 */
private synchronized void readObject(java.io.ObjectInputStream s)
        throws IOException, ClassNotFoundException {
    GetField gf = s.readFields();
    String protocol = (String)gf.get("protocol", null);
    if (getURLStreamHandler(protocol) == null) {
        throw new IOException("unknown protocol: " + protocol);
    }
    String host = (String)gf.get("host", null);
    int port = gf.get("port", -1);
    String authority = (String)gf.get("authority", null);
    String file = (String)gf.get("file", null);
    String ref = (String)gf.get("ref", null);
    int hashCode = gf.get("hashCode", -1);
    if (authority == null
            && ((host != null && host.length() > 0) || port != -1)) {
        if (host == null)
            host = "";
        authority = (port == -1) ? host : host + ":" + port;
    }
    tempState = new UrlDeserializedState(protocol, host, port, authority,
           file, ref, hashCode);
}
 
Example #2
Source File: URL.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
/**
 * readObject is called to restore the state of the URL from the
 * stream.  It reads the components of the URL and finds the local
 * stream handler.
 */
@java.io.Serial
private synchronized void readObject(java.io.ObjectInputStream s)
        throws IOException, ClassNotFoundException {
    GetField gf = s.readFields();
    String protocol = (String)gf.get("protocol", null);
    if (getURLStreamHandler(protocol) == null) {
        throw new IOException("unknown protocol: " + protocol);
    }
    String host = (String)gf.get("host", null);
    int port = gf.get("port", -1);
    String authority = (String)gf.get("authority", null);
    String file = (String)gf.get("file", null);
    String ref = (String)gf.get("ref", null);
    int hashCode = gf.get("hashCode", -1);
    if (authority == null
            && ((host != null && !host.isEmpty()) || port != -1)) {
        if (host == null)
            host = "";
        authority = (port == -1) ? host : host + ":" + port;
    }
    tempState = new UrlDeserializedState(protocol, host, port, authority,
           file, ref, hashCode);
}
 
Example #3
Source File: Pair.java    From alfresco-core with GNU Lesser General Public License v3.0 6 votes vote down vote up
/**
 * Ensure that previously-serialized instances don't fail due to the member name change.
 */
@SuppressWarnings("unchecked")
private void readObject(ObjectInputStream is) throws ClassNotFoundException, IOException
{
    GetField fields = is.readFields();
    if (fields.defaulted("first"))
    {
        // This is a pre-V3.3
        this.first = (F) fields.get("fFirst", null);
        this.second = (S) fields.get("fSecond", null);
    }
    else
    {
        this.first = (F) fields.get("first", null);
        this.second = (S) fields.get("second", null);
    }
}
 
Example #4
Source File: InetAddress.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
@java.io.Serial
private void readObject (ObjectInputStream s) throws
                     IOException, ClassNotFoundException {
    if (getClass().getClassLoader() != null) {
        throw new SecurityException ("invalid address type");
    }
    GetField gf = s.readFields();
    String host = (String)gf.get("hostName", null);
    int address = gf.get("address", 0);
    int family = gf.get("family", 0);
    if (family != IPv4 && family != IPv6) {
        throw new InvalidObjectException("invalid address family type: " + family);
    }
    InetAddressHolder h = new InetAddressHolder(host, address, family);
    UNSAFE.putReference(this, FIELDS_OFFSET, h);
}
 
Example #5
Source File: URL.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * readObject is called to restore the state of the URL from the
 * stream.  It reads the components of the URL and finds the local
 * stream handler.
 */
private synchronized void readObject(java.io.ObjectInputStream s)
        throws IOException, ClassNotFoundException {
    GetField gf = s.readFields();
    String protocol = (String)gf.get("protocol", null);
    if (getURLStreamHandler(protocol) == null) {
        throw new IOException("unknown protocol: " + protocol);
    }
    String host = (String)gf.get("host", null);
    int port = gf.get("port", -1);
    String authority = (String)gf.get("authority", null);
    String file = (String)gf.get("file", null);
    String ref = (String)gf.get("ref", null);
    int hashCode = gf.get("hashCode", -1);
    if (authority == null
            && ((host != null && host.length() > 0) || port != -1)) {
        if (host == null)
            host = "";
        authority = (port == -1) ? host : host + ":" + port;
    }
    tempState = new UrlDeserializedState(protocol, host, port, authority,
           file, ref, hashCode);
}
 
Example #6
Source File: URL.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * readObject is called to restore the state of the URL from the
 * stream.  It reads the components of the URL and finds the local
 * stream handler.
 */
private synchronized void readObject(java.io.ObjectInputStream s)
        throws IOException, ClassNotFoundException {
    GetField gf = s.readFields();
    String protocol = (String)gf.get("protocol", null);
    if (getURLStreamHandler(protocol) == null) {
        throw new IOException("unknown protocol: " + protocol);
    }
    String host = (String)gf.get("host", null);
    int port = gf.get("port", -1);
    String authority = (String)gf.get("authority", null);
    String file = (String)gf.get("file", null);
    String ref = (String)gf.get("ref", null);
    int hashCode = gf.get("hashCode", -1);
    if (authority == null
            && ((host != null && host.length() > 0) || port != -1)) {
        if (host == null)
            host = "";
        authority = (port == -1) ? host : host + ":" + port;
    }
    tempState = new UrlDeserializedState(protocol, host, port, authority,
           file, ref, hashCode);
}
 
Example #7
Source File: URL.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * readObject is called to restore the state of the URL from the
 * stream.  It reads the components of the URL and finds the local
 * stream handler.
 */
private synchronized void readObject(java.io.ObjectInputStream s)
        throws IOException, ClassNotFoundException {
    GetField gf = s.readFields();
    String protocol = (String)gf.get("protocol", null);
    if (getURLStreamHandler(protocol) == null) {
        throw new IOException("unknown protocol: " + protocol);
    }
    String host = (String)gf.get("host", null);
    int port = gf.get("port", -1);
    String authority = (String)gf.get("authority", null);
    String file = (String)gf.get("file", null);
    String ref = (String)gf.get("ref", null);
    int hashCode = gf.get("hashCode", -1);
    if (authority == null
            && ((host != null && host.length() > 0) || port != -1)) {
        if (host == null)
            host = "";
        authority = (port == -1) ? host : host + ":" + port;
    }
    tempState = new UrlDeserializedState(protocol, host, port, authority,
           file, ref, hashCode);
}
 
Example #8
Source File: URL.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * readObject is called to restore the state of the URL from the
 * stream.  It reads the components of the URL and finds the local
 * stream handler.
 */
private synchronized void readObject(java.io.ObjectInputStream s)
        throws IOException, ClassNotFoundException {
    GetField gf = s.readFields();
    String protocol = (String)gf.get("protocol", null);
    if (getURLStreamHandler(protocol) == null) {
        throw new IOException("unknown protocol: " + protocol);
    }
    String host = (String)gf.get("host", null);
    int port = gf.get("port", -1);
    String authority = (String)gf.get("authority", null);
    String file = (String)gf.get("file", null);
    String ref = (String)gf.get("ref", null);
    int hashCode = gf.get("hashCode", -1);
    if (authority == null
            && ((host != null && host.length() > 0) || port != -1)) {
        if (host == null)
            host = "";
        authority = (port == -1) ? host : host + ":" + port;
    }
    tempState = new UrlDeserializedState(protocol, host, port, authority,
           file, ref, hashCode);
}
 
Example #9
Source File: URL.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
/**
 * readObject is called to restore the state of the URL from the
 * stream.  It reads the components of the URL and finds the local
 * stream handler.
 */
private synchronized void readObject(java.io.ObjectInputStream s)
        throws IOException, ClassNotFoundException {
    GetField gf = s.readFields();
    String protocol = (String)gf.get("protocol", null);
    if (getURLStreamHandler(protocol) == null) {
        throw new IOException("unknown protocol: " + protocol);
    }
    String host = (String)gf.get("host", null);
    int port = gf.get("port", -1);
    String authority = (String)gf.get("authority", null);
    String file = (String)gf.get("file", null);
    String ref = (String)gf.get("ref", null);
    int hashCode = gf.get("hashCode", -1);
    if (authority == null
            && ((host != null && host.length() > 0) || port != -1)) {
        if (host == null)
            host = "";
        authority = (port == -1) ? host : host + ":" + port;
    }
    tempState = new UrlDeserializedState(protocol, host, port, authority,
           file, ref, hashCode);
}
 
Example #10
Source File: URL.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
/**
 * readObject is called to restore the state of the URL from the
 * stream.  It reads the components of the URL and finds the local
 * stream handler.
 */
private synchronized void readObject(java.io.ObjectInputStream s)
        throws IOException, ClassNotFoundException {
    GetField gf = s.readFields();
    String protocol = (String)gf.get("protocol", null);
    if (getURLStreamHandler(protocol) == null) {
        throw new IOException("unknown protocol: " + protocol);
    }
    String host = (String)gf.get("host", null);
    int port = gf.get("port", -1);
    String authority = (String)gf.get("authority", null);
    String file = (String)gf.get("file", null);
    String ref = (String)gf.get("ref", null);
    int hashCode = gf.get("hashCode", -1);
    if (authority == null
            && ((host != null && host.length() > 0) || port != -1)) {
        if (host == null)
            host = "";
        authority = (port == -1) ? host : host + ":" + port;
    }
    tempState = new UrlDeserializedState(protocol, host, port, authority,
           file, ref, hashCode);
}
 
Example #11
Source File: BarcodeComponent.java    From jasperreports with GNU Lesser General Public License v3.0 6 votes vote down vote up
@SuppressWarnings("deprecation")
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
{
	GetField fields = in.readFields();
	this.PSEUDO_SERIAL_VERSION_UID = fields.get("PSEUDO_SERIAL_VERSION_UID", 0);
	if (PSEUDO_SERIAL_VERSION_UID < JRConstants.PSEUDO_SERIAL_VERSION_UID_3_7_2)
	{
		byte evaluationTime = fields.get("evaluationTime", (byte) 0);
		this.evaluationTimeValue = EvaluationTimeEnum.getByValue(evaluationTime);
	}
	else
	{
		this.evaluationTimeValue = (EvaluationTimeEnum) fields.get("evaluationTimeValue", null);
	}
	this.evaluationGroup = (String) fields.get("evaluationGroup", null);
	this.codeExpression = (JRExpression) fields.get("codeExpression", null);
	
	if (PSEUDO_SERIAL_VERSION_UID < JRConstants.PSEUDO_SERIAL_VERSION_UID_6_0_2
			&& this instanceof Barcode4jComponent)
	{
		//up to 6.0.0 this class had several fields that were moved to Barcode4jComponent in 6.0.2.
		//copying the values to the Barcode4jComponent fields.
		Barcode4jComponent barcode4jComponent = (Barcode4jComponent) this;
		barcode4jComponent.copyBarcodeComponentFields(fields);
	}
}
 
Example #12
Source File: JRVirtualizationContext.java    From jasperreports with GNU Lesser General Public License v3.0 6 votes vote down vote up
@SuppressWarnings("unchecked")
private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException
{
	setThreadJasperReportsContext();

	GetField fields = in.readFields();
	cachedRenderers = (Map<String, Renderable>) fields.get("cachedRenderers", null);
	cachedTemplates = (Map<String, JRTemplateElement>) fields.get("cachedTemplates", null);
	virtualizableLists = (Map<PrintElementId, VirtualizableElementList>) fields.get("virtualizableLists", null);
	readOnly = fields.get("readOnly", false);
	// use configured default if serialized by old version
	pageElementSize = fields.get("pageElementSize", JRPropertiesUtil.getInstance(jasperReportsContext).getIntegerProperty(
			JRVirtualPrintPage.PROPERTY_VIRTUAL_PAGE_ELEMENT_SIZE, 0));
	
	setThreadVirtualizer();
	
	initLock();
}
 
Example #13
Source File: URL.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * readObject is called to restore the state of the URL from the
 * stream.  It reads the components of the URL and finds the local
 * stream handler.
 */
private synchronized void readObject(java.io.ObjectInputStream s)
        throws IOException, ClassNotFoundException {
    GetField gf = s.readFields();
    String protocol = (String)gf.get("protocol", null);
    if (getURLStreamHandler(protocol) == null) {
        throw new IOException("unknown protocol: " + protocol);
    }
    String host = (String)gf.get("host", null);
    int port = gf.get("port", -1);
    String authority = (String)gf.get("authority", null);
    String file = (String)gf.get("file", null);
    String ref = (String)gf.get("ref", null);
    int hashCode = gf.get("hashCode", -1);
    if (authority == null
            && ((host != null && host.length() > 0) || port != -1)) {
        if (host == null)
            host = "";
        authority = (port == -1) ? host : host + ":" + port;
    }
    tempState = new UrlDeserializedState(protocol, host, port, authority,
           file, ref, hashCode);
}
 
Example #14
Source File: URL.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * readObject is called to restore the state of the URL from the
 * stream.  It reads the components of the URL and finds the local
 * stream handler.
 */
private synchronized void readObject(java.io.ObjectInputStream s)
        throws IOException, ClassNotFoundException {
    GetField gf = s.readFields();
    String protocol = (String)gf.get("protocol", null);
    if (getURLStreamHandler(protocol) == null) {
        throw new IOException("unknown protocol: " + protocol);
    }
    String host = (String)gf.get("host", null);
    int port = gf.get("port", -1);
    String authority = (String)gf.get("authority", null);
    String file = (String)gf.get("file", null);
    String ref = (String)gf.get("ref", null);
    int hashCode = gf.get("hashCode", -1);
    if (authority == null
            && ((host != null && host.length() > 0) || port != -1)) {
        if (host == null)
            host = "";
        authority = (port == -1) ? host : host + ":" + port;
    }
    tempState = new UrlDeserializedState(protocol, host, port, authority,
           file, ref, hashCode);
}
 
Example #15
Source File: BaseReturnValue.java    From jasperreports with GNU Lesser General Public License v3.0 6 votes vote down vote up
private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException
{
	GetField fields = stream.readFields();
	fromVariable = (String) fields.get("fromVariable", null);
	
	// the fields of BaseCommonReturnValue were originally in this class.
	// if deserializing an old object, we need to manually copy the values into the parent class.
	ObjectStreamClass streamClass = fields.getObjectStreamClass();
	if (streamClass.getField("toVariable") != null)
	{
		this.toVariable = (String) fields.get("toVariable", null);
	}
	if (streamClass.getField("calculation") != null)
	{
		this.calculation = (CalculationEnum) fields.get("calculation", null);
	}
	if (streamClass.getField("incrementerFactoryClassName") != null)
	{
		this.incrementerFactoryClassName = (String) fields.get("incrementerFactoryClassName", null);
	}
}
 
Example #16
Source File: URL.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * readObject is called to restore the state of the URL from the
 * stream.  It reads the components of the URL and finds the local
 * stream handler.
 */
private synchronized void readObject(java.io.ObjectInputStream s)
        throws IOException, ClassNotFoundException {
    GetField gf = s.readFields();
    String protocol = (String)gf.get("protocol", null);
    if (getURLStreamHandler(protocol) == null) {
        throw new IOException("unknown protocol: " + protocol);
    }
    String host = (String)gf.get("host", null);
    int port = gf.get("port", -1);
    String authority = (String)gf.get("authority", null);
    String file = (String)gf.get("file", null);
    String ref = (String)gf.get("ref", null);
    int hashCode = gf.get("hashCode", -1);
    if (authority == null
            && ((host != null && host.length() > 0) || port != -1)) {
        if (host == null)
            host = "";
        authority = (port == -1) ? host : host + ":" + port;
    }
    tempState = new UrlDeserializedState(protocol, host, port, authority,
           file, ref, hashCode);
}
 
Example #17
Source File: DesignCell.java    From jasperreports with GNU Lesser General Public License v3.0 5 votes vote down vote up
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
{
	GetField fields = in.readFields();
	rowSpan = (Integer) fields.get("rowSpan", null);
	
	//DesignBaseCell fields were originally (until 6.11) in this class
	//read the values from the stream object if present and set them in the parent
	ObjectStreamClass streamClass = fields.getObjectStreamClass();
	if (streamClass.getField("defaultStyleProvider") != null)
	{
		defaultStyleProvider = (JRDefaultStyleProvider) fields.get("defaultStyleProvider", null);
	}
	if (streamClass.getField("style") != null)
	{
		style = (JRStyle) fields.get("style", null);
	}
	if (streamClass.getField("styleNameReference") != null)
	{
		styleNameReference = (String) fields.get("styleNameReference", null);
	}
	if (streamClass.getField("box") != null)
	{
		box = (JRLineBox) fields.get("box", null);
	}
	if (streamClass.getField("height") != null)
	{
		height = (Integer) fields.get("height", null);
	}
	if (streamClass.getField("propertiesMap") != null)
	{
		propertiesMap = (JRPropertiesMap) fields.get("propertiesMap", null);
	}
}
 
Example #18
Source File: CryptoPermissions.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private void readObject(ObjectInputStream s)
    throws IOException, ClassNotFoundException {
    ObjectInputStream.GetField fields = s.readFields();
    @SuppressWarnings("unchecked")
    Hashtable<String,PermissionCollection> permTable =
            (Hashtable<String,PermissionCollection>)
            (fields.get("perms", null));
    if (permTable != null) {
        perms = new ConcurrentHashMap<>(permTable);
    } else {
        perms = new ConcurrentHashMap<>();
    }
}
 
Example #19
Source File: Barcode4jComponent.java    From jasperreports with GNU Lesser General Public License v3.0 5 votes vote down vote up
protected final void copyBarcodeComponentFields(GetField fields) throws IOException
{
	int orientation = fields.get("orientation", 0);
	this.orientationValue = OrientationEnum.getByValue(orientation);
	this.patternExpression = (JRExpression) fields.get("patternExpression", null);
	this.moduleWidth = (Double) fields.get("moduleWidth", null);
	String textPosition = (String) fields.get("textPosition", null);
	this.textPositionValue = TextPositionEnum.getByName(textPosition);
	this.quietZone = (Double) fields.get("quietZone", null);
	this.verticalQuietZone = (Double) fields.get("verticalQuietZone", null);
}
 
Example #20
Source File: InetAddress.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
private void readObject (ObjectInputStream s) throws
                     IOException, ClassNotFoundException {
    if (getClass().getClassLoader() != null) {
        throw new SecurityException ("invalid address type");
    }
    GetField gf = s.readFields();
    String host = (String)gf.get("hostName", null);
    int address= gf.get("address", 0);
    int family= gf.get("family", 0);
    InetAddressHolder h = new InetAddressHolder(host, address, family);
    UNSAFE.putObject(this, FIELDS_OFFSET, h);
}
 
Example #21
Source File: CompiledCell.java    From jasperreports with GNU Lesser General Public License v3.0 5 votes vote down vote up
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
{
	GetField fields = in.readFields();
	rowSpan = (Integer) fields.get("rowSpan", null);
	
	//CompiledBaseCell fields were originally (until 6.11) in this class
	//read the values from the stream object if present and set them in the parent
	ObjectStreamClass streamClass = fields.getObjectStreamClass();
	if (streamClass.getField("defaultStyleProvider") != null)
	{
		defaultStyleProvider = (JRDefaultStyleProvider) fields.get("defaultStyleProvider", null);
	}
	if (streamClass.getField("style") != null)
	{
		style = (JRStyle) fields.get("style", null);
	}
	if (streamClass.getField("styleNameReference") != null)
	{
		styleNameReference = (String) fields.get("styleNameReference", null);
	}
	if (streamClass.getField("box") != null)
	{
		box = (JRLineBox) fields.get("box", null);
	}
	if (streamClass.getField("height") != null)
	{
		height = (Integer) fields.get("height", null);
	}
	if (streamClass.getField("propertiesMap") != null)
	{
		propertiesMap = (JRPropertiesMap) fields.get("propertiesMap", null);
	}
}
 
Example #22
Source File: InetAddress.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private void readObject (ObjectInputStream s) throws
                     IOException, ClassNotFoundException {
    if (getClass().getClassLoader() != null) {
        throw new SecurityException ("invalid address type");
    }
    GetField gf = s.readFields();
    String host = (String)gf.get("hostName", null);
    int address= gf.get("address", 0);
    int family= gf.get("family", 0);
    InetAddressHolder h = new InetAddressHolder(host, address, family);
    UNSAFE.putObject(this, FIELDS_OFFSET, h);
}
 
Example #23
Source File: CryptoPermissions.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private void readObject(ObjectInputStream s)
    throws IOException, ClassNotFoundException {
    ObjectInputStream.GetField fields = s.readFields();
    @SuppressWarnings("unchecked")
    Hashtable<String,PermissionCollection> permTable =
            (Hashtable<String,PermissionCollection>)
            (fields.get("perms", null));
    if (permTable != null) {
        perms = new ConcurrentHashMap<>(permTable);
    } else {
        perms = new ConcurrentHashMap<>();
    }
}
 
Example #24
Source File: InetAddress.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
private void readObject (ObjectInputStream s) throws
                     IOException, ClassNotFoundException {
    if (getClass().getClassLoader() != null) {
        throw new SecurityException ("invalid address type");
    }
    GetField gf = s.readFields();
    String host = (String)gf.get("hostName", null);
    int address = gf.get("address", 0);
    int family = gf.get("family", 0);
    if (family != IPv4 && family != IPv6) {
        throw new InvalidObjectException("invalid address family type: " + family);
    }
    InetAddressHolder h = new InetAddressHolder(host, address, family);
    UNSAFE.putObject(this, FIELDS_OFFSET, h);
}
 
Example #25
Source File: CryptoPermissions.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
private void readObject(ObjectInputStream s)
    throws IOException, ClassNotFoundException {
    ObjectInputStream.GetField fields = s.readFields();
    @SuppressWarnings("unchecked")
    Hashtable<String,PermissionCollection> permTable =
            (Hashtable<String,PermissionCollection>)
            (fields.get("perms", null));
    if (permTable != null) {
        perms = new ConcurrentHashMap<>(permTable);
    } else {
        perms = new ConcurrentHashMap<>();
    }
}
 
Example #26
Source File: TreeMap.java    From jtransc with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings("unchecked") // we have to trust that keys are Ks and values are Vs
private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException {
    GetField fields = stream.readFields();
    comparator = (Comparator<? super K>) fields.get("comparator", null);
    if (comparator == null) {
        comparator = (Comparator<? super K>) NATURAL_ORDER;
    }
    int size = stream.readInt();
    for (int i = 0; i < size; i++) {
        putInternal((K) stream.readObject(), (V) stream.readObject());
    }
}
 
Example #27
Source File: InetAddress.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
private void readObject (ObjectInputStream s) throws
                     IOException, ClassNotFoundException {
    if (getClass().getClassLoader() != null) {
        throw new SecurityException ("invalid address type");
    }
    GetField gf = s.readFields();
    String host = (String)gf.get("hostName", null);
    int address= gf.get("address", 0);
    int family= gf.get("family", 0);
    InetAddressHolder h = new InetAddressHolder(host, address, family);
    UNSAFE.putObject(this, FIELDS_OFFSET, h);
}
 
Example #28
Source File: CryptoPermissions.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
private void readObject(ObjectInputStream s)
    throws IOException, ClassNotFoundException {
    ObjectInputStream.GetField fields = s.readFields();
    @SuppressWarnings("unchecked")
    Hashtable<String,PermissionCollection> permTable =
            (Hashtable<String,PermissionCollection>)
            (fields.get("perms", null));
    if (permTable != null) {
        perms = new ConcurrentHashMap<>(permTable);
    } else {
        perms = new ConcurrentHashMap<>();
    }
}
 
Example #29
Source File: InetAddress.java    From jdk-1.7-annotated with Apache License 2.0 5 votes vote down vote up
private void readObject (ObjectInputStream s) throws
                     IOException, ClassNotFoundException {
    if (getClass().getClassLoader() != null) {
        throw new SecurityException ("invalid address type");
    }
    GetField gf = s.readFields();
    String host = (String)gf.get("hostName", null);
    int address= gf.get("address", 0);
    int family= gf.get("family", 0);
    InetAddressHolder h = new InetAddressHolder(host, address, family);
    UNSAFE.putObject(this, FIELDS_OFFSET, h);
}
 
Example #30
Source File: InetAddress.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
private void readObject (ObjectInputStream s) throws
                     IOException, ClassNotFoundException {
    if (getClass().getClassLoader() != null) {
        throw new SecurityException ("invalid address type");
    }
    GetField gf = s.readFields();
    String host = (String)gf.get("hostName", null);
    int address= gf.get("address", 0);
    int family= gf.get("family", 0);
    InetAddressHolder h = new InetAddressHolder(host, address, family);
    UNSAFE.putObject(this, FIELDS_OFFSET, h);
}