from-java overflows stack if given a java.sql.SQLException

Description

SQLException has an exception chain feature, using setNextException/getNextException to chain multiple exceptions together. Unfortunately, it also implements Iterable<throwable>, and when accessed using the iterator, returns itself as the first item, and then the value of getNextException as the next one. As from-java prefers Iterator to :default, this causes infinite (until the stack blows) recursion.

This can be fixed with:

This doesn't omit any data, as it'll still recurses through getNextException and returns the whole chain, but as nested maps rather than a sequence of them.

Environment

Clojure 1.10
clojure/java.data 0.1.1

Status

Assignee

Sean Corfield

Reporter

Alex Miller

Labels

None

Approval

None

Patch

None

Priority

Major
Configure