Do not pretend that there is key "" in ____ texts javaee5_merge4 javaee5_merge4_u1
authorjtulach@netbeans.org
Wed, 26 Oct 2005 13:25:05 +0000
changeset 79eefd13030067
parent 78 d7f1640a505d
child 80 4599f7b5249c
Do not pretend that there is key "" in ____ texts
openide.util/src/org/openide/util/MapFormat.java
openide.util/test/unit/src/org/openide/util/MapFormatTest.java
     1.1 --- a/openide.util/src/org/openide/util/MapFormat.java	Wed Oct 26 10:01:56 2005 +0000
     1.2 +++ b/openide.util/src/org/openide/util/MapFormat.java	Wed Oct 26 13:25:05 2005 +0000
     1.3 @@ -240,7 +240,15 @@
     1.4              lastOffset = offidx;
     1.5  
     1.6              String key = arguments[i];
     1.7 -            String obj = formatObject(processKey(key));
     1.8 +            String obj;
     1.9 +            if (key.length() > 0) {
    1.10 +                obj = formatObject(processKey(key));
    1.11 +            } else {
    1.12 +                // else just copy the left and right braces
    1.13 +                result.append(this.ldel);
    1.14 +                result.append(this.rdel);
    1.15 +                continue;
    1.16 +            }
    1.17  
    1.18              if (obj == null) {
    1.19                  // try less-greedy match; useful for e.g. PROP___PROPNAME__ where
     2.1 --- a/openide.util/test/unit/src/org/openide/util/MapFormatTest.java	Wed Oct 26 10:01:56 2005 +0000
     2.2 +++ b/openide.util/test/unit/src/org/openide/util/MapFormatTest.java	Wed Oct 26 13:25:05 2005 +0000
     2.3 @@ -66,7 +66,7 @@
     2.4          args.put("NAME", "Jaroslav");
     2.5          MapFormat f = new MapFormat(args) {
     2.6              protected Object processKey(String key) {
     2.7 -                fail("There is no key in \"" + s + "\", processKey() should not be called.");
     2.8 +                fail("There is no key in \"" + s + "\", processKey() should not be called with key:" + key);
     2.9                  return "not defined";
    2.10              }
    2.11          };