| 333 | } |
| 334 | return alt; |
| 335 | } |
| 336 | |
| 337 | static public Object convert(Object value, List<Class> fit) { |
| 338 | String[] ei = {null}; |
| 339 | |
| 340 | Object o = _convert(value, fit, m -> { |
| 341 | ei[0] = m; |
| 342 | }); |
| 343 | |
| 344 | if (ei[0] != null) { |
| 345 | provideExtraInformation(o, ei[0]); |
| 346 | } |
| 347 | |
| 348 | // set error consumer on conversion |
| 349 | |
| 350 | // commented out while we debug JDK9's modified-yet-again creation of SAM from functions |
| 351 | |
| 352 | // if (o instanceof Errors.SavesErrorConsumer) { |
| 353 | // if (value instanceof Errors.SavesErrorConsumer) { |
| 354 | // ((Errors.SavesErrorConsumer) o).setErrorConsumer(wrap(ei[0], ((Errors.SavesErrorConsumer) value).getErrorConsumer())); |
| 355 | // } else if (value instanceof Errors.ErrorConsumer) { |
| 356 | // ((Errors.SavesErrorConsumer) o).setErrorConsumer(wrap(ei[0], ((Errors. |
| 357 | // ErrorConsumer) value))); |
| 358 | // } else { |
| 359 | // ((Errors.SavesErrorConsumer) o).setErrorConsumer(wrap(ei[0], Errors.errors.get())); |
| 360 | // } |
| 361 | // } |
| 362 | return o; |
| 363 | } |
| 364 | |