[OpenMap Users] Tiny issue in PropUtils

From: Stéphane Wasserhardt <swasserhardt@cls.fr>
Date: Thu May 04 2006 - 10:24:30 EDT
Hello all !

I just found an issue that no one will ever deal with, but here it is :
In PropUtils.getScopedPropertyPrefix(String) :
If you call this method with an empty string, it returns the string ".".
With an empty string, the method should behave like with a null string, that is to say, it should return an empty string.
This problem will probably never happen since we always use a prefix, but who knows ?
So here is the fix (I also attached the fixed version of the file ...) :

    public static String getScopedPropertyPrefix(String pre) {
       
if ((pre == null) || (pre.length() == 0)) {
           
return "";
        }
else if (pre.endsWith(".")) {
           
return pre;
        }
else {
           
return pre + ".";
        }
    }

Stephane

--
[To unsubscribe to this list send an email to "majdart@bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Thu May 4 10:32:36 2006

This archive was generated by hypermail 2.1.8 : Thu May 04 2006 - 10:32:38 EDT