Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 240433 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/datatools/connectivity/internal/InternalProfileManager.java (-8 / +35 lines)
Lines 54-59 Link Here
54
import org.eclipse.datatools.connectivity.ProfileManager;
54
import org.eclipse.datatools.connectivity.ProfileManager;
55
import org.eclipse.datatools.connectivity.drivers.DriverInstance;
55
import org.eclipse.datatools.connectivity.drivers.DriverInstance;
56
import org.eclipse.datatools.connectivity.drivers.DriverManager;
56
import org.eclipse.datatools.connectivity.drivers.DriverManager;
57
import org.eclipse.datatools.connectivity.drivers.DriverValidator;
57
import org.eclipse.datatools.connectivity.internal.repository.IConnectionProfileRepository;
58
import org.eclipse.datatools.connectivity.internal.repository.IConnectionProfileRepository;
58
import org.osgi.framework.Bundle;
59
import org.osgi.framework.Bundle;
59
import org.osgi.framework.BundleException;
60
import org.osgi.framework.BundleException;
Lines 1317-1332 Link Here
1317
1318
1318
		String defName = inName;
1319
		String defName = inName;
1319
1320
1320
		DriverInstance driverInstance = DriverManager.getInstance().getDriverInstanceByID(driverTemplateID);
1321
		/* 
1321
		if (driverInstance != null) {
1322
		 * Let's first see if we can find a valid instance of this driver template 
1322
			// jarList is not required, so it can be null, which isn't going to match any jarList coming back from a DriverInstance
1323
		 * with the same name and jar list. That would narrow things down.
1323
			if ((jarList == null) || (driverInstance.getJarList().equals(jarList))) {
1324
		 */
1324
				return driverInstance;
1325
		DriverInstance[] dilist = DriverManager.getInstance().getDriverInstancesByTemplate(driverTemplateID);
1326
		if (dilist != null && dilist.length > 0 ) {
1327
			for (int i = 0; i < dilist.length; i++) {
1328
				DriverInstance driverInstance = dilist[i];
1329
				if (driverInstance != null) {
1330
					// jarList is not required, so it can be null, which isn't going to match any jarList coming back from a DriverInstance
1331
					if ((jarList == null) || (driverInstance.getJarList().equals(jarList))) {
1332
						DriverValidator validator = new DriverValidator(driverInstance);
1333
						if (validator.isValid()) {
1334
							if (driverInstance.getName().equals(inName)) {
1335
								return driverInstance;
1336
							}
1337
						}
1338
					}
1339
						
1340
				}
1325
			}
1341
			}
1326
			 
1342
			/*
1327
			defName = determineUniqueDriverName(defName);
1343
			 * If we found drivers of that driver type, but didn't match on the
1328
				
1344
			 * jar list, name, or valid property set, then let's do a final check
1345
			 * to see if we find one with the same name (obviously something's not 
1346
			 * right with it) and create a new version with a unique name if we
1347
			 * find one.
1348
			 */
1349
			if (DriverManager.getInstance().getDriverInstanceByName(defName) != null)
1350
				defName = determineUniqueDriverName(defName);
1329
		}
1351
		}
1352
		
1353
		/*
1354
		 * Now we'll create it (with the original name if we didn't even get close,
1355
		 * or with the unique name if we did. 
1356
		 */
1330
		return DriverManager.getInstance()
1357
		return DriverManager.getInstance()
1331
			.createNewDriverInstance(
1358
			.createNewDriverInstance(
1332
				driverTemplateID,
1359
				driverTemplateID,

Return to bug 240433