You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Henri Yandell <fl...@gmail.com> on 2011/09/08 08:42:31 UTC

Re: svn commit: r1165701 - /commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java

On Tue, Sep 6, 2011 at 8:16 AM,  <se...@apache.org> wrote:
> Author: sebb
> Date: Tue Sep  6 15:16:47 2011
> New Revision: 1165701
>
> URL: http://svn.apache.org/viewvc?rev=1165701&view=rev
> Log:
> LANG-744 StringUtils throws java.security.AccessControlException on Google App Engine
> Change static code to catch and save Exception; only report failure if no method is available
>
> Modified:
>    commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java
>
> Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java
> URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java?rev=1165701&r1=1165700&r2=1165701&view=diff
> ==============================================================================
> --- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java (original)
> +++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java Tue Sep  6 15:16:47 2011
> @@ -630,13 +630,14 @@ public class StringUtils {
>         }
>         try {
>             String result = null;
> -            if (java6Available) {
> +            if (java6NormalizeMethod != null) {
>                 result = removeAccentsJava6(input);
> -            } else if (sunAvailable) {
> +            } else if (sunDecomposeMethod != null) {
>                 result = removeAccentsSUN(input);
>             } else {
>                 throw new UnsupportedOperationException(
> -                    "The stripAccents(CharSequence) method requires at least Java 1.6 or a Sun JVM");
> +                    "The stripAccents(CharSequence) method requires at least Java 1.6 or a Sun JVM",
> +                    new UnsupportedOperationException(java6Exception));

Was it intended to have the same Exception twice? UOE in UOE?

Hen

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: svn commit: r1165701 - /commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java

Posted by sebb <se...@gmail.com>.
On 8 September 2011 16:07, sebb <se...@gmail.com> wrote:
> On 8 September 2011 07:42, Henri Yandell <fl...@gmail.com> wrote:
>> On Tue, Sep 6, 2011 at 8:16 AM,  <se...@apache.org> wrote:
>>> Author: sebb
>>> Date: Tue Sep  6 15:16:47 2011
>>> New Revision: 1165701
>>>
>>> URL: http://svn.apache.org/viewvc?rev=1165701&view=rev
>>> Log:
>>> LANG-744 StringUtils throws java.security.AccessControlException on Google App Engine
>>> Change static code to catch and save Exception; only report failure if no method is available
>>>
>>> Modified:
>>>    commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java
>>>
>>> Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java
>>> URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java?rev=1165701&r1=1165700&r2=1165701&view=diff
>>> ==============================================================================
>>> --- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java (original)
>>> +++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java Tue Sep  6 15:16:47 2011
>>> @@ -630,13 +630,14 @@ public class StringUtils {
>>>         }
>>>         try {
>>>             String result = null;
>>> -            if (java6Available) {
>>> +            if (java6NormalizeMethod != null) {
>>>                 result = removeAccentsJava6(input);
>>> -            } else if (sunAvailable) {
>>> +            } else if (sunDecomposeMethod != null) {
>>>                 result = removeAccentsSUN(input);
>>>             } else {
>>>                 throw new UnsupportedOperationException(
>>> -                    "The stripAccents(CharSequence) method requires at least Java 1.6 or a Sun JVM");
>>> +                    "The stripAccents(CharSequence) method requires at least Java 1.6 or a Sun JVM",
>>> +                    new UnsupportedOperationException(java6Exception));
>>
>> Was it intended to have the same Exception twice? UOE in UOE?
>
> Well spotted!
>
> The intention was to wrap both the java6 and sun6 exceptions into the
> main UOE, but it looks like I messed that up.
>
> I'll fix that shortly.

Not possible to use chaining here - we have two unrelated Exceptions -
so added both exception texts to the UOE.

>> Hen
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>> For additional commands, e-mail: dev-help@commons.apache.org
>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: svn commit: r1165701 - /commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java

Posted by sebb <se...@gmail.com>.
On 8 September 2011 07:42, Henri Yandell <fl...@gmail.com> wrote:
> On Tue, Sep 6, 2011 at 8:16 AM,  <se...@apache.org> wrote:
>> Author: sebb
>> Date: Tue Sep  6 15:16:47 2011
>> New Revision: 1165701
>>
>> URL: http://svn.apache.org/viewvc?rev=1165701&view=rev
>> Log:
>> LANG-744 StringUtils throws java.security.AccessControlException on Google App Engine
>> Change static code to catch and save Exception; only report failure if no method is available
>>
>> Modified:
>>    commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java
>>
>> Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java
>> URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java?rev=1165701&r1=1165700&r2=1165701&view=diff
>> ==============================================================================
>> --- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java (original)
>> +++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java Tue Sep  6 15:16:47 2011
>> @@ -630,13 +630,14 @@ public class StringUtils {
>>         }
>>         try {
>>             String result = null;
>> -            if (java6Available) {
>> +            if (java6NormalizeMethod != null) {
>>                 result = removeAccentsJava6(input);
>> -            } else if (sunAvailable) {
>> +            } else if (sunDecomposeMethod != null) {
>>                 result = removeAccentsSUN(input);
>>             } else {
>>                 throw new UnsupportedOperationException(
>> -                    "The stripAccents(CharSequence) method requires at least Java 1.6 or a Sun JVM");
>> +                    "The stripAccents(CharSequence) method requires at least Java 1.6 or a Sun JVM",
>> +                    new UnsupportedOperationException(java6Exception));
>
> Was it intended to have the same Exception twice? UOE in UOE?

Well spotted!

The intention was to wrap both the java6 and sun6 exceptions into the
main UOE, but it looks like I messed that up.

I'll fix that shortly.

> Hen
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org