Exception while unmarshalling Integer with an element bigger than 32-bit

Chad La Joie lajoie at shibboleth.net
Wed Jun 6 20:23:55 BST 2012



On 6/6/12 3:08 PM, Brent Putman wrote:
> That was my initial gut feeling as well. However I did some checking,
> and for example both JAXB and XmlBeans do by default use BigInteger for
> representing xsd:integer  (and int/Integer or long/Long for xsd:int and
> xsd:long respectively).  So there is at least some precedent for it.

"JAXB does it" isn't an argument that carries a great deal of weight
with me, as you know.

> I was kinda hoping that there might be some library with an arbitrary
> precision integer rep in it that we could use, but haven't found one
> yet.  I think we should at least think on it some more.  It's
> intellectually somewhat hard to defend using Long since it's not any
> more correct than Integer.

I doubt you'll find much.  If you're going to go arbitrary precision
Big[Integer|Decimal] is what you end up with, so why reinvent the wheel?

For our code, above xmltooling, what we probably should consider is
whether we should just unmarshall that data in to java.lang.String.  I'm
not aware of any place where there would be the assumption that you
could perform arithmetic operations on the data.


More information about the users mailing list