Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Waibel2016-05-31 11:28:04 -0400
committerFlorian Waibel2016-05-31 11:28:04 -0400
commita746d53d98b7dda758ec2afe9ac7fd2afd3e6c50 (patch)
tree4f9ea50bacc93f5d6703aed61575d166f89faca6
parent7c07a070a4262db700a42d8238deda2ca50df747 (diff)
downloadorg.eclipse.virgo.kernel-a746d53d98b7dda758ec2afe9ac7fd2afd3e6c50.tar.gz
org.eclipse.virgo.kernel-a746d53d98b7dda758ec2afe9ac7fd2afd3e6c50.tar.xz
org.eclipse.virgo.kernel-a746d53d98b7dda758ec2afe9ac7fd2afd3e6c50.zip
Small refactoring to avoid resource leak warning
-rw-r--r--org.eclipse.virgo.kernel.deployer/src/main/java/org/eclipse/virgo/kernel/module/internal/KernelModuleContextAccessor.java5
1 files changed, 2 insertions, 3 deletions
diff --git a/org.eclipse.virgo.kernel.deployer/src/main/java/org/eclipse/virgo/kernel/module/internal/KernelModuleContextAccessor.java b/org.eclipse.virgo.kernel.deployer/src/main/java/org/eclipse/virgo/kernel/module/internal/KernelModuleContextAccessor.java
index e6a54c6b..d01e1ff5 100644
--- a/org.eclipse.virgo.kernel.deployer/src/main/java/org/eclipse/virgo/kernel/module/internal/KernelModuleContextAccessor.java
+++ b/org.eclipse.virgo.kernel.deployer/src/main/java/org/eclipse/virgo/kernel/module/internal/KernelModuleContextAccessor.java
@@ -55,9 +55,8 @@ public final class KernelModuleContextAccessor implements ModuleContextAccessor
if (service instanceof ApplicationContext) {
ApplicationContext appCtx = (ApplicationContext) service;
if (appCtx instanceof ConfigurableOsgiBundleApplicationContext) {
- ConfigurableOsgiBundleApplicationContext cAppCtx = (ConfigurableOsgiBundleApplicationContext) appCtx;
- if (bundleContext == cAppCtx.getBundleContext()) {
- return new ModuleContextWrapper(cAppCtx);
+ if (bundleContext == ((ConfigurableOsgiBundleApplicationContext) appCtx).getBundleContext()) {
+ return new ModuleContextWrapper((ConfigurableOsgiBundleApplicationContext) appCtx);
}
}
}

Back to the top