commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <>
Subject Re: [lang] Running lang under a security manager and LANG-744
Date Tue, 06 Sep 2011 03:54:09 GMT
On 6 September 2011 04:33, Henri Yandell <> wrote:
> On Sat, Sep 3, 2011 at 8:10 AM, sebb <> wrote:
>> On 3 September 2011 05:37, Henri Yandell <> wrote:
>>> I'm less concerned with the 115 errors, unless they're all as grievous
>>> as the StringUtils one - ie) the method causing trouble is not the
>>> only one broken.
>>> If the error happened when calling stripAccents, that would be
>>> workable; but having all of StringUtils unavailable is very painful.
>>> One option would be to move the code out of the static initializer and
>>> make it lazy when stripAccents is first called - leading to only
>>> callers of stripAccents when the JDK 6 class is unavailable to suffer
>>> pain.
>> I thought we'd already fixed that by catching the extra Exception?
>> I already suggested localising the error display to the stripAccents method.
> Sorry - not operating at 100% last week.
>>> I thought we could simplify things by simply making the java6Available
>>> flag be a real test for Java 6, but Android seems very weird there. Is
>>> Android going to force us to stay on the EOL Java 5, or is it Java 6
>>> compatible? IIUC it reports itself as 0.9, which we've declared as
>>> equivalent to JDK 1.5.
>> Are you sure that is the issue?
>> Surely the Android problem is that we check for the sun class but
>> don't handle all possible errors?
>> So the class does not load; it cannot use the Java6 method even if it exists.
> I'm very confused between Android and GAE :)
>>> That relates to another (simple) solution - move to Java 6 :)
>> Or capture Exception for both the java6 and sun tests; report the
>> exception(s) if neither is available when required.
> I like this. Capture the exception in the static initializer and then
> throw a new runtime exception in stripAccents that refers to said
> exception. Perhaps an IllegalStateException("blah", originalException)
> ?

It currently throws UnsupportedOperationException; I think we should
keep that as it's more accurate.

There will always be two Exceptions at that point (otherwise we must
have Java 6 or Sun).
We know we need to report the Sun Exception - is there any need to
report the Java 6 exception?
i.e. could we be running on Java 6 but still get an Exception?

For completeness (and debugging) we should probably report both.

Perhaps we could nest the exceptions.

> Hen
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message