Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrbrooks2010-09-14 12:54:49 -0400
committerRyan D. Brooks2010-09-14 12:54:49 -0400
commit74225843949515181df78245bfcb31147a805ba9 (patch)
tree93f998f89457d9df6ef5ace11c6127216d56bb47 /plugins/org.eclipse.osee.framework.database
parentf0f991b4f728f2e7550016da91eb2e8d2c8c750c (diff)
downloadorg.eclipse.osee-74225843949515181df78245bfcb31147a805ba9.tar.gz
org.eclipse.osee-74225843949515181df78245bfcb31147a805ba9.tar.xz
org.eclipse.osee-74225843949515181df78245bfcb31147a805ba9.zip
refactor: Directly support String.format in OseeCoreException constructors
Diffstat (limited to 'plugins/org.eclipse.osee.framework.database')
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/SupportedDatabase.java2
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/DatabaseInfoProvider.java4
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/ConnectionFactoryProvider.java2
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/OseeConnectionPoolImpl.java3
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/OseeDatabaseServiceImpl.java2
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/StatementUtil.java4
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/operation/ConsolidateArtifactVersionTxOperation.java4
7 files changed, 11 insertions, 10 deletions
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/SupportedDatabase.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/SupportedDatabase.java
index a44632029f..618f666860 100644
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/SupportedDatabase.java
+++ b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/SupportedDatabase.java
@@ -39,7 +39,7 @@ public enum SupportedDatabase {
} else if (lowerCaseName.contains(SupportedDatabase.postgresql.toString())) {
toReturn = SupportedDatabase.postgresql;
} else {
- throw new OseeDataStoreException("Unsupported database type: " + dbName);
+ throw new OseeDataStoreException("Unsupported database type [%s] ", dbName);
}
} catch (SQLException ex) {
OseeExceptions.wrapAndThrow(ex);
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/DatabaseInfoProvider.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/DatabaseInfoProvider.java
index 2cdfc1363c..39e368959a 100644
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/DatabaseInfoProvider.java
+++ b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/DatabaseInfoProvider.java
@@ -81,8 +81,8 @@ public class DatabaseInfoProvider {
} finally {
tracker.close();
}
- throw new OseeDataStoreException(String.format(
+ throw new OseeDataStoreException(
"DB connection information was not found for: [%s]\n Available connection ids are: [%s]\n", serverIdToFind,
- infoKeys));
+ infoKeys);
}
}
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/ConnectionFactoryProvider.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/ConnectionFactoryProvider.java
index 4078b6e711..e5a2b11975 100644
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/ConnectionFactoryProvider.java
+++ b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/ConnectionFactoryProvider.java
@@ -46,6 +46,6 @@ public class ConnectionFactoryProvider {
} finally {
serviceTracker.close();
}
- throw new OseeNotFoundException(String.format("Unable to find connection factory with driver [%s]", driver));
+ throw new OseeNotFoundException("Unable to find connection factory with driver [%s]", driver);
}
}
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/OseeConnectionPoolImpl.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/OseeConnectionPoolImpl.java
index 84a16a28cc..ac7a12f71b 100644
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/OseeConnectionPoolImpl.java
+++ b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/OseeConnectionPoolImpl.java
@@ -69,7 +69,8 @@ public class OseeConnectionPoolImpl {
if (connections.size() >= MAX_CONNECTIONS_PER_CLIENT) {
throw new OseeDataStoreException(
- "This client has reached the maximum number of allowed simultaneous database connections of : " + MAX_CONNECTIONS_PER_CLIENT);
+ "This client has reached the maximum number of allowed simultaneous database connections of %d.",
+ MAX_CONNECTIONS_PER_CLIENT);
}
OseeConnectionImpl connection = getOseeConnection();
connections.add(connection);
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/OseeDatabaseServiceImpl.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/OseeDatabaseServiceImpl.java
index e41f76905a..69e06d75ee 100644
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/OseeDatabaseServiceImpl.java
+++ b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/OseeDatabaseServiceImpl.java
@@ -160,7 +160,7 @@ public class OseeDatabaseServiceImpl implements IOseeDatabaseService {
OseeLog.log(Activator.class, Level.SEVERE, "This is the nested exception", exlist);
}
throw new OseeCoreException(
- "sql update failed: \n" + query + "\n" + StatementUtil.getBatchErrorMessage(dataList), ex);
+ "sql update failed: \n%s\n%s", query, StatementUtil.getBatchErrorMessage(dataList), ex);
} finally {
StatementUtil.close(preparedStatement);
}
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/StatementUtil.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/StatementUtil.java
index 16edb6c9d5..42df248092 100644
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/StatementUtil.java
+++ b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/StatementUtil.java
@@ -92,8 +92,8 @@ public class StatementUtil {
if (dataValue instanceof String) {
int length = ((String) dataValue).length();
if (length > 4000) {
- throw new OseeDataStoreException(
- "SQL data value length must be <= 4000 not " + length + "\nValue: " + dataValue);
+ throw new OseeDataStoreException("SQL data value length must be <= 4000 not %d\nValue: %s", length,
+ dataValue);
}
}
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/operation/ConsolidateArtifactVersionTxOperation.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/operation/ConsolidateArtifactVersionTxOperation.java
index 18e548ed81..2f164050e6 100644
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/operation/ConsolidateArtifactVersionTxOperation.java
+++ b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/operation/ConsolidateArtifactVersionTxOperation.java
@@ -270,7 +270,7 @@ public class ConsolidateArtifactVersionTxOperation extends AbstractDbTxOperation
ModificationType.MERGED)) {
addToUpdateAddresssing(modType, netGammaId, modType, transactionId, obsoleteGammaId);
} else {
- throw new OseeStateException("unexpected mod type: " + modType);
+ throw new OseeStateException("unexpected mod type [%s]", modType);
}
} else {
if (modType.matches(ModificationType.NEW, ModificationType.INTRODUCED, ModificationType.MODIFIED)) {
@@ -280,7 +280,7 @@ public class ConsolidateArtifactVersionTxOperation extends AbstractDbTxOperation
addToUpdateAddresssing(modType, netGammaId, modType, transactionId, obsoleteGammaId);
}
} else {
- throw new OseeStateException("unexpected mod type: " + modType);
+ throw new OseeStateException("unexpected mod type [%s]", modType);
}
}

Back to the top