Fixed elements decoding. Null values were not treated correctly. BLD200410251800
authormentlicher@netbeans.org
Mon, 25 Oct 2004 16:10:16 +0000
changeset 5368a946f32149f6
parent 5367 15de05ea02ed
child 5369 d20aaf4b76b0
Fixed elements decoding. Null values were not treated correctly.
vcscore/src/org/netbeans/modules/vcscore/commands/CommandOutputCollector.java
     1.1 --- a/vcscore/src/org/netbeans/modules/vcscore/commands/CommandOutputCollector.java	Mon Oct 25 12:11:49 2004 +0000
     1.2 +++ b/vcscore/src/org/netbeans/modules/vcscore/commands/CommandOutputCollector.java	Mon Oct 25 16:10:16 2004 +0000
     1.3 @@ -510,17 +510,23 @@
     1.4              int index1 = line.indexOf(" / ", lastIndex);
     1.5              int index2 = line.indexOf(" /null/ ", lastIndex);
     1.6              if (index1 < 0 && index2 < 0) break;
     1.7 -            if (index1 >= 0) index = index1;
     1.8 -            else index = index2;
     1.9 +            if (index1 >= 0 && index2 >= 0) {
    1.10 +                index = Math.min(index1, index2);
    1.11 +            } else {
    1.12 +                if (index1 >= 0) index = index1;
    1.13 +                else index = index2;
    1.14 +            }
    1.15              int sepLength;
    1.16 -            if (index2 >= 0 && index2 < index) {
    1.17 -                index = index2;
    1.18 +            String element;
    1.19 +            if (index == index2) {
    1.20                  sepLength = " /null/ ".length();
    1.21 +                element = null;
    1.22              } else {
    1.23                  sepLength = " / ".length();
    1.24 +                element = line.substring(lastIndex, index);
    1.25 +                element = org.openide.util.Utilities.replaceString(element, " // ", "/");
    1.26              }
    1.27 -            String element = line.substring(lastIndex, index);
    1.28 -            elements.add(org.openide.util.Utilities.replaceString(element, " // ", "/"));
    1.29 +            elements.add(element);
    1.30              lastIndex = index + sepLength;
    1.31          }
    1.32          return (String[]) elements.toArray(new String[0]);