diff options
author | rbrooks | 2010-09-14 16:54:49 +0000 |
---|---|---|
committer | Ryan D. Brooks | 2010-09-14 16:54:49 +0000 |
commit | 74225843949515181df78245bfcb31147a805ba9 (patch) | |
tree | 93f998f89457d9df6ef5ace11c6127216d56bb47 /plugins/org.eclipse.osee.framework.branch.management/src | |
parent | f0f991b4f728f2e7550016da91eb2e8d2c8c750c (diff) | |
download | org.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.branch.management/src')
14 files changed, 25 insertions, 27 deletions
diff --git a/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/change/ComputeNetChangeOperation.java b/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/change/ComputeNetChangeOperation.java index 14858243a01..cd3bf9df770 100644 --- a/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/change/ComputeNetChangeOperation.java +++ b/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/change/ComputeNetChangeOperation.java @@ -95,18 +95,17 @@ public class ComputeNetChangeOperation extends AbstractOperation { // check for case where destination branch is missing an artifact that was modified (not new) on the source branch if (!change.getDestinationVersion().isValid() && change.getBaselineVersion().isValid()) { throw new OseeStateException( - "This should be supported in the future - destination branch is not the source's parent: " + change); + "This should be supported in the future - destination branch is not the source's parent [%s]", change); } if (change.getDestinationVersion().isValid() && ChangeItemUtil.isDeleted(change.getDestinationVersion())) { - throw new OseeStateException("Destination was deleted - source should not modify: " + change); + throw new OseeStateException("Destination was deleted - source should not modify [%s] ", change); } if ((ChangeItemUtil.isIntroduced(change.getCurrentVersion()) || ChangeItemUtil.isNew(change.getCurrentVersion())) // && change.getDestinationVersion().isValid()) { - throw new OseeStateException( - "Source item marked as new/introduced but destination already has item: " + change); + throw new OseeStateException("Source item marked as new/introduced but destination already has item [%s]", + change); } - } -} +}
\ No newline at end of file diff --git a/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/change/ConflictUtil.java b/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/change/ConflictUtil.java index f4c36d207ba..b6c33f2c087 100644 --- a/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/change/ConflictUtil.java +++ b/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/change/ConflictUtil.java @@ -79,7 +79,7 @@ public final class ConflictUtil { } else if (item instanceof RelationChangeItem) { type = ConflictType.RELATION; } else { - throw new OseeArgumentException(String.format("Unable to convert change item [%s] to conflict type", item)); + throw new OseeArgumentException("Unable to convert change item [%s] to conflict type", item); } return type; } diff --git a/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/commit/CommitDbOperation.java b/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/commit/CommitDbOperation.java index 6d53e7e0597..854f60a0978 100644 --- a/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/commit/CommitDbOperation.java +++ b/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/commit/CommitDbOperation.java @@ -99,7 +99,7 @@ public class CommitDbOperation extends AbstractDbTxOperation { BranchState storedBranchState; this.connection = connection; if (changes.isEmpty()) { - throw new OseeStateException(" A branch can not be committed without any changes made."); + throw new OseeStateException("A branch can not be committed without any changes made."); } storedBranchState = sourceBranch.getBranchState(); checkPreconditions(); @@ -126,7 +126,7 @@ public class CommitDbOperation extends AbstractDbTxOperation { getDatabaseService().runPreparedQueryFetchObject(0, SELECT_SOURCE_BRANCH_STATE, sourceBranch.getId(), BranchState.COMMIT_IN_PROGRESS.getValue()); if (sourceBranch.getBranchState().equals(BranchState.COMMIT_IN_PROGRESS) || sourceBranch.getArchiveState().isArchived() || count > 0) { - throw new OseeStateException(String.format("Commit completed or in progress for [%s]", sourceBranch)); + throw new OseeStateException("Commit completed or in progress for [%s]", sourceBranch); } if (!sourceBranch.getBranchState().equals(BranchState.COMMITTED)) { diff --git a/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/creation/CreateBranchOperation.java b/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/creation/CreateBranchOperation.java index d8f7f4e71df..cfe63bea499 100644 --- a/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/creation/CreateBranchOperation.java +++ b/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/creation/CreateBranchOperation.java @@ -108,8 +108,8 @@ public class CreateBranchOperation extends AbstractDbTxOperation { if (request.getBranchType().isMergeBranch()) { if (getDatabaseService().runPreparedQueryFetchObject(0, TEST_MERGE_BRANCH_EXISTENCE, parentBranch.getId(), destinationBranch.getId()) > 0) { - throw new OseeStateException(String.format("Existing merge branch detected for [%s] and [%s]", - parentBranch.getName(), destinationBranch.getName())); + throw new OseeStateException("Existing merge branch detected for [%s] and [%s]", parentBranch.getName(), + destinationBranch.getName()); } } else if (!request.getBranchType().isSystemRootBranch()) { int associatedArtifactId = request.getAssociatedArtifactId(); @@ -120,8 +120,7 @@ public class CreateBranchOperation extends AbstractDbTxOperation { "select (1) from osee_branch where associated_art_id=? and branch_state <> ?", request.getAssociatedArtifactId(), BranchState.DELETED.getValue()); if (count > 0) { - throw new OseeStateException(String.format("Existing branch creation detected for [%s]", - request.getBranchName())); + throw new OseeStateException("Existing branch creation detected for [%s]", request.getBranchName()); } } } diff --git a/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/exchange/ExchangeDb.java b/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/exchange/ExchangeDb.java index bb88bfa4ec2..e20e890f36c 100644 --- a/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/exchange/ExchangeDb.java +++ b/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/exchange/ExchangeDb.java @@ -21,6 +21,7 @@ import org.eclipse.osee.framework.branch.management.exchange.export.DbTableExpor import org.eclipse.osee.framework.branch.management.exchange.export.ManifestExportItem; import org.eclipse.osee.framework.branch.management.exchange.export.MetadataExportItem; import org.eclipse.osee.framework.branch.management.exchange.handler.ExportItem; +import org.eclipse.osee.framework.core.exception.OseeArgumentException; import org.eclipse.osee.framework.database.IOseeDatabaseService; import org.eclipse.osee.framework.database.core.IOseeSequence; import org.eclipse.osee.framework.jdk.core.type.Pair; @@ -205,7 +206,7 @@ public class ExchangeDb { } } if (minTxs > maxTxs) { - throw new Exception(String.format("Invalid transaction range: min - %d > max - %d", minTxs, maxTxs)); + throw new OseeArgumentException("Invalid transaction range: min - %d > max - %d", minTxs, maxTxs); } return new Pair<String, Object[]>(String.format(originalQuery, optionString), diff --git a/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/exchange/ImportController.java b/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/exchange/ImportController.java index 618ae0ffa3f..344cd766864 100644 --- a/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/exchange/ImportController.java +++ b/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/exchange/ImportController.java @@ -199,7 +199,7 @@ public final class ImportController { private MetaData checkMetadata(IExportItem importFile) throws OseeArgumentException { MetaData metadata = metadataHandler.getMetadata(importFile.getSource()); if (metadata == null) { - throw new OseeArgumentException(String.format("Invalid metadata for [%s]", importFile.getSource())); + throw new OseeArgumentException("Invalid metadata for [%s]", importFile.getSource()); } return metadata; } diff --git a/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/exchange/handler/BranchDataSaxHandler.java b/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/exchange/handler/BranchDataSaxHandler.java index c3e21f689a1..23e2fc33617 100644 --- a/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/exchange/handler/BranchDataSaxHandler.java +++ b/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/exchange/handler/BranchDataSaxHandler.java @@ -103,9 +103,9 @@ public class BranchDataSaxHandler extends BaseDbSaxHandler { private void checkSelectedBranches(int... branchesToImport) throws OseeDataStoreException { if (branchesToImport != null && branchesToImport.length > 0) { if (!areAvailable(branchesToImport)) { - throw new OseeDataStoreException(String.format( + throw new OseeDataStoreException( "Branches not found in import file:\n\t\t- selected to import: [%s]\n\t\t- in import file: [%s]", - branchesToImport, getAllBranchDataFromImportFile())); + branchesToImport, getAllBranchDataFromImportFile()); } } } diff --git a/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/exchange/handler/DataToSql.java b/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/exchange/handler/DataToSql.java index 9dfc758af9d..056e47527b2 100644 --- a/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/exchange/handler/DataToSql.java +++ b/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/exchange/handler/DataToSql.java @@ -80,9 +80,9 @@ public class DataToSql { Method mainMethod = clazz.getMethod("valueOf", new Class[] {Object.class}); convertedObject = mainMethod.invoke(null, value); } catch (Exception ex1) { - throw new OseeArgumentException(String.format( + throw new OseeArgumentException( "Unable to convert from string to object for - attribute [%s] to class [%s]", columnName, - clazz.getName())); + clazz.getName()); } } } else { diff --git a/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/exchange/handler/DbTableSaxHandler.java b/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/exchange/handler/DbTableSaxHandler.java index fb3c12ee51d..c250e04c70d 100644 --- a/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/exchange/handler/DbTableSaxHandler.java +++ b/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/exchange/handler/DbTableSaxHandler.java @@ -85,8 +85,7 @@ public class DbTableSaxHandler extends BaseDbSaxHandler { transferredBinaryContent.add(locator); return locator.getLocation().toASCIIString(); } else { - throw new OseeStateException(String.format( - "Unable to locate resource in zip file - ZipEntry was null for [%s]", uriValue)); + throw new OseeStateException("Unable to locate resource in zip file - ZipEntry was null for [%s]", uriValue); } } else { throw new OseeStateException("Uncompressed folder was Null."); diff --git a/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/exchange/resource/ExchangeLocatorProvider.java b/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/exchange/resource/ExchangeLocatorProvider.java index b7e9b6252f4..4d9ec1b8183 100644 --- a/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/exchange/resource/ExchangeLocatorProvider.java +++ b/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/exchange/resource/ExchangeLocatorProvider.java @@ -45,7 +45,7 @@ public class ExchangeLocatorProvider implements IResourceLocatorProvider { throw new MalformedLocatorException(ex); } } else { - throw new MalformedLocatorException(String.format("Invalid path hint: [%s]", path)); + throw new MalformedLocatorException("Invalid path hint: [%s]", path); } return new ResourceLocator(uri); } diff --git a/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/exchange/resource/ExchangeProvider.java b/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/exchange/resource/ExchangeProvider.java index 5ef072fb710..74dbc2b3b4d 100644 --- a/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/exchange/resource/ExchangeProvider.java +++ b/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/exchange/resource/ExchangeProvider.java @@ -120,7 +120,7 @@ public class ExchangeProvider implements IResourceProvider { Lib.close(inputStream); } if (toReturn == null) { - throw new OseeStateException(String.format("We failed to save resource %s.", locator.getLocation())); + throw new OseeStateException("We failed to save resource %s.", locator.getLocation()); } return toReturn; } diff --git a/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/exchange/transform/ExchangeDataProcessor.java b/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/exchange/transform/ExchangeDataProcessor.java index c934f4dac0d..ae67acf5dfb 100644 --- a/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/exchange/transform/ExchangeDataProcessor.java +++ b/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/exchange/transform/ExchangeDataProcessor.java @@ -91,7 +91,7 @@ public final class ExchangeDataProcessor { private void renameExportItem(File original, File destination) throws OseeCoreException { boolean wasSuccessful = original.renameTo(destination); if (!wasSuccessful) { - throw new OseeStateException(String.format("Error renaming [%s] to [%s]", original, destination)); + throw new OseeStateException("Error renaming [%s] to [%s]", original, destination); } } diff --git a/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/exchange/transform/V0_9_2Transformer.java b/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/exchange/transform/V0_9_2Transformer.java index e97106d196d..f060b243966 100644 --- a/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/exchange/transform/V0_9_2Transformer.java +++ b/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/exchange/transform/V0_9_2Transformer.java @@ -175,7 +175,7 @@ public class V0_9_2Transformer implements IOseeExchangeVersionTransformer { private ModificationType[] getNextPossibleStates(ModificationType state) throws OseeStateException { ModificationType[] nextAllowed = allowedStates.get(state); if (nextAllowed == null) { - throw new OseeStateException(String.format("Unexcepted modification type [%s]", state.toString())); + throw new OseeStateException("Unexcepted modification type [%s]", state.toString()); } return nextAllowed; } diff --git a/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/purge/PurgeBranchOperation.java b/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/purge/PurgeBranchOperation.java index d4c04138d22..45bd443f625 100644 --- a/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/purge/PurgeBranchOperation.java +++ b/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/purge/PurgeBranchOperation.java @@ -80,8 +80,8 @@ public class PurgeBranchOperation extends AbstractDbTxOperation { oseeDatabaseProvider.getOseeDatabaseService().runPreparedQueryFetchObject(0, COUNT_CHILD_BRANCHES, branch.getId()); if (numberOfChildren > 0) { - throw new OseeArgumentException(String.format("Unable to purge a branch containing children: branchId[%s]", - branch.getId())); + throw new OseeArgumentException("Unable to purge a branch containing children: branchId[%s]", + branch.getId()); } boolean isAddressingArchived = |