private Object readResolve ( ) throws ObjectStreamException { Constructor < ? > compatible = null ; for ( final Constructor < ? > candidate : this . proxyType . getDeclaredConstructors ( ) ) { if ( candidate != null && isCompatible ( candidate ) ) { if ( compatible != null ) { throw new IllegalStateException ( ) ; } compatible = candidate ; } } if ( compatible != null ) { if ( ! compatible . isAccessible ( ) ) { compatible . setAccessible ( true ) ; } try { final Object [ ] arguments = new Object [ this . values . length + 1 ] ; System . arraycopy ( this . values , 0 , arguments , 1 , this . values . length ) ; return compatible . newInstance ( arguments ) ; } catch ( Exception exception ) { throw new WriteAbortedException ( exception . getLocalizedMessage ( ) , exception ) ; } } throw new InvalidClassException ( "compatible constructor not found" ) ; //$NON-NLS-1$ }
This function enables to deserialize an instance of this proxy .