Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 346214 - Findbugs complains: o.e.g.w.i.WebContainerActivator.java:126 instanceof will always return true
Summary: Findbugs complains: o.e.g.w.i.WebContainerActivator.java:126 instanceof will ...
Status: CLOSED FIXED
Alias: None
Product: Gemini.Web
Classification: RT
Component: unknown (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 trivial (vote)
Target Milestone: ---   Edit
Assignee: Violeta Georgieva CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-18 06:28 EDT by Violeta Georgieva CLA
Modified: 2011-05-18 08:49 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Violeta Georgieva CLA 2011-05-18 06:28:13 EDT
When running findbugs for Gemini Web, it complains with:
 
org.eclipse.gemini.web.gemini-web-container/org.eclipse.gemini.web.core/src/main/java/org/eclipse/gemini/web/internal/WebContainerActivator.java:126 instanceof will always return true, since all org.eclipse.gemini.web.core.WebContainer are instances of org.eclipse.gemini.web.core.WebContainer
 
So I’m going to change this issue as follows:
 
org.eclipse.gemini.web.core/src/main/java/org/eclipse/gemini/web/internal/WebContainerActivator.java
index 6faddb4..48e2766 100644
@@ -123,9 +123,7 @@ public class WebContainerActivator implements BundleActivator {
 
         public void removedService(ServiceReference<ServletContext> reference, WebContainer service) {
             this.regTracker.unregisterAll();
-            if (service instanceof WebContainer) {
-                ((WebContainer)service).halt();
-            }
+            service.halt();
         }
 
     }
Comment 1 Violeta Georgieva CLA 2011-05-18 08:49:13 EDT
Change is tested, committed and pushed.
Commit Id: b645548dbd513525b67760ac9b3f09c58b574ec7