(Object value)
| 1241 | } |
| 1242 | |
| 1243 | private static Object unwrapIfThrowable(Object value) { |
| 1244 | if (!(value instanceof Throwable t)) { |
| 1245 | return value; // normal object, no unwrap |
| 1246 | } |
| 1247 | |
| 1248 | // unwrap async wrappers |
| 1249 | while (t instanceof CompletionException || t instanceof ExecutionException) { |
| 1250 | if (t.getCause() == null) { |
| 1251 | break; |
| 1252 | } |
| 1253 | t = t.getCause(); |
| 1254 | } |
| 1255 | return t; |
| 1256 | } |
| 1257 | |
| 1258 | // public static Object split(Object str, Object splitter) { |
| 1259 | // if (str == null || splitter == null) { |