1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-29 03:45:35 +02:00

Add Copyright Attribution for Wind River Patch

This commit is contained in:
Martin Oberhuber 2006-10-24 13:54:21 +00:00
parent a18756b306
commit 51093e5a56
8 changed files with 30 additions and 26 deletions

View file

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
#******************************************************************************* #*******************************************************************************
# Copyright (c) 2005, 2006 IBM Corporation and others. # Copyright (c) 2005, 2006 IBM Corporation and Wind River Systems, Inc.
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0 # are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at # which accompanies this distribution, and is available at

View file

@ -1,5 +1,5 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2006 IBM Corporation. All rights reserved. * Copyright (c) 2006 IBM Corporation and Wind River Systems, Inc. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
@ -21,8 +21,7 @@ import org.eclipse.core.runtime.IAdapterManager;
import org.eclipse.rse.core.subsystems.util.ISubSystemConfigurationAdapter; import org.eclipse.rse.core.subsystems.util.ISubSystemConfigurationAdapter;
/** /**
* @author martin.oberhuber@windriver.com * @see IAdapterFactory
*
*/ */
public class DeveloperSubSystemConfigurationAdapterFactory implements public class DeveloperSubSystemConfigurationAdapterFactory implements
IAdapterFactory { IAdapterFactory {

View file

@ -1,5 +1,5 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2006 IBM Corporation. All rights reserved. * Copyright (c) 2006 IBM Corporation and Wind River Systems, Inc. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html

View file

@ -1,5 +1,5 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2006 IBM Corporation. All rights reserved. * Copyright (c) 2006 IBM Corporation and Wind River Systems, Inc. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html

View file

@ -1,5 +1,5 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2006 IBM Corporation. All rights reserved. * Copyright (c) 2006 IBM Corporation and Wind River Systems, Inc. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html

View file

@ -1,5 +1,5 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2006 IBM Corporation. All rights reserved. * Copyright (c) 2006 IBM Corporation and Wind River Systems, Inc. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
@ -11,7 +11,8 @@
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
* *
* Contributors: * Contributors:
* {Name} (company) - description of contribution. * Martin Oberhuber (WindRiver) - Fix for bug 161844 - regex matching backslashes
*
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.services.clientserver; package org.eclipse.rse.services.clientserver;
@ -29,9 +30,10 @@ public class PathUtility
boolean containsDoubleSlashes = false; boolean containsDoubleSlashes = false;
boolean endsWithSlash = false; boolean endsWithSlash = false;
if (path.indexOf("/") != -1) containsForwardSlash = true; //TODO Improve performance by using a pre-compiled Regex Pattern
if (path.indexOf("\\\\") != -1) containsDoubleSlashes = true; if (path.indexOf('/') != -1) containsForwardSlash = true;
if (path.endsWith("\\") || path.endsWith("/")) endsWithSlash = true; if (path.indexOf("\\\\") != -1) containsDoubleSlashes = true; //$NON-NLS-1$
if (path.endsWith("\\") || path.endsWith("/")) endsWithSlash = true; //$NON-NLS-1$ //$NON-NLS-2$
boolean needsNormalizing = containsForwardSlash || containsDoubleSlashes || endsWithSlash; boolean needsNormalizing = containsForwardSlash || containsDoubleSlashes || endsWithSlash;
if (!needsNormalizing) return path; if (!needsNormalizing) return path;
@ -39,14 +41,15 @@ public class PathUtility
if (containsForwardSlash) if (containsForwardSlash)
{ {
path = path.replace('/', '\\'); path = path.replace('/', '\\');
containsDoubleSlashes = (path.indexOf("\\\\") != -1); containsDoubleSlashes = (path.indexOf("\\\\") != -1); //$NON-NLS-1$
} }
while (containsDoubleSlashes) while (containsDoubleSlashes)
{ {
//TODO Improve performance by manually iterating over char array
//need to quote once for the string, then again for the regex //need to quote once for the string, then again for the regex
path = path.replaceAll("\\\\\\\\", "\\"); path = path.replaceAll("\\\\\\\\", "\\"); //$NON-NLS-1$ //$NON-NLS-2$
containsDoubleSlashes = (path.indexOf("\\\\") != -1); containsDoubleSlashes = (path.indexOf("\\\\") != -1); //$NON-NLS-1$
} }
if (endsWithSlash) if (endsWithSlash)
{ {
@ -62,9 +65,10 @@ public class PathUtility
boolean containsDoubleSlashes = false; boolean containsDoubleSlashes = false;
boolean endsWithSlash = false; boolean endsWithSlash = false;
if (path.indexOf("\\") != -1) containsBackSlash = true; //TODO Improve performance by using a pre-compiled Regex Pattern
if (path.indexOf("//") != -1) containsDoubleSlashes = true; if (path.indexOf('\\') != -1) containsBackSlash = true;
if (path.endsWith("\\") || path.endsWith("/")) endsWithSlash = true; if (path.indexOf("//") != -1) containsDoubleSlashes = true; //$NON-NLS-1$
if (path.endsWith("\\") || path.endsWith("/")) endsWithSlash = true; //$NON-NLS-1$ //$NON-NLS-2$
boolean needsNormalizing = containsBackSlash || containsDoubleSlashes || endsWithSlash; boolean needsNormalizing = containsBackSlash || containsDoubleSlashes || endsWithSlash;
if (!needsNormalizing) return path; if (!needsNormalizing) return path;
@ -72,13 +76,14 @@ public class PathUtility
if (containsBackSlash) if (containsBackSlash)
{ {
path = path.replace('\\', '/'); path = path.replace('\\', '/');
containsDoubleSlashes = (path.indexOf("//") != -1); containsDoubleSlashes = (path.indexOf("//") != -1); //$NON-NLS-1$
} }
while (containsDoubleSlashes) while (containsDoubleSlashes)
{ {
path = path.replaceAll("//", "/"); //TODO Improve performance by manually iterating over char array
containsDoubleSlashes = (path.indexOf("//") != -1); path = path.replaceAll("//", "/"); //$NON-NLS-1$ //$NON-NLS-2$
containsDoubleSlashes = (path.indexOf("//") != -1); //$NON-NLS-1$
} }
if (endsWithSlash) if (endsWithSlash)
@ -129,11 +134,11 @@ public class PathUtility
{ {
if (path.length() > 1 && path.charAt(1) == ':') if (path.length() > 1 && path.charAt(1) == ':')
{ {
return "\\"; return "\\"; //$NON-NLS-1$
} }
else else
{ {
return "/"; return "/"; //$NON-NLS-1$
} }
} }
} }

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- <!--
Copyright (c) 2006 IBM Corporation. All rights reserved. Copyright (c) 2006 IBM Corporation, Symbian Software Ltd. and Wind River Systems, Inc. All rights reserved.
This program and the accompanying materials are made available under the terms This program and the accompanying materials are made available under the terms
of the Eclipse Public License v1.0 which accompanies this distribution, and is of the Eclipse Public License v1.0 which accompanies this distribution, and is
available at http://www.eclipse.org/legal/epl-v10.html available at http://www.eclipse.org/legal/epl-v10.html

View file

@ -1,5 +1,5 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved. * Copyright (c) 2002, 2006 IBM Corporation and Wind River Systems, Inc. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html