1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-07 17:56:01 +02:00

Fix warnings.

This commit is contained in:
Ken Ryall 2010-06-01 16:44:33 +00:00
parent a137a7f097
commit 2bedd8397b

View file

@ -74,13 +74,13 @@ public class MapEntrySourceContainer extends AbstractSourceContainer {
*/ */
public static IPath createPath(String path) { public static IPath createPath(String path) {
if (path == null) return null; if (path == null) return null;
if (path.contains("\\")) { if (path.contains("\\")) { //$NON-NLS-1$
// handle Windows slashes and canonicalize // handle Windows slashes and canonicalize
path = path.replaceAll("\\\\", "/"); path = path.replaceAll("\\\\", "/"); //$NON-NLS-1$ //$NON-NLS-2$
} }
// also check for device or UNC // also check for device or UNC
int idx = path.indexOf(":"); int idx = path.indexOf(":"); //$NON-NLS-1$
if (idx > 0) { if (idx > 0) {
String device = path.substring(0, idx + 1); String device = path.substring(0, idx + 1);
path = path.substring(idx + 1); path = path.substring(idx + 1);
@ -88,15 +88,15 @@ public class MapEntrySourceContainer extends AbstractSourceContainer {
} }
else { else {
// Cygwin or UNC path // Cygwin or UNC path
if (path.startsWith("//")) { if (path.startsWith("//")) { //$NON-NLS-1$
String network; String network;
idx = path.indexOf("/", 2); idx = path.indexOf("/", 2); //$NON-NLS-1$
if (idx > 0) { if (idx > 0) {
network = path.substring(0, idx); network = path.substring(0, idx);
path = path.substring(idx); path = path.substring(idx);
} else { } else {
network = path; network = path;
path = ""; path = ""; //$NON-NLS-1$
} }
return new Path(network, path).makeUNC(true); return new Path(network, path).makeUNC(true);
} }