X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=org.argeo.slc.core%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fslc%2Fcore%2FUnsupportedException.java;h=4b46b35de3c47ed8eecb6e9b1541cb7bb9468097;hb=8c69c342c923aff75e3cc53afe390b767bb81e2e;hp=76f6565d2870306a96dcd9b5e317d6fc036a290a;hpb=faf680e212bf3e18837c4f798587856e061273b3;p=gpl%2Fargeo-slc.git diff --git a/org.argeo.slc.core/src/main/java/org/argeo/slc/core/UnsupportedException.java b/org.argeo.slc.core/src/main/java/org/argeo/slc/core/UnsupportedException.java index 76f6565d2..4b46b35de 100644 --- a/org.argeo.slc.core/src/main/java/org/argeo/slc/core/UnsupportedException.java +++ b/org.argeo.slc.core/src/main/java/org/argeo/slc/core/UnsupportedException.java @@ -23,7 +23,20 @@ public class UnsupportedException extends SlcException { * the object itself (its class name will be used in message) */ public UnsupportedException(String nature, Object obj) { - super("Unsupported " + nature + ": " + obj.getClass()); + super("Unsupported " + nature + ": " + + (obj != null ? obj.getClass() : "[object is null]")); + } + + /** + * Constructor generating a message. + * + * @param nature + * the nature of the unsupported object + * @param clss + * the class itself (will be used in message) + */ + public UnsupportedException(String nature, Class clss) { + super("Unsupported " + nature + ": " + clss); } /**