Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/processing/Counter.java')
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/processing/Counter.java17
1 files changed, 11 insertions, 6 deletions
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/processing/Counter.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/processing/Counter.java
index eb524b293..d24ef622c 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/processing/Counter.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/processing/Counter.java
@@ -62,12 +62,17 @@ public class Counter extends ProcessingStep {
if (data == null)
return;
try {
- if (data.equals("download"))
- size = Long.parseLong(context.getProperty(IArtifactDescriptor.DOWNLOAD_SIZE));
- else if (data.equals("artifact"))
- size = Long.parseLong(context.getProperty(IArtifactDescriptor.ARTIFACT_SIZE));
- else
- size = Long.parseLong(data);
+ switch (data) {
+ case "download":
+ size = Long.parseLong(context.getProperty(IArtifactDescriptor.DOWNLOAD_SIZE));
+ break;
+ case "artifact":
+ size = Long.parseLong(context.getProperty(IArtifactDescriptor.ARTIFACT_SIZE));
+ break;
+ default:
+ size = Long.parseLong(data);
+ break;
+ }
} catch (NumberFormatException e) {
int code = descriptor.isRequired() ? IStatus.ERROR : IStatus.INFO;
setStatus(new Status(code, Activator.ID, "Counter size specification invalid", e));

Back to the top