Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3da25b7

Browse files
author
zhourenjian
committed
Fixing bug#2797451 j2s incorrectly sets up namespace of cross-referenced project
http://sourceforge.net/tracker/?func=detail&aid=2797451&group_id=155436&atid=795800
1 parent 7f6a018 commit 3da25b7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/net/sf/j2s/ui/property/FileUtil.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public static String toRelativePath(String absPath, String basePath) {
4242
int lastIndex = index;
4343
while (index != -1) {
4444
String partURL = absURL.substring(0, index);
45-
if (!baseURL.startsWith(partURL)) {
45+
if (!baseURL.startsWith(partURL + "/") && !baseURL.equals(partURL)) {
4646
break;
4747
}
4848
lastIndex = index;
@@ -69,4 +69,10 @@ public static String toRelativePath(String absPath, String basePath) {
6969
return null;
7070
}
7171
}
72+
73+
// public static void main(String[] args) {
74+
// String relativeStr = toRelativePath("D:/eclipse-3.3/eclipse/workspace/org.eclipse.draw2d/bin", "D:/eclipse-3.3/eclipse/workspace/org.eclipse.draw2d.examples");
75+
// String relativeStr = toRelativePath("D:/eclipse-3.3/eclipse/workspace/org.eclipse.draw2d.examples/bin", "D:/eclipse-3.3/eclipse/workspace/org.eclipse.draw2d.examples/");
76+
// System.out.println(relativeStr);
77+
// }
7278
}

0 commit comments

Comments
 (0)