Author: dgeraskov
Date: 2010-12-10 09:21:20 -0500 (Fri, 10 Dec 2010)
New Revision: 27354
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenXMLFactory.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConnectionProfileUtil.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/preferences/PreferencesClassPathUtils.java
Log:
https://issues.jboss.org/browse/JBIDE-7739
code improvements
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConnectionProfileUtil.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConnectionProfileUtil.java 2010-12-10
14:10:44 UTC (rev 27353)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConnectionProfileUtil.java 2010-12-10
14:21:20 UTC (rev 27354)
@@ -57,12 +57,12 @@
/*
* try get a path to the sql driver jar file from DTP connection profile
*/
- public static String getConnectionProfileDriverURL(String connectionProfile) {
+ public static String[] getConnectionProfileDriverURL(String connectionProfile) {
DriverInstance di = getDriverDefinition(connectionProfile);
if (di == null) {
return null;
}
- return di.getJarList();
+ return di.getJarListAsArray();
}
public static String getDriverClass(String connectionProfile) {
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/preferences/PreferencesClassPathUtils.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/preferences/PreferencesClassPathUtils.java 2010-12-10
14:10:44 UTC (rev 27353)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/preferences/PreferencesClassPathUtils.java 2010-12-10
14:21:20 UTC (rev 27354)
@@ -27,16 +27,14 @@
URL[] customClassPathURLsTmp = prefs == null ? new URL[0] :
prefs.getCustomClassPathURLS();
URL[] customClassPathURLs = null;
- String driverURL = prefs == null ? null :
- ConnectionProfileUtil.getConnectionProfileDriverURL(prefs.getConnectionProfileName());
+ String[] driverURLParts =
ConnectionProfileUtil.getConnectionProfileDriverURL(prefs.getConnectionProfileName());
URL[] urls = null;
- if (driverURL != null) {
- String[] driverURLParts = driverURL.split(";"); //$NON-NLS-1$
+ if (driverURLParts != null) {
urls = new URL[driverURLParts.length];
for (int i = 0; i < driverURLParts.length; i++) {
File file = new File(driverURLParts[i].trim());
try {
- urls[i] = file.toURL();
+ urls[i] = file.toURI().toURL();
} catch (MalformedURLException e) {
urls[i] = null;
}
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenXMLFactory.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenXMLFactory.java 2010-12-10
14:10:44 UTC (rev 27353)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenXMLFactory.java 2010-12-10
14:21:20 UTC (rev 27354)
@@ -476,14 +476,6 @@
return location;
}
- public String getConnectionProfileDriverURL(String connectionProfile) {
- String driverURL =
ConnectionProfileUtil.getConnectionProfileDriverURL(connectionProfile);
- if (driverURL == null) {
- driverURL = ""; //$NON-NLS-1$
- }
- return driverURL;
- }
-
public static boolean isEmpty(String str) {
return (str == null || str.length() == 0);
}