diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/utils/TransformationUtils.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/utils/TransformationUtils.java index 9508b36257c3bc7c2996630cf4def0716a3c31bd..152fd19a4aeb2efbf9a56252c2f71936b7b803e9 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/utils/TransformationUtils.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/utils/TransformationUtils.java @@ -31,7 +31,7 @@ import org.fortiss.tooling.kernel.service.ITransformationService; * @author hoelzl * @author $Author$ * @version $Rev$ - * @ConQAT.Rating GREEN Hash: D5FFA34D4F541675F1EF17EE4A5C59CA + * @ConQAT.Rating YELLOW Hash: 8B88DE0F53EE7561C069D2660CF31843 */ public final class TransformationUtils { @@ -132,4 +132,18 @@ public final class TransformationUtils { ITransformationContext context) { return ITransformationService.INSTANCE.canTransform(sourceElement, targetClass, context); } + + /** + * @param e + * @return the deepest non-null cause of <code>e</code> + */ + public static Throwable getOriginalCause(ChainTransformationFailedException e) { + Throwable f = e.getCause(); + Throwable previous = e; + while(f != null) { + previous = f; + f = f.getCause(); + } + return previous; + } }