Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrbrooks2010-09-14 16:54:49 +0000
committerRyan D. Brooks2010-09-14 16:54:49 +0000
commit74225843949515181df78245bfcb31147a805ba9 (patch)
tree93f998f89457d9df6ef5ace11c6127216d56bb47 /plugins/org.eclipse.osee.define
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.define')
-rw-r--r--plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/blam/operation/PublishRequirements.java4
-rw-r--r--plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/relation/Import/RelationImporter.java2
-rw-r--r--plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/ImportTraceabilityOperation.java4
-rw-r--r--plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/blam/RemoveTraceMarksFromTraceUnits.java4
-rw-r--r--plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/operations/TraceUnitFromResourceOperation.java10
5 files changed, 12 insertions, 12 deletions
diff --git a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/blam/operation/PublishRequirements.java b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/blam/operation/PublishRequirements.java
index 24138203a2a..8d28d7a05ce 100644
--- a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/blam/operation/PublishRequirements.java
+++ b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/blam/operation/PublishRequirements.java
@@ -109,8 +109,8 @@ public class PublishRequirements extends AbstractBlam {
if (publishAsDiff) {
if (branch == null || date == null && !useBaselineTransaction) {
- throw new OseeCoreException(
- "Must Select a " + branch == null ? "Branch" : "Date" + " to diff against when publishing as Diff");
+ throw new OseeCoreException("Must Select a %s to diff against when publishing as Diff",
+ branch == null ? "Branch" : "Date");
}
}
TransactionDelta txDelta = createTransactionDelta(branch);
diff --git a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/relation/Import/RelationImporter.java b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/relation/Import/RelationImporter.java
index 63e0d72e5fa..0c1c5205972 100644
--- a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/relation/Import/RelationImporter.java
+++ b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/relation/Import/RelationImporter.java
@@ -108,7 +108,7 @@ public class RelationImporter implements RowProcessor {
if (soleArtifact) {
soleArtifact = false;
} else {
- throw new OseeArgumentException("Found more than one match for: " + artifact);
+ throw new OseeArgumentException("Found more than one match for [%s]", artifact);
}
artifactResult = artifact;
}
diff --git a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/ImportTraceabilityOperation.java b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/ImportTraceabilityOperation.java
index 42d2e383502..e9ae4e392bf 100644
--- a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/ImportTraceabilityOperation.java
+++ b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/ImportTraceabilityOperation.java
@@ -91,7 +91,7 @@ public class ImportTraceabilityOperation extends AbstractOperation {
} else if (file.isDirectory()) {
handleDirectory(file);
} else {
- throw new OseeStateException(String.format("Invalid path [%s]", file.getCanonicalPath()));
+ throw new OseeStateException("Invalid path [%s]", file.getCanonicalPath());
}
checkForCancelledStatus(monitor);
@@ -110,7 +110,7 @@ public class ImportTraceabilityOperation extends AbstractOperation {
private void handleDirectory(File directory) throws IOException, OseeCoreException {
if (directory == null || directory.getParentFile() == null) {
- throw new OseeArgumentException("The path " + directory + " is invalid.");
+ throw new OseeArgumentException("The path [%s] is invalid.", directory);
}
pathPrefixLength = directory.getParentFile().getAbsolutePath().length();
diff --git a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/blam/RemoveTraceMarksFromTraceUnits.java b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/blam/RemoveTraceMarksFromTraceUnits.java
index aa09342cce6..bced0239dbd 100644
--- a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/blam/RemoveTraceMarksFromTraceUnits.java
+++ b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/blam/RemoveTraceMarksFromTraceUnits.java
@@ -109,11 +109,11 @@ public class RemoveTraceMarksFromTraceUnits extends AbstractBlam {
private void checkPath(String filePath, String type) throws OseeArgumentException {
if (!Strings.isValid(filePath)) {
- throw new OseeArgumentException(String.format("Please enter a valid %s path", type));
+ throw new OseeArgumentException("Please enter a valid %s path", type);
}
File file = new File(filePath);
if (file == null || !file.exists()) {
- throw new OseeArgumentException(String.format("%s path [%s] is not accessible", type, filePath));
+ throw new OseeArgumentException("%s path [%s] is not accessible", type, filePath);
}
}
diff --git a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/operations/TraceUnitFromResourceOperation.java b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/operations/TraceUnitFromResourceOperation.java
index 58ca2da5bcc..6bd57e72e4f 100644
--- a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/operations/TraceUnitFromResourceOperation.java
+++ b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/operations/TraceUnitFromResourceOperation.java
@@ -88,7 +88,7 @@ public class TraceUnitFromResourceOperation {
Set<String> ids = getTraceUnitHandlerIds();
List<String> notFound = Collections.setComplement(Arrays.asList(traceUnitHandlerIds), ids);
if (!notFound.isEmpty()) {
- throw new OseeArgumentException(String.format("Invalid test unit trace id(s) [%s]", notFound));
+ throw new OseeArgumentException("Invalid test unit trace id(s) [%s]", notFound);
}
} catch (Exception ex) {
OseeExceptions.wrapAndThrow(ex);
@@ -103,10 +103,10 @@ public class TraceUnitFromResourceOperation {
IFileStore fileStore = EFS.getStore(source);
IFileInfo fileInfo = fileStore.fetchInfo();
if (!fileInfo.exists()) {
- throw new OseeArgumentException(String.format("Unable to access source: [%s]", source));
+ throw new OseeArgumentException("Unable to access source: [%s]", source);
}
} catch (CoreException ex) {
- throw new OseeArgumentException(String.format("Unable to access source: [%s]", source));
+ throw new OseeArgumentException("Unable to access source: [%s]", source);
}
}
@@ -115,8 +115,8 @@ public class TraceUnitFromResourceOperation {
throw new OseeArgumentException("Branch to import into was null");
}
if (!importToBranch.getBranchType().isOfType(BranchType.WORKING)) {
- throw new OseeArgumentException(String.format("Branch to import into was not a working branch: [%s]",
- importToBranch));
+ throw new OseeArgumentException("Branch to import into was not a working branch: [%s]",
+ importToBranch);
}
}
}

Back to the top