类org.apache.commons.lang3.exception.CloneFailedException源码实例Demo

下面列出了怎么用org.apache.commons.lang3.exception.CloneFailedException的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: Flink-CEPplus   文件: KryoSerializer.java
private ExecutionConfig.SerializableSerializer<? extends Serializer<?>> deepCopySerializer(
	ExecutionConfig.SerializableSerializer<? extends Serializer<?>> original) {
	try {
		return InstantiationUtil.clone(original, Thread.currentThread().getContextClassLoader());
	} catch (IOException | ClassNotFoundException ex) {
		throw new CloneFailedException(
			"Could not clone serializer instance of class " + original.getClass(),
			ex);
	}
}
 
源代码2 项目: flink   文件: KryoSerializer.java
private ExecutionConfig.SerializableSerializer<? extends Serializer<?>> deepCopySerializer(
	ExecutionConfig.SerializableSerializer<? extends Serializer<?>> original) {
	try {
		return InstantiationUtil.clone(original, Thread.currentThread().getContextClassLoader());
	} catch (IOException | ClassNotFoundException ex) {
		throw new CloneFailedException(
			"Could not clone serializer instance of class " + original.getClass(),
			ex);
	}
}
 
源代码3 项目: astor   文件: ObjectUtilsTest.java
/**
 * Tests {@link ObjectUtils#clone(Object)} with an uncloneable object.
 */
public void testCloneOfUncloneable() {
    final UncloneableString string = new UncloneableString("apache");
    try {
        ObjectUtils.clone(string);
        fail("Thrown " + CloneFailedException.class.getName() + " expected");
    } catch (final CloneFailedException e) {
        assertEquals(NoSuchMethodException.class, e.getCause().getClass());
    }
}
 
源代码4 项目: astor   文件: ObjectUtilsTest.java
/**
 * Tests {@link ObjectUtils#cloneIfPossible(Object)} with an uncloneable object.
 */
public void testPossibleCloneOfUncloneable() {
    final UncloneableString string = new UncloneableString("apache");
    try {
        ObjectUtils.cloneIfPossible(string);
        fail("Thrown " + CloneFailedException.class.getName() + " expected");
    } catch (final CloneFailedException e) {
        assertEquals(NoSuchMethodException.class, e.getCause().getClass());
    }
}
 
源代码5 项目: astor   文件: ObjectUtilsTest.java
/**
 * Tests {@link ObjectUtils#clone(Object)} with an uncloneable object.
 */
@Test(expected = NoSuchMethodException.class)
public void testCloneOfUncloneable() throws Throwable {
    final UncloneableString string = new UncloneableString("apache");
    try {
        ObjectUtils.clone(string);
        fail("Thrown " + CloneFailedException.class.getName() + " expected");
    } catch (final CloneFailedException e) {
        throw e.getCause();
    }
}
 
源代码6 项目: astor   文件: ObjectUtilsTest.java
/**
 * Tests {@link ObjectUtils#cloneIfPossible(Object)} with an uncloneable object.
 */
@Test(expected = NoSuchMethodException.class)
public void testPossibleCloneOfUncloneable() throws Throwable {
    final UncloneableString string = new UncloneableString("apache");
    try {
        ObjectUtils.cloneIfPossible(string);
        fail("Thrown " + CloneFailedException.class.getName() + " expected");
    } catch (final CloneFailedException e) {
        throw e.getCause();
    }
}
 
源代码7 项目: astor   文件: ObjectUtilsTest.java
/**
 * Tests {@link ObjectUtils#clone(Object)} with an uncloneable object.
 */
@Test(expected = NoSuchMethodException.class)
public void testCloneOfUncloneable() throws Throwable {
    final UncloneableString string = new UncloneableString("apache");
    try {
        ObjectUtils.clone(string);
        fail("Thrown " + CloneFailedException.class.getName() + " expected");
    } catch (final CloneFailedException e) {
        throw e.getCause();
    }
}
 
源代码8 项目: astor   文件: ObjectUtilsTest.java
/**
 * Tests {@link ObjectUtils#cloneIfPossible(Object)} with an uncloneable object.
 */
@Test(expected = NoSuchMethodException.class)
public void testPossibleCloneOfUncloneable() throws Throwable {
    final UncloneableString string = new UncloneableString("apache");
    try {
        ObjectUtils.cloneIfPossible(string);
        fail("Thrown " + CloneFailedException.class.getName() + " expected");
    } catch (final CloneFailedException e) {
        throw e.getCause();
    }
}
 
源代码9 项目: astor   文件: ObjectUtilsTest.java
/**
 * Tests {@link ObjectUtils#clone(Object)} with an uncloneable object.
 */
@Test(expected = NoSuchMethodException.class)
public void testCloneOfUncloneable() throws Throwable {
    final UncloneableString string = new UncloneableString("apache");
    try {
        ObjectUtils.clone(string);
        fail("Thrown " + CloneFailedException.class.getName() + " expected");
    } catch (final CloneFailedException e) {
        throw e.getCause();
    }
}
 
源代码10 项目: astor   文件: ObjectUtilsTest.java
/**
 * Tests {@link ObjectUtils#cloneIfPossible(Object)} with an uncloneable object.
 */
@Test(expected = NoSuchMethodException.class)
public void testPossibleCloneOfUncloneable() throws Throwable {
    final UncloneableString string = new UncloneableString("apache");
    try {
        ObjectUtils.cloneIfPossible(string);
        fail("Thrown " + CloneFailedException.class.getName() + " expected");
    } catch (final CloneFailedException e) {
        throw e.getCause();
    }
}
 
源代码11 项目: flink   文件: KryoSerializer.java
private ExecutionConfig.SerializableSerializer<? extends Serializer<?>> deepCopySerializer(
	ExecutionConfig.SerializableSerializer<? extends Serializer<?>> original) {
	try {
		return InstantiationUtil.clone(original, Thread.currentThread().getContextClassLoader());
	} catch (IOException | ClassNotFoundException ex) {
		throw new CloneFailedException(
			"Could not clone serializer instance of class " + original.getClass(),
			ex);
	}
}
 
 类所在包
 类方法
 同包方法