Author: bdaw
Date: 2007-08-19 15:31:23 -0400 (Sun, 19 Aug 2007)
New Revision: 7993
Modified:
trunk/core/src/main/org/jboss/portal/core/model/portal/PortalObjectPath.java
Log:
forgot to sync code revert from 2.6 branch
Modified: trunk/core/src/main/org/jboss/portal/core/model/portal/PortalObjectPath.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/model/portal/PortalObjectPath.java 2007-08-19
18:01:55 UTC (rev 7992)
+++
trunk/core/src/main/org/jboss/portal/core/model/portal/PortalObjectPath.java 2007-08-19
19:31:23 UTC (rev 7993)
@@ -365,10 +365,7 @@
{
break;
}
- if (next > 0 && value.charAt(next-1) != '\\')
- {
- length++;
- }
+ length++;
previous = next + 1;
}
@@ -376,26 +373,17 @@
String[] names = new String[length];
length = 0;
previous = 1;
- int next = 1;
while (true)
{
- next = value.indexOf(PATH_SEPARATOR, next);
+ int next = value.indexOf(PATH_SEPARATOR, previous);
if (next == -1)
{
break;
}
- if (next > 0 && value.charAt(next-1) != '\\')
- {
- String name = value.substring(previous, next);
- name = decodeName(name);
- names[length++] = name;
- previous = next + 1;
- }
- next++;
+ names[length++] = value.substring(previous, next);
+ previous = next + 1;
}
- String name = value.substring(previous);
- name = decodeName(name);
- names[length] = name;
+ names[length] = value.substring(previous);
//
return names;
@@ -418,23 +406,11 @@
{
throw new IllegalArgumentException("No null name expected in the
name string array");
}
- name = encodeName(name);
tmp.append(PATH_SEPARATOR).append(name);
}
return tmp.toString();
}
}
-
- protected String decodeName(String name)
- {
- return name.replaceAll("\\/", "/");
- }
-
- protected String encodeName(String name)
- {
- return name.replaceAll("/", "\\/");
- }
-
}
;
@@ -462,25 +438,18 @@
int length = 1;
for (int next = value.indexOf('.'); next != -1; next =
value.indexOf('.', next + 1))
{
- if (next > 0 && value.charAt(next-1) != '\\')
- {
- length++;
- }
+ length++;
}
//
String[] names = new String[length];
length = 0;
int previous = 0;
- for (int next = value.indexOf('.'); next != -1; next =
value.indexOf('.', next + 1))
+ for (int next = value.indexOf('.'); next != -1; previous = next + 1,
next = value.indexOf('.', next + 1))
{
- if (next > 0 && value.charAt(next-1) != '\\')
- {
- String name = value.substring(previous, next);
- name = decodeName(name);
- names[length++] = name;
- previous = next + 1;
- }
+ String name = value.substring(previous, next);
+ name = decodeName(name);
+ names[length++] = name;
}
String name = value.substring(previous);
name = decodeName(name);
@@ -521,12 +490,12 @@
protected String decodeName(String name)
{
- return name.replaceAll("\\.", ".");
+ return name;
}
protected String encodeName(String name)
{
- return name.replaceAll(".", "\\.");
+ return name;
}
}
Show replies by date