Java 8 InvalidObjectException - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 InvalidObjectException class.

This code example shows how to use the following methods: initCause
	s.defaultReadObject();
	// check invariants 
	try { 
	    validate(); 
	} catch (Exception e) {
	    InvalidObjectException x = new InvalidObjectException(
		    e.getMessage());
	    x.initCause(e);
	    throw x;
	} 
    } 
 
    /** 
     * Gets a string representation of this option useful for logging 
     * and not intended for display.  The exact details of the 
     * representation are unspecified and subject to change, but the 
     * following format may be regarded as typical: 
     * <pre><code> 
     * class-name[property1 = value1, property2 = value2] 
     * </code></pre> 
Full Snippet Info
6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: initCause
        { 
            return SerializationSupport.readResolve(serviceId);
        } 
        catch (Exception ex)
        { 
            ObjectStreamException ose = new InvalidObjectException(ex.getMessage());
            ose.initCause(ex);
 
            throw ose;
        } 
    } 
 
} 
Full Snippet Info
5
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods:
    } 
 
    // have a readObject that throws to prevent spoofing 
    private void readObject(ObjectInputStream stream) throws InvalidObjectException {
        throw new InvalidObjectException("Cannot readObject, serialization proxy required");
    } 
 
 
    private static Date getBundleLongAsDate(Bundle bundle, String key, Date dateBase) {
        if (bundle == null) {
            return null; 
        } 
 
        long secondsFromBase = Long.MIN_VALUE;
 
        Object secondsObject = bundle.get(key);
        if (secondsObject instanceof Long) {
            secondsFromBase = (Long) secondsObject;
        } else if (secondsObject instanceof String) {
            try { 
Full Snippet Info
5
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: initCause
    protected final void writeState(ObjectOutputStream out) throws IOException {
        int pageSize;
        try { 
            pageSize = pageSizeField.getInt(this);
        } catch (IllegalAccessException e) {
            InvalidObjectException ioe = new InvalidObjectException("Cannot set page size");
            ioe.initCause(e);
            throw ioe;
        } 
 
        // 
        out.writeInt(pageSize);
        out.writeInt(currentPage_);
    } 
 
    protected final void readState(ObjectInputStream in) throws IOException {
        try { 
            pageSizeField.setInt(this, in.readInt());
        } catch (IllegalAccessException e) {
            InvalidObjectException ioe = new InvalidObjectException("Cannot set page size");
Full Snippet Info
5
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods:
 
		ObjectInputStream.GetField fields = stream.readFields(); 
		Expression[] expressionArray = (Expression[]) fields.get("values", null); 
 
		if (expressionArray == null) { 
			throw new InvalidObjectException("Cannot create a ListLiteral with a null value list"); 
		} 
		values = new ArrayList(Arrays.asList(expressionArray)); 
	} 
 
	/** 
	 * Returns a string representation of the object. 
	 *  
	 * @return a <code>String</code> representation of this expression 
	 */ 
	public String toString() { 
		return values.toString(); 
	} 
 
	/** 
Full Snippet Info
4
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE