1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-13 11:15:38 +02:00

[391132] filterpools don't persist when profile names end in _

This commit is contained in:
David McKnight 2012-10-04 19:02:28 +00:00
parent c4b97e28ba
commit 5cb12a9750
2 changed files with 32 additions and 17 deletions

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2002, 2011 IBM Corporation and others. * Copyright (c) 2002, 2012 IBM Corporation and others.
* 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
@ -19,6 +19,7 @@
* David Dykstal (IBM) - [192122] extended search to look for filter pools in * David Dykstal (IBM) - [192122] extended search to look for filter pools in
* profile during getReferencedFilterPool() rather than returning broken reference * profile during getReferencedFilterPool() rather than returning broken reference
* David McKnight (IBM) - [358999] Deleting multiple connections takes long time * David McKnight (IBM) - [358999] Deleting multiple connections takes long time
* David McKnight (IBM) -[391132] filterpools don't persist when profile names end in _
*******************************************************************************/ *******************************************************************************/
package org.eclipse.rse.internal.core.filters; package org.eclipse.rse.internal.core.filters;
@ -116,10 +117,17 @@ public class SystemFilterPoolReference extends SystemPersistableReferencingObjec
* The filter pool manager name is the same as its owning profile. * The filter pool manager name is the same as its owning profile.
*/ */
String savedName = getReferencedObjectName(); String savedName = getReferencedObjectName();
String[] parts = savedName.split(DELIMITER, 2); String result = null;
String result = parts[0]; int lastDelim = savedName.lastIndexOf(DELIMITER);
if (parts.length == 2) { if (lastDelim > 0){
result = parts[1]; result = savedName.substring(lastDelim + DELIMITER_LENGTH);
}
else {
String[] parts = savedName.split(DELIMITER, 2);
result = parts[0];
if (parts.length == 2) {
result = parts[1];
}
} }
return result; return result;
} }
@ -136,15 +144,21 @@ public class SystemFilterPoolReference extends SystemPersistableReferencingObjec
*/ */
String result = null; String result = null;
String savedName = getReferencedObjectName(); String savedName = getReferencedObjectName();
String[] parts = savedName.split(DELIMITER, 2); int lastDelim = savedName.lastIndexOf(DELIMITER);
if (parts.length == 2) { if (lastDelim > 0){
result = parts[0]; result = savedName.substring(0, lastDelim);
} else { }
ISystemFilterPoolReferenceManagerProvider provider = getProvider(); else {
if (provider instanceof ISubSystem) { String[] parts = savedName.split(DELIMITER, 2);
ISubSystem subsystem = (ISubSystem) provider; if (parts.length == 2) {
ISystemProfile profile = subsystem.getSystemProfile(); result = parts[0];
result = profile.getName(); } else {
ISystemFilterPoolReferenceManagerProvider provider = getProvider();
if (provider instanceof ISubSystem) {
ISubSystem subsystem = (ISubSystem) provider;
ISystemProfile profile = subsystem.getSystemProfile();
result = profile.getName();
}
} }
} }
if (result == null) { if (result == null) {

View file

@ -1,5 +1,5 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2006, 2009 IBM Corporation and others. All rights reserved. * Copyright (c) 2006, 2012 IBM Corporation and others. 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
@ -27,6 +27,7 @@
* David McKnight (IBM) - [267052] need to be able to create subsystems-after-the-fact * David McKnight (IBM) - [267052] need to be able to create subsystems-after-the-fact
* David McKnight (IBM) - [271243] [files] Switching service type brings up TWO file subsystems after restart * David McKnight (IBM) - [271243] [files] Switching service type brings up TWO file subsystems after restart
* Uwe Stieber (Wind River) - [283844] NPE on restoring property set if persistent data is corrupted * Uwe Stieber (Wind River) - [283844] NPE on restoring property set if persistent data is corrupted
* David McKnight (IBM) -[391132] filterpools don't persist when profile names end in _
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.internal.persistence.dom; package org.eclipse.rse.internal.persistence.dom;
@ -516,9 +517,9 @@ public class RSEDOMImporter {
ISystemProfile profile = subsystem.getSystemProfile(); ISystemProfile profile = subsystem.getSystemProfile();
String profileName = profile.getName(); String profileName = profile.getName();
String baseFilterPoolName = filterPoolName; String baseFilterPoolName = filterPoolName;
filterPoolName = filterPoolName.substring(profileName.length()); // in case there's an underscore in the profile name
String[] part = filterPoolName.split("___", 2); //$NON-NLS-1$ String[] part = filterPoolName.split("___", 2); //$NON-NLS-1$
if (part.length == 2) { // name is qualified and refers to a filter pool in a specific profile if (part.length == 2) { // name is qualified and refers to a filter pool in a specific profile
profileName = part[0];
baseFilterPoolName = part[1]; baseFilterPoolName = part[1];
} }
// special processing for host owned pool references // special processing for host owned pool references