[357426] org/eclipse/wst/server/core/internal/ServerNotificationManager bitwise kind check is incorrect
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/ServerEvent.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/ServerEvent.java
index c078940..aa48e9b 100644
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/ServerEvent.java
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/ServerEvent.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2009 IBM Corporation and others.
+ * Copyright (c) 2005, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -150,9 +150,9 @@
* <p>
* This kind can be used to test whether this event is a server event or module event by using
* the following code (the example is checking for the server event):
- * ((getKind() | SERVER_CHANGE) != 0)
+ * ((getKind() & SERVER_CHANGE) != 0)
* the following code (the example is checking for the module event):
- * ((getKind() | MODULE_CHANGE) != 0)
+ * ((getKind() & MODULE_CHANGE) != 0)
*
* @return the kind of the change (<code>XXX_CHANGE</code>
* constants declared on {@link ServerEvent}
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerNotificationManager.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerNotificationManager.java
index db4b3e0..f744ba8 100644
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerNotificationManager.java
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerNotificationManager.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
+ * Copyright (c) 2005, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -108,7 +108,9 @@
boolean isTypeMatch = ((mask & eventKind & ServerEvent.SERVER_CHANGE) != 0)
|| ((mask & eventKind & ServerEvent.MODULE_CHANGE) != 0);
// check the kind of change
- boolean isKindMatch = (mask & eventKind ^ ServerEvent.SERVER_CHANGE ^ ServerEvent.MODULE_CHANGE) != 0;
+ // take out the ServerEvent.SERVER_CHANGE bit and ServerEvent.MODULE_CHANGE bit
+ int kindOnly = (eventKind | ServerEvent.SERVER_CHANGE | ServerEvent.MODULE_CHANGE) ^ ServerEvent.SERVER_CHANGE ^ ServerEvent.MODULE_CHANGE;
+ boolean isKindMatch = (mask & kindOnly) != 0;
if (isTypeMatch && isKindMatch) {
if (Trace.FINEST) {