Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarsten Hammer2019-08-25 16:08:13 +0000
committerCarsten Hammer2019-10-17 19:05:04 +0000
commit5b0bf4dbb45c6797f70623f0b1a9e32a1543c6f5 (patch)
treeea447781d4600eed56f7d8672214b200d9c57086
parentcfc3136f2de3204b4daa4a8d101597cc6ef42524 (diff)
downloadorg.eclipse.ecf-5b0bf4dbb45c6797f70623f0b1a9e32a1543c6f5.tar.gz
org.eclipse.ecf-5b0bf4dbb45c6797f70623f0b1a9e32a1543c6f5.tar.xz
org.eclipse.ecf-5b0bf4dbb45c6797f70623f0b1a9e32a1543c6f5.zip
Manual array copy
Use Arrays.asList or System.arraycopy instead of copying array in a for loop Change-Id: I7fc9a0ae46d789b74e36f198bddfea0f0c681b4e Signed-off-by: Carsten Hammer <carsten.hammer@t-online.de>
-rw-r--r--framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/util/Trace.java3
-rw-r--r--framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/ContainerTypeDescription.java4
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.filetransfer/src/org/eclipse/ecf/internal/provider/filetransfer/Activator.java8
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.filetransfer/src/org/eclipse/ecf/provider/filetransfer/identity/FileTransferNamespace.java5
4 files changed, 6 insertions, 14 deletions
diff --git a/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/util/Trace.java b/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/util/Trace.java
index 9ec10c8af..3b90b2eb5 100644
--- a/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/util/Trace.java
+++ b/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/util/Trace.java
@@ -32,8 +32,7 @@ public class Trace {
if (tracePlugins != null)
try {
String[] plugins = tracePlugins.split(",");
- for (String s : plugins)
- TRACE_BUNDLES.add(s);
+ TRACE_BUNDLES.addAll(Arrays.asList(plugins));
} catch (Exception e) {
System.err
.println("Unexpected exception in Trace class static initializer");
diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/ContainerTypeDescription.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/ContainerTypeDescription.java
index 0efea0df7..c7fb7d0af 100644
--- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/ContainerTypeDescription.java
+++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/ContainerTypeDescription.java
@@ -168,9 +168,7 @@ public class ContainerTypeDescription {
traceAndLogException(IStatus.ERROR, "getSupportedAdapterTypes", e); //$NON-NLS-1$
}
List resultList = new ArrayList();
- for (int i = 0; i < result.length; i++) {
- resultList.add(result[i]);
- }
+ resultList.addAll(Arrays.asList(result));
if (!resultList.contains(IContainer.class.getName()))
resultList.add(IContainer.class.getName());
return (String[]) resultList.toArray(new String[] {});
diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer/src/org/eclipse/ecf/internal/provider/filetransfer/Activator.java b/providers/bundles/org.eclipse.ecf.provider.filetransfer/src/org/eclipse/ecf/internal/provider/filetransfer/Activator.java
index 131fbe473..f315fd670 100644
--- a/providers/bundles/org.eclipse.ecf.provider.filetransfer/src/org/eclipse/ecf/internal/provider/filetransfer/Activator.java
+++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer/src/org/eclipse/ecf/internal/provider/filetransfer/Activator.java
@@ -358,15 +358,11 @@ public class Activator implements BundleActivator, IFileTransferProtocolToFactor
protocols.add(protocol);
} else if (protocol instanceof String[]) {
final String[] ps = (String[]) protocol;
- for (String p : ps) {
- protocols.add(p);
- }
+ protocols.addAll(Arrays.asList(ps));
}
}
handlers.close();
- for (String jvmScheme : jvmSchemes) {
- protocols.add(jvmScheme);
- }
+ protocols.addAll(Arrays.asList(jvmSchemes));
return (String[]) protocols.toArray(new String[] {});
}
diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer/src/org/eclipse/ecf/provider/filetransfer/identity/FileTransferNamespace.java b/providers/bundles/org.eclipse.ecf.provider.filetransfer/src/org/eclipse/ecf/provider/filetransfer/identity/FileTransferNamespace.java
index 1a9429c33..967707037 100644
--- a/providers/bundles/org.eclipse.ecf.provider.filetransfer/src/org/eclipse/ecf/provider/filetransfer/identity/FileTransferNamespace.java
+++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer/src/org/eclipse/ecf/provider/filetransfer/identity/FileTransferNamespace.java
@@ -10,6 +10,7 @@ package org.eclipse.ecf.provider.filetransfer.identity;
import java.net.URI;
import java.net.URL;
+import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
import org.eclipse.ecf.core.identity.ID;
@@ -73,9 +74,7 @@ public class FileTransferNamespace extends Namespace {
public String[] getSupportedSchemes() {
Set result = new HashSet();
String[] platformSchemes = Activator.getDefault().getPlatformSupportedSchemes();
- for (String platformScheme : platformSchemes) {
- result.add(platformScheme);
- }
+ result.addAll(Arrays.asList(platformSchemes));
return (String[]) result.toArray(new String[] {});
}

Back to the top