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/ui/dialogs/DriverDialog.java (-4 / +10 lines)
Lines 135-140 Link Here
135
135
136
		public void stateChanged(ChangeEvent arg0) {
136
		public void stateChanged(ChangeEvent arg0) {
137
			boolean flag = isValid(true);
137
			boolean flag = isValid(true);
138
			validateName();
138
			if (DriverDialog.this.mOKButton != null && !DriverDialog.this.mOKButton.isDisposed())
139
			if (DriverDialog.this.mOKButton != null && !DriverDialog.this.mOKButton.isDisposed())
139
				DriverDialog.this.mOKButton.setEnabled(flag);			
140
				DriverDialog.this.mOKButton.setEnabled(flag);			
140
		}
141
		}
Lines 848-858 Link Here
848
						throw e;
849
						throw e;
849
				}
850
				}
850
851
851
			if (this.mOKButton != null)
852
			if (this.mOKButton != null && !this.mOKButton.isDisposed())
852
				this.mOKButton.setEnabled(flag);
853
				this.mOKButton.setEnabled(flag);
853
		}
854
		}
854
		else {
855
		else {
855
			if (this.mOKButton != null)
856
			if (this.mOKButton != null && !this.mOKButton.isDisposed())
856
				this.mOKButton.setEnabled(false);
857
				this.mOKButton.setEnabled(false);
857
			return false;
858
			return false;
858
		}
859
		}
Lines 1015-1021 Link Here
1015
				// creating new driver, name matches existing driver
1016
				// creating new driver, name matches existing driver
1016
				String errorMessage = DriverMgmtMessages
1017
				String errorMessage = DriverMgmtMessages
1017
					.getString("NewDriverDialog.driverExistsWithName"); //$NON-NLS-1$
1018
					.getString("NewDriverDialog.driverExistsWithName"); //$NON-NLS-1$
1018
				this.setErrorMessage(errorMessage);
1019
				try {
1020
					this.setErrorMessage(errorMessage);
1021
				} catch (SWTException swt_e) {
1022
					// just in case the message widget is disposed, since we can't grab
1023
					// it directly
1024
				}
1019
				return;
1025
				return;
1020
			}
1026
			}
1021
			else {
1027
			else {
Lines 1056-1062 Link Here
1056
			isOk = isValid(true);
1062
			isOk = isValid(true);
1057
		}
1063
		}
1058
1064
1059
		if (this.mOKButton != null)
1065
		if (this.mOKButton != null && !this.mOKButton.isDisposed())
1060
			this.mOKButton.setEnabled(isOk);
1066
			this.mOKButton.setEnabled(isOk);
1061
	}
1067
	}
1062
1068
(-)src/org/eclipse/datatools/connectivity/drivers/DriverManager.java (-1 / +1 lines)
Lines 348-354 Link Here
348
			pset.setName(name);
348
			pset.setName(name);
349
		String prefix = DriverMgmtMessages
349
		String prefix = DriverMgmtMessages
350
				.getString("NewDriverDialog.text.id_prefix"); //$NON-NLS-1$
350
				.getString("NewDriverDialog.text.id_prefix"); //$NON-NLS-1$
351
		String id = prefix + name;
351
		String id = prefix + templateID + name;
352
		pset.setID(id);
352
		pset.setID(id);
353
		Properties props = pset.getBaseProperties();
353
		Properties props = pset.getBaseProperties();
354
		if (jarList != null)
354
		if (jarList != null)
(-)src/org/eclipse/datatools/connectivity/internal/ConnectionProfileMgmt.java (-4 / +20 lines)
Lines 624-638 Link Here
624
					Properties props = keysElementsToProperties((Element) extNode);
624
					Properties props = keysElementsToProperties((Element) extNode);
625
					String driverName = props.getProperty(DRIVERNAMEATTR);
625
					String driverName = props.getProperty(DRIVERNAMEATTR);
626
					String driverTypeID = props.getProperty(DRIVERTYPEIDATTR);
626
					String driverTypeID = props.getProperty(DRIVERTYPEIDATTR);
627
					String driverID = "";
627
					
628
					
628
					if (DriverManager.getInstance().getDriverInstanceByName(driverName) != null) {
629
					// Bug 240433 - brianf
630
					// Issue with importing 2 profiles with same driver ID but from different exports
631
					boolean existingDriverHasName = false;
632
					DriverInstance testDI = DriverManager.getInstance().getDriverInstanceByName(driverName);
633
					if (testDI != null) {
629
						// we found the driver, so we're ok to continue
634
						// we found the driver, so we're ok to continue
635
						if (testDI.getTemplate().getId().equalsIgnoreCase(driverTypeID)) {
636
							// the driver with the same name happens to have the same template ID, so we should be ok
637
							existingDriverHasName = true;
638
						}
630
					}
639
					}
631
					else {
640
					if (testDI == null || existingDriverHasName) {
641
//					if (testDI != null) {
642
						// we found the driver, so we're ok to continue
643
//					}
644
//					else {
632
						DriverInstance di = DriverManager.getInstance().createNewDriverInstance(driverTypeID, driverName, new String());
645
						DriverInstance di = DriverManager.getInstance().createNewDriverInstance(driverTypeID, driverName, new String());
633
						if (di != null) {
646
						if (di != null) {
634
							String driverID = di.getId();
647
							driverID = di.getId();
635
							cp.getBaseProperties().setProperty(ConnectionProfileConstants.PROP_DRIVER_DEFINITION_ID, driverID);
648
							
649
							Properties baseProps = cp.getBaseProperties();
650
							baseProps.setProperty(ConnectionProfileConstants.PROP_DRIVER_DEFINITION_ID, driverID);
651
							cp.setBaseProperties(baseProps);
636
							
652
							
637
							// This section is to fix BZ 213258 -- brianf
653
							// This section is to fix BZ 213258 -- brianf
638
							String jarList =
654
							String jarList =

Return to bug 240433