Examples of initCause()


Examples of java.nio.charset.CharacterCodingException.initCause()

            charSet = Charset.defaultCharset();
        } else if (Charset.isSupported(charset)) {
            charSet = Charset.forName(charset);
        } else {
            CharacterCodingException e = new CharacterCodingException();
            e.initCause(new UnsupportedCharsetException(charset));
            throw e;
        }

        CharsetDecoder decoder = charSet.newDecoder();
        CharBuffer charBuffer = null;
View Full Code Here

Examples of java.nio.charset.UnsupportedCharsetException.initCause()

        try {
            return new String(fieldBuffer, 0, fieldLength, encoding);
        }
        catch (UnsupportedEncodingException ex) {
            UnsupportedCharsetException nex = new UnsupportedCharsetException(encoding);
            nex.initCause(ex);
            throw nex;
        }
    }

    protected String decode(byte[] bytes) {
View Full Code Here

Examples of java.rmi.NoSuchObjectException.initCause()

    private NoSuchObjectException throwNewNoSuchObjectException(
      String msg, Throwable t, Logger logger)
  throws NoSuchObjectException
    {
  final NoSuchObjectException nsoe = new NoSuchObjectException(msg);
  nsoe.initCause(t);
  logger.log(Levels.FAILED, msg, nsoe);
  throw nsoe;
    }
}
View Full Code Here

Examples of java.rmi.RemoteException.initCause()

                    ObjectCopier copier = cm.getDefaultObjectCopierFactory().make() ;
                    return copier.copy( obj ) ;
                }
            } catch (ReflectiveCopyException exc) {
                RemoteException rexc = new RemoteException() ;
                rexc.initCause( exc ) ;
                throw rexc ;
            }
        } else {
            org.omg.CORBA_2_3.portable.OutputStream out =
                (org.omg.CORBA_2_3.portable.OutputStream)orb.create_output_stream();
View Full Code Here

Examples of java.rmi.UnexpectedException.initCause()

        String excName = ae.getId() ;
        int index = findDeclaredException( excName ) ;
        if (index < 0) {
            excName = is.read_string() ;
            Exception res = new UnexpectedException( excName ) ;
            res.initCause( ae ) ;
            return res ;
        }

        return rws[index].read( is ) ;
    }
View Full Code Here

Examples of java.rmi.activation.ActivationException.initCause()

        ActivationException e = new ActivationException("fixture", npe);
        assertTrue(e.getMessage().contains("fixture"));
        assertSame(npe, e.getCause());
        assertSame(npe, e.detail);
        try {
            e.initCause(new NullPointerException());
            fail("did not throw illegal state exception");
        } catch (IllegalStateException ise) {
        }
    }
View Full Code Here

Examples of java.rmi.activation.UnknownGroupException.initCause()

        UnknownGroupException e = new UnknownGroupException("fixture");
        assertEquals("fixture", e.getMessage());
        assertNull(e.getCause());
        assertNull(e.detail);
        try {
            e.initCause(new NullPointerException());
            fail("did not throw illegal state exception");
        } catch (IllegalStateException ise) {
        }
    }
}
View Full Code Here

Examples of java.rmi.activation.UnknownObjectException.initCause()

        UnknownObjectException e = new UnknownObjectException("fixture");
        assertEquals("fixture", e.getMessage());
        assertNull(e.getCause());
        assertNull(e.detail);
        try {
            e.initCause(new NullPointerException());
            fail("did not throw illegal state exception");
        } catch (IllegalStateException ise) {
        }
    }
}
View Full Code Here

Examples of java.rmi.server.ServerCloneException.initCause()

    public void test_Constructor_String() {
        ServerCloneException e = new ServerCloneException(errorMessage);
        assertEquals(errorMessage, e.getMessage());
        assertNull(e.detail);
        try {
            e.initCause(e);
            fail("No expected IllegalArgumentException");
        } catch (IllegalArgumentException exception) {
            // expected
        }
    }
View Full Code Here

Examples of java.security.AccessControlException.initCause()

        try {
            Policy.getPolicy().refresh();
        } catch (SecurityException e) {
           AccessControlException ace = new AccessControlException(e.toString());
           ace.initCause(e);
           throw ace;
        }
    }

   /**
 
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.