[OpenMap Users] Tiny issue in PropUtils

From: Stéphane Wasserhardt <swasserhardt_at_cls.fr>
Date: Thu, 04 May 2006 16:24:30 +0200
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_at_bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Thu May 04 2006 - 10:27:16 EDT

This archive was generated by hypermail 2.3.0 : Tue Mar 28 2017 - 23:25:07 EDT