Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarsten Hammer2019-07-05 14:45:43 -0400
committerCarsten Hammer2019-07-14 14:52:24 -0400
commitcd64087a195b97ef7ca3262e7e63d8f49d2daab0 (patch)
treebc84d0d6470271c65aa31a82b4fe433945211d84
parent121f1d84c24ef0a0e125f8f03880405e511214a6 (diff)
downloadrt.equinox.bundles-cd64087a195b97ef7ca3262e7e63d8f49d2daab0.tar.gz
rt.equinox.bundles-cd64087a195b97ef7ca3262e7e63d8f49d2daab0.tar.xz
rt.equinox.bundles-cd64087a195b97ef7ca3262e7e63d8f49d2daab0.zip
Replace most simple uses of Iterator with a corresponding for-each-loop. Also add missing braces on loops as necessary. Change-Id: If67941f0cc43945b1842ed3dfe545094470ea9a7 Signed-off-by: Carsten Hammer <carsten.hammer@t-online.de>
-rw-r--r--bundles/org.eclipse.equinox.servletbridge/META-INF/MANIFEST.MF2
-rw-r--r--bundles/org.eclipse.equinox.servletbridge/pom.xml4
-rw-r--r--bundles/org.eclipse.equinox.servletbridge/src/org/eclipse/equinox/servletbridge/CloseableURLClassLoader.java24
-rw-r--r--bundles/org.eclipse.equinox.servletbridge/src/org/eclipse/equinox/servletbridge/FrameworkLauncher.java17
-rw-r--r--bundles/org.eclipse.equinox.transforms.hook/META-INF/MANIFEST.MF2
-rw-r--r--bundles/org.eclipse.equinox.transforms.hook/pom.xml4
-rw-r--r--bundles/org.eclipse.equinox.transforms.hook/src/org/eclipse/equinox/internal/transforms/TransformInstanceListData.java15
-rw-r--r--bundles/org.eclipse.equinox.transforms.hook/src/org/eclipse/equinox/internal/transforms/TransformedBundleFile.java9
-rw-r--r--bundles/org.eclipse.equinox.transforms.hook/src/org/eclipse/equinox/internal/transforms/TransformerList.java5
-rw-r--r--bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/impl/tpt/threadpool/ThreadPoolManagerImpl.java8
-rw-r--r--bundles/org.eclipse.equinox.weaving.hook/META-INF/MANIFEST.MF2
-rw-r--r--bundles/org.eclipse.equinox.weaving.hook/pom.xml2
-rw-r--r--bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/hooks/SupplementerRegistry.java19
-rw-r--r--bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/hooks/WeavingHook.java13
-rw-r--r--bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/hooks/WeavingLoaderDelegateHook.java21
15 files changed, 63 insertions, 84 deletions
diff --git a/bundles/org.eclipse.equinox.servletbridge/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.servletbridge/META-INF/MANIFEST.MF
index 75ff7c8c..6010f8af 100644
--- a/bundles/org.eclipse.equinox.servletbridge/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.equinox.servletbridge/META-INF/MANIFEST.MF
@@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
Bundle-Name: %bundleName
Bundle-Vendor: %providerName
Bundle-SymbolicName: org.eclipse.equinox.servletbridge;singleton:=true
-Bundle-Version: 1.5.0.qualifier
+Bundle-Version: 1.5.100.qualifier
Bundle-Localization: plugin
Import-Package: javax.servlet;version="2.3.0",
javax.servlet.http;version="2.3.0"
diff --git a/bundles/org.eclipse.equinox.servletbridge/pom.xml b/bundles/org.eclipse.equinox.servletbridge/pom.xml
index a93c05ce..b321facb 100644
--- a/bundles/org.eclipse.equinox.servletbridge/pom.xml
+++ b/bundles/org.eclipse.equinox.servletbridge/pom.xml
@@ -5,7 +5,7 @@
are made available under the terms of the Eclipse Distribution License v1.0
which accompanies this distribution, and is available at
http://www.eclipse.org/org/documents/edl-v10.php
-
+
Contributors:
Igor Fedorenko - initial implementation
-->
@@ -19,6 +19,6 @@
</parent>
<groupId>org.eclipse.equinox</groupId>
<artifactId>org.eclipse.equinox.servletbridge</artifactId>
- <version>1.5.0-SNAPSHOT</version>
+ <version>1.5.100-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/bundles/org.eclipse.equinox.servletbridge/src/org/eclipse/equinox/servletbridge/CloseableURLClassLoader.java b/bundles/org.eclipse.equinox.servletbridge/src/org/eclipse/equinox/servletbridge/CloseableURLClassLoader.java
index f0ee51de..30ed3311 100644
--- a/bundles/org.eclipse.equinox.servletbridge/src/org/eclipse/equinox/servletbridge/CloseableURLClassLoader.java
+++ b/bundles/org.eclipse.equinox.servletbridge/src/org/eclipse/equinox/servletbridge/CloseableURLClassLoader.java
@@ -192,10 +192,10 @@ public class CloseableURLClassLoader extends URLClassLoader {
this.registeredAsParallel = CLOSEABLE_REGISTERED_AS_PARALLEL && this.getClass() == CloseableURLClassLoader.class;
this.context = AccessController.getContext();
this.verifyJars = verifyJars;
- for (int i = 0; i < urls.length; i++) {
- if (isFileJarURL(urls[i])) {
- loaderURLs.add(urls[i]);
- safeAddLoader(urls[i]);
+ for (URL url : urls) {
+ if (isFileJarURL(url)) {
+ loaderURLs.add(url);
+ safeAddLoader(url);
}
}
}
@@ -253,9 +253,10 @@ public class CloseableURLClassLoader extends URLClassLoader {
private static URL[] excludeFileJarURLS(URL[] urls) {
ArrayList<URL> urlList = new ArrayList<>();
- for (int i = 0; i < urls.length; i++) {
- if (!isFileJarURL(urls[i]))
- urlList.add(urls[i]);
+ for (URL url : urls) {
+ if (!isFileJarURL(url)) {
+ urlList.add(url);
+ }
}
return urlList.toArray(new URL[urlList.size()]);
}
@@ -391,8 +392,7 @@ public class CloseableURLClassLoader extends URLClassLoader {
synchronized (loaders) {
if (closed)
return null;
- for (Iterator<CloseableJarFileLoader> iterator = loaders.iterator(); iterator.hasNext();) {
- CloseableJarFileLoader loader = iterator.next();
+ for (CloseableJarFileLoader loader : loaders) {
URL resourceURL = loader.getURL(name);
if (resourceURL != null)
return resourceURL;
@@ -415,8 +415,7 @@ public class CloseableURLClassLoader extends URLClassLoader {
synchronized (loaders) {
if (closed)
return null;
- for (Iterator<CloseableJarFileLoader> iterator = loaders.iterator(); iterator.hasNext();) {
- CloseableJarFileLoader loader = iterator.next();
+ for (CloseableJarFileLoader loader : loaders) {
URL resourceURL = loader.getURL(name);
if (resourceURL != null)
resources.add(resourceURL);
@@ -441,8 +440,7 @@ public class CloseableURLClassLoader extends URLClassLoader {
synchronized (loaders) {
if (closed)
return;
- for (Iterator<CloseableJarFileLoader> iterator = loaders.iterator(); iterator.hasNext();) {
- CloseableJarFileLoader loader = iterator.next();
+ for (CloseableJarFileLoader loader : loaders) {
loader.close();
}
closed = true;
diff --git a/bundles/org.eclipse.equinox.servletbridge/src/org/eclipse/equinox/servletbridge/FrameworkLauncher.java b/bundles/org.eclipse.equinox.servletbridge/src/org/eclipse/equinox/servletbridge/FrameworkLauncher.java
index 76d84a6c..bfcdc589 100644
--- a/bundles/org.eclipse.equinox.servletbridge/src/org/eclipse/equinox/servletbridge/FrameworkLauncher.java
+++ b/bundles/org.eclipse.equinox.servletbridge/src/org/eclipse/equinox/servletbridge/FrameworkLauncher.java
@@ -391,8 +391,7 @@ public class FrameworkLauncher {
String[] args = buildCommandLineArguments();
// Handle commandline -D properties
- for (int i = 0; i < args.length; i++) {
- String arg = args[i];
+ for (String arg : args) {
if (arg.startsWith("-D")) { //$NON-NLS-1$
int equalsIndex = arg.indexOf('=');
if (equalsIndex == -1) {
@@ -572,8 +571,7 @@ public class FrameworkLauncher {
protected Map<String, String> buildInitialPropertyMap() {
Map<String, String> initialPropertyMap = new HashMap<>();
Properties launchProperties = loadProperties(resourceBase + LAUNCH_INI);
- for (Iterator it = launchProperties.entrySet().iterator(); it.hasNext();) {
- Map.Entry entry = (Map.Entry) it.next();
+ for (Map.Entry entry : launchProperties.entrySet()) {
String key = (String) entry.getKey();
String value = (String) entry.getValue();
setInitialProperty(initialPropertyMap, key, value);
@@ -798,8 +796,7 @@ public class FrameworkLauncher {
Set<String> paths = context.getResourcePaths(resourcePath);
if (paths == null)
return;
- for (Iterator<String> it = paths.iterator(); it.hasNext();) {
- String path = it.next();
+ for (String path : paths) {
File newFile = new File(target, path.substring(resourcePath.length()));
copyResource(path, newFile);
}
@@ -841,11 +838,11 @@ public class FrameworkLauncher {
protected static boolean deleteDirectory(File directory) {
if (directory.isDirectory()) {
File[] files = directory.listFiles();
- for (int i = 0; i < files.length; i++) {
- if (files[i].isDirectory()) {
- deleteDirectory(files[i]);
+ for (File file : files) {
+ if (file.isDirectory()) {
+ deleteDirectory(file);
} else {
- files[i].delete();
+ file.delete();
}
}
}
diff --git a/bundles/org.eclipse.equinox.transforms.hook/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.transforms.hook/META-INF/MANIFEST.MF
index 3b9ed32b..0f1116de 100644
--- a/bundles/org.eclipse.equinox.transforms.hook/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.equinox.transforms.hook/META-INF/MANIFEST.MF
@@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
Bundle-Name: %bundleName
Bundle-Vendor: %providerName
Bundle-SymbolicName: org.eclipse.equinox.transforms.hook
-Bundle-Version: 1.2.400.qualifier
+Bundle-Version: 1.2.500.qualifier
Fragment-Host: org.eclipse.osgi;bundle-version="[3.10.0,4.0.0)"
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-Localization: transformsHook
diff --git a/bundles/org.eclipse.equinox.transforms.hook/pom.xml b/bundles/org.eclipse.equinox.transforms.hook/pom.xml
index 192926a0..c9f69364 100644
--- a/bundles/org.eclipse.equinox.transforms.hook/pom.xml
+++ b/bundles/org.eclipse.equinox.transforms.hook/pom.xml
@@ -5,7 +5,7 @@
are made available under the terms of the Eclipse Distribution License v1.0
which accompanies this distribution, and is available at
http://www.eclipse.org/org/documents/edl-v10.php
-
+
Contributors:
Igor Fedorenko - initial implementation
-->
@@ -19,6 +19,6 @@
</parent>
<groupId>org.eclipse.equinox</groupId>
<artifactId>org.eclipse.equinox.transforms.hook</artifactId>
- <version>1.2.400-SNAPSHOT</version>
+ <version>1.2.500-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/bundles/org.eclipse.equinox.transforms.hook/src/org/eclipse/equinox/internal/transforms/TransformInstanceListData.java b/bundles/org.eclipse.equinox.transforms.hook/src/org/eclipse/equinox/internal/transforms/TransformInstanceListData.java
index a018f01e..d2854024 100644
--- a/bundles/org.eclipse.equinox.transforms.hook/src/org/eclipse/equinox/internal/transforms/TransformInstanceListData.java
+++ b/bundles/org.eclipse.equinox.transforms.hook/src/org/eclipse/equinox/internal/transforms/TransformInstanceListData.java
@@ -53,7 +53,7 @@ public class TransformInstanceListData extends ServiceTracker<URL, URL> {
/**
* Create a new transform list bound to the given context. If new transforms are registered against the given context the contents of this list will change.
* @param context the bundle context
- * @param logServices
+ * @param logServices
* @throws InvalidSyntaxException thrown if there's an issue listening for changes to the given transformer type
*/
public TransformInstanceListData(BundleContext context, EquinoxLogServices logServices) throws InvalidSyntaxException {
@@ -102,8 +102,7 @@ public class TransformInstanceListData extends ServiceTracker<URL, URL> {
if (hasTransformsFor == null) {
hasTransformsFor = Boolean.FALSE;
- for (Iterator<TransformTuple> i = rawTuples.iterator(); i.hasNext();) {
- TransformTuple tuple = i.next();
+ for (TransformTuple tuple : rawTuples) {
if (tuple.bundlePattern.matcher(bundleName).matches()) {
hasTransformsFor = Boolean.TRUE;
}
@@ -128,10 +127,8 @@ public class TransformInstanceListData extends ServiceTracker<URL, URL> {
if (serviceReferences == null)
return;
- for (int i = 0; i < serviceReferences.length; i++) {
- ServiceReference<URL> serviceReference = serviceReferences[i];
+ for (ServiceReference<URL> serviceReference : serviceReferences) {
String type = serviceReference.getProperty(TransformTuple.TRANSFORMER_TYPE).toString();
-
URL url = getService(serviceReference);
TransformTuple[] transforms;
try {
@@ -144,14 +141,12 @@ public class TransformInstanceListData extends ServiceTracker<URL, URL> {
transformerToTuple.put(type, newTransforms);
} else
transformerToTuple.put(type, transforms);
-
- for (int j = 0; j < transforms.length; j++) {
- rawTuples.add(transforms[j]);
+ for (TransformTuple transform : transforms) {
+ rawTuples.add(transform);
}
} catch (IOException e) {
e.printStackTrace();
}
-
}
}
diff --git a/bundles/org.eclipse.equinox.transforms.hook/src/org/eclipse/equinox/internal/transforms/TransformedBundleFile.java b/bundles/org.eclipse.equinox.transforms.hook/src/org/eclipse/equinox/internal/transforms/TransformedBundleFile.java
index 77cfb99b..9bf4fe8a 100644
--- a/bundles/org.eclipse.equinox.transforms.hook/src/org/eclipse/equinox/internal/transforms/TransformedBundleFile.java
+++ b/bundles/org.eclipse.equinox.transforms.hook/src/org/eclipse/equinox/internal/transforms/TransformedBundleFile.java
@@ -96,15 +96,14 @@ public class TransformedBundleFile extends BundleFileWrapper {
String[] transformTypes = transformerHook.getTransformTypes();
if (transformTypes.length == 0)
return null;
- for (int i = 0; i < transformTypes.length; i++) {
- StreamTransformer transformer = transformerHook.getTransformer(transformTypes[i]);
+ for (String transformType : transformTypes) {
+ StreamTransformer transformer = transformerHook.getTransformer(transformType);
if (transformer == null)
continue;
- TransformTuple[] transformTuples = transformerHook.getTransformsFor(transformTypes[i]);
+ TransformTuple[] transformTuples = transformerHook.getTransformsFor(transformType);
if (transformTuples == null)
continue;
- for (int j = 0; j < transformTuples.length; j++) {
- TransformTuple transformTuple = transformTuples[j];
+ for (TransformTuple transformTuple : transformTuples) {
if (match(transformTuple.bundlePattern, namespace) && match(transformTuple.pathPattern, path)) {
try {
return transformer.getInputStream(inputStream, transformTuple.transformerUrl);
diff --git a/bundles/org.eclipse.equinox.transforms.hook/src/org/eclipse/equinox/internal/transforms/TransformerList.java b/bundles/org.eclipse.equinox.transforms.hook/src/org/eclipse/equinox/internal/transforms/TransformerList.java
index b86e6502..e864b2b9 100644
--- a/bundles/org.eclipse.equinox.transforms.hook/src/org/eclipse/equinox/internal/transforms/TransformerList.java
+++ b/bundles/org.eclipse.equinox.transforms.hook/src/org/eclipse/equinox/internal/transforms/TransformerList.java
@@ -51,7 +51,7 @@ public class TransformerList extends ServiceTracker<Object, Object> {
}
/**
- * Return the transformer of the given type being monitored by this list.
+ * Return the transformer of the given type being monitored by this list.
* If the list is stale it will first be rebuilt.
* @param type the type of transformer
* @return the transformer or null if no transformer of the given type is available.
@@ -80,8 +80,7 @@ public class TransformerList extends ServiceTracker<Object, Object> {
if (serviceReferences == null)
return;
- for (int i = 0; i < serviceReferences.length; i++) {
- ServiceReference<Object> serviceReference = serviceReferences[i];
+ for (ServiceReference<Object> serviceReference : serviceReferences) {
String type = serviceReference.getProperty(TransformTuple.TRANSFORMER_TYPE).toString();
if (type == null || transformers.get(type) != null)
continue;
diff --git a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/impl/tpt/threadpool/ThreadPoolManagerImpl.java b/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/impl/tpt/threadpool/ThreadPoolManagerImpl.java
index 7109e3e0..a593f129 100644
--- a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/impl/tpt/threadpool/ThreadPoolManagerImpl.java
+++ b/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/impl/tpt/threadpool/ThreadPoolManagerImpl.java
@@ -179,10 +179,10 @@ public class ThreadPoolManagerImpl extends ObjectPool implements TimerListener,
int count = 0;
int all = 0;
synchronized (getSyncMonitor()) {
- for (int i = 0; i < buff.length; i++) {
- if (buff[i] != null) {
- for (int j = 0; j < buff[i].length; j++) {
- Executor e = (Executor) buff[i][j];
+ for (Object[] b : buff) {
+ if (b != null) {
+ for (Object item : b) {
+ Executor e = (Executor) item;
if (e != null) {
all++;
if (!e.accessed)
diff --git a/bundles/org.eclipse.equinox.weaving.hook/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.weaving.hook/META-INF/MANIFEST.MF
index 7c25a0ef..04ed69c0 100644
--- a/bundles/org.eclipse.equinox.weaving.hook/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.equinox.weaving.hook/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Aspect Weaving Hooks Plug-in
Bundle-SymbolicName: org.eclipse.equinox.weaving.hook
-Bundle-Version: 1.2.300.qualifier
+Bundle-Version: 1.2.400.qualifier
Fragment-Host: org.eclipse.osgi;bundle-version="[3.10.0,4.0.0)"
Bundle-Vendor: Eclipse.org - Equinox
Export-Package: org.eclipse.equinox.service.weaving,
diff --git a/bundles/org.eclipse.equinox.weaving.hook/pom.xml b/bundles/org.eclipse.equinox.weaving.hook/pom.xml
index 5d85b413..2ac8bc91 100644
--- a/bundles/org.eclipse.equinox.weaving.hook/pom.xml
+++ b/bundles/org.eclipse.equinox.weaving.hook/pom.xml
@@ -19,6 +19,6 @@
</parent>
<groupId>org.eclipse.equinox</groupId>
<artifactId>org.eclipse.equinox.weaving.hook</artifactId>
- <version>1.2.300-SNAPSHOT</version>
+ <version>1.2.400-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/hooks/SupplementerRegistry.java b/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/hooks/SupplementerRegistry.java
index 2f6cf199..eea5252b 100644
--- a/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/hooks/SupplementerRegistry.java
+++ b/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/hooks/SupplementerRegistry.java
@@ -333,9 +333,9 @@ public class SupplementerRegistry implements ISupplementerRegistry {
}
}
- // remove this supplementer from the list of supplementers per other bundle
- for (int i = 0; i < supplementedBundles.length; i++) {
- final long bundleId = supplementedBundles[i].getBundleId();
+ // remove this supplementer from the list of supplementers per other bundle
+ for (Bundle supplementedBundle : supplementedBundles) {
+ final long bundleId = supplementedBundle.getBundleId();
final List<Supplementer> supplementerList = new ArrayList<Supplementer>(
Arrays.asList(this.supplementersByBundle.get(bundleId)));
supplementerList.remove(supplementer);
@@ -358,21 +358,18 @@ public class SupplementerRegistry implements ISupplementerRegistry {
final List<Bundle> bundlesToRefresh = new ArrayList<Bundle>();
- for (int i = 0; i < installedBundles.length; i++) {
+ for (Bundle installedBundle : installedBundles) {
try {
- final Bundle bundle = installedBundles[i];
-
+ final Bundle bundle = installedBundle;
// skip the bundle itself, just resupplement already installed bundles
if (bundle.getSymbolicName().equals(
supplementer.getSymbolicName())) {
continue;
}
-
// skip bundles that should not be woven
if (dontWeaveTheseBundles.contains(bundle.getSymbolicName())) {
continue;
}
-
// find out which of the installed bundles matches the new supplementer
final Dictionary<?, ?> manifest = bundle.getHeaders(""); //$NON-NLS-1$
final ManifestElement[] imports = ManifestElement.parseHeader(
@@ -381,7 +378,6 @@ public class SupplementerRegistry implements ISupplementerRegistry {
final ManifestElement[] exports = ManifestElement.parseHeader(
Constants.EXPORT_PACKAGE,
(String) manifest.get(Constants.EXPORT_PACKAGE));
-
if (isSupplementerMatching(bundle.getSymbolicName(), imports,
exports, supplementer)) {
final IWeavingAdaptor adaptor = this.adaptorProvider
@@ -405,11 +401,10 @@ public class SupplementerRegistry implements ISupplementerRegistry {
this.supplementersByBundle.put(bundle.getBundleId(),
enhancedSupplementerList
- .toArray(new Supplementer[0]));
+ .toArray(new Supplementer[0]));
}
}
-
- } catch (final BundleException e) {
+ }catch (final BundleException e) {
e.printStackTrace();
}
}
diff --git a/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/hooks/WeavingHook.java b/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/hooks/WeavingHook.java
index ab7b6945..ca45ea2d 100644
--- a/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/hooks/WeavingHook.java
+++ b/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/hooks/WeavingHook.java
@@ -134,15 +134,14 @@ public class WeavingHook extends AbstractWeavingHook {
// re-build supplementer registry state for installed bundles
final Bundle[] installedBundles = context.getBundles();
- for (int i = 0; i < installedBundles.length; i++) {
- if (installedBundles[i].getState() != Bundle.UNINSTALLED) {
- supplementerRegistry
- .addSupplementer(installedBundles[i], false);
+ for (Bundle installedBundle : installedBundles) {
+ if (installedBundle.getState() != Bundle.UNINSTALLED) {
+ supplementerRegistry.addSupplementer(installedBundle, false);
}
}
- for (int i = 0; i < installedBundles.length; i++) {
- if (installedBundles[i].getState() != Bundle.UNINSTALLED) {
- supplementerRegistry.addSupplementedBundle(installedBundles[i]);
+ for (Bundle installedBundle : installedBundles) {
+ if (installedBundle.getState() != Bundle.UNINSTALLED) {
+ supplementerRegistry.addSupplementedBundle(installedBundle);
}
}
diff --git a/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/hooks/WeavingLoaderDelegateHook.java b/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/hooks/WeavingLoaderDelegateHook.java
index 1a4826b7..e8fb26a3 100644
--- a/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/hooks/WeavingLoaderDelegateHook.java
+++ b/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/hooks/WeavingLoaderDelegateHook.java
@@ -99,17 +99,16 @@ public class WeavingLoaderDelegateHook extends ClassLoaderHook {
final Supplementer[] supplementers = supplementerRegistry
.getSupplementers(bundleID);
if (supplementers != null) {
- for (int i = 0; i < supplementers.length; i++) {
+ for (Supplementer supplementer : supplementers) {
try {
- final Bundle bundle = supplementers[i]
- .getSupplementerHost();
+ final Bundle bundle = supplementer.getSupplementerHost();
if (bundle.getState() != Bundle.UNINSTALLED) {
final Class<?> clazz = bundle.loadClass(name);
if (clazz != null) {
return clazz;
}
}
- } catch (final ClassNotFoundException e) {
+ }catch (final ClassNotFoundException e) {
}
}
}
@@ -140,14 +139,13 @@ public class WeavingLoaderDelegateHook extends ClassLoaderHook {
final Supplementer[] supplementers = supplementerRegistry
.getSupplementers(bundleID);
if (supplementers != null) {
- for (int i = 0; i < supplementers.length; i++) {
+ for (Supplementer supplementer : supplementers) {
try {
- final URL resource = supplementers[i]
- .getSupplementerHost().getResource(name);
+ final URL resource = supplementer.getSupplementerHost().getResource(name);
if (resource != null) {
return resource;
}
- } catch (final Exception e) {
+ }catch (final Exception e) {
e.printStackTrace();
}
}
@@ -179,15 +177,14 @@ public class WeavingLoaderDelegateHook extends ClassLoaderHook {
final Supplementer[] supplementers = supplementerRegistry
.getSupplementers(bundleID);
if (supplementers != null) {
- for (int i = 0; i < supplementers.length; i++) {
+ for (Supplementer supplementer : supplementers) {
try {
- final Enumeration<URL> resource = supplementers[i]
- .getSupplementerHost().getResources(name);
+ final Enumeration<URL> resource = supplementer.getSupplementerHost().getResources(name);
if (resource != null) {
// TODO: if more than one enumeration is found, we should return all items
return resource;
}
- } catch (final Exception e) {
+ }catch (final Exception e) {
e.printStackTrace();
}
}

Back to the top