List Info

Thread: svn commit: r592063 - /commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/ExtendedMessa




svn commit: r592063 - /commons/proper/lang/trunk/src/java/org/ apache/commons/lang/text/ExtendedMessa
country flaguser name
United States
2007-11-05 10:16:09
Author: mbenson
Date: Mon Nov  5 08:16:08 2007
New Revision: 592063

URL: 
http://svn.apache.org/viewvc?rev=592063&view=rev
Log:
remove accidental use of 1.5+ method

Modified:
   
commons/proper/lang/trunk/src/java/org/apache/commons/lang/t
ext/ExtendedMessageFormat.java

Modified:
commons/proper/lang/trunk/src/java/org/apache/commons/lang/t
ext/ExtendedMessageFormat.java
URL: 
http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/j
ava/org/apache/commons/lang/text/ExtendedMessageFormat.java?
rev=592063&r1=592062&r2=592063&view=diff
============================================================
==================
---
commons/proper/lang/trunk/src/java/org/apache/commons/lang/t
ext/ExtendedMessageFormat.java (original)
+++
commons/proper/lang/trunk/src/java/org/apache/commons/lang/t
ext/ExtendedMessageFormat.java Mon Nov  5 08:16:08 2007
 -71,26
+71,27 
         private String stripFormats(String pattern) {
             StringBuffer sb = new
StringBuffer(pattern.length());
             ParsePosition pos = new ParsePosition(0);
+            char[] c = pattern.toCharArray();
             while (pos.getIndex() < pattern.length()) {
-                switch (pattern.charAt(pos.getIndex())) {
+                switch (c[pos.getIndex()]) {
                 case QUOTE:
                     appendQuotedString(pattern, pos, sb,
true);
                     break;
                 case START_FE:
                     int start = pos.getIndex();
                     readArgumentIndex(pattern, next(pos));
-                    sb.append(pattern, start,
pos.getIndex());
-                    if (pattern.charAt(pos.getIndex()) ==
START_FMT) {
+                    sb.append(c, start, pos.getIndex() -
start);
+                    if (c[pos.getIndex()] == START_FMT) {
                         eatFormat(pattern, next(pos));
                     }
-                    if (pattern.charAt(pos.getIndex()) !=
END_FE) {
+                    if (c[pos.getIndex()] != END_FE) {
                         throw new
IllegalArgumentException(
                                 "Unreadable format
element at position "
                                         + start);
                     }
                     // fall through
                 default:
-                   
sb.append(pattern.charAt(pos.getIndex()));
+                    sb.append(c[pos.getIndex()]);
                     next(pos);
                 }
             }
 -191,24
+192,25 
         private StringBuffer appendQuotedString(String
pattern,
                 ParsePosition pos, StringBuffer appendTo,
boolean escapingOn) {
             int start = pos.getIndex();
-            if (escapingOn && pattern.charAt(start)
== QUOTE) {
+            char[] c = pattern.toCharArray();
+            if (escapingOn && c[start] == QUOTE) {
                 return appendTo == null ? null :
appendTo.append(QUOTE);
             }
             int lastHold = start;
             for (int i = pos.getIndex(); i <
pattern.length(); i++) {
                 if (escapingOn
                         &&
pattern.substring(i).startsWith(ESCAPED_QUOTE)) {
-                    appendTo.append(pattern, lastHold,
pos.getIndex()).append(
+                    appendTo.append(c, lastHold,
pos.getIndex() - lastHold).append(
                             QUOTE);
                     pos.setIndex(i +
ESCAPED_QUOTE.length());
                     lastHold = pos.getIndex();
                     continue;
                 }
-                switch (pattern.charAt(pos.getIndex())) {
+                switch (c[pos.getIndex()]) {
                 case QUOTE:
                     next(pos);
-                    return appendTo == null ? null :
appendTo.append(pattern,
-                            lastHold, pos.getIndex());
+                    return appendTo == null ? null :
appendTo.append(c,
+                            lastHold, pos.getIndex() -
lastHold);
                 default:
                     next(pos);
                 }



jhalfs-based build is impossible in French locales
user name
2007-11-05 10:10:25
(caught on IRC, credit goes to sigzegv)

jhalfs runs commands such as the following in order to find
whether the 
host meets requirements:

check_version "4.1.20" "$(find --version |
head -n1 | cut -d" " -f4)"

However, this fails in French locales, because "find
--version" prints this:

> « find » de GNU version 4.2.31
> Built using GNU gnulib version 2007-02-24
> Options activées: D_TYPE O_NOFOLLOW(enabled)
LEAF_OPTIMISATION

I.e., because the French language requires spaces around
quotes, "de" is 
picked as a version. So please release a new version of
jhalfs that uses 
the C locale (LC_ALL=C LANGUAGE=C) for the purpose of
running such 
version-checking commands (but not for running lxdialog!),
and I will 
release a new CD with it.

-- 
Alexander E. Patrakov
-- 
http://linuxfromscratch.org/mailman/listinfo/alfs-discu
ss
FAQ: http://www.linux
fromscratch.org/faq/
Unsubscribe: See the above information page
Re: jhalfs-based build is impossible in French locales
country flaguser name
Russian Federation
2007-11-07 09:28:22
I wrote:
> (caught on IRC, credit goes to sigzegv)
>
> jhalfs runs commands such as the following in order to
find whether the 
> host meets requirements:
>
> check_version "4.1.20" "$(find --version
| head -n1 | cut -d" " -f4)"
>
> However, this fails in French locales, because
"find --version" prints this:
>
>   
>> « find » de GNU version 4.2.31
>> Built using GNU gnulib version 2007-02-24
>> Options activées: D_TYPE O_NOFOLLOW(enabled)
LEAF_OPTIMISATION
>>     
>
> I.e., because the French language requires spaces
around quotes, "de" is 
> picked as a version. So please release a new version of
jhalfs that uses 
> the C locale (LC_ALL=C LANGUAGE=C) for the purpose of
running such 
> version-checking commands (but not for running
lxdialog!), and I will 
> release a new CD with it.
>
>   

The fix is attached, I will release a CD with it soon.

-- 
Alexander E. Patrakov

-- 
http://linuxfromscratch.org/mailman/listinfo/alfs-discu
ss
FAQ: http://www.linux
fromscratch.org/faq/
Unsubscribe: See the above information page

  
[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )