Lazy values: change encoding, now NOT_COMPUTED is an explicit object, and null is stored as such

This commit is contained in:
Andrey Breslav
2013-09-30 19:28:04 +04:00
parent 51dfdf795f
commit 48605074aa
3 changed files with 18 additions and 12 deletions
@@ -58,10 +58,16 @@ public class WrappedValues {
@Nullable
public static <V> V unescapeExceptionOrNull(@NotNull Object value) {
return unescapeNull(unescapeThrowable(value));
}
@Nullable
public static <V> V unescapeThrowable(@Nullable Object value) {
if (value instanceof ThrowableWrapper) {
throw ExceptionUtils.rethrow(((ThrowableWrapper) value).getThrowable());
}
return unescapeNull(value);
//noinspection unchecked
return (V) value;
}
}