Bug 567143 - fix broken comparison of bit masks

This method compares an expression of the form (e | C) to D. which will
always compare unequal due to the specific values of constants C and D.
This may indicate a logic error or typo.

Typically, this bug occurs because the code wants to perform a
membership test in a bit set, but uses the bitwise OR operator ("|")
instead of bitwise AND ("&").

Also such bug may appear in expressions like (e & A | B) == C which is
parsed like ((e & A) | B) == C while (e & (A | B)) == C was intended.


Change-Id: I2952d031544c6bdbffa1a3e199baee6ca962e3a3
Signed-off-by: Carsten Hammer <carsten.hammer@t-online.de>
diff --git a/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/core/manipulation/BindingLabelProviderCore.java b/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/core/manipulation/BindingLabelProviderCore.java
index d4185f5..1b8150d 100644
--- a/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/core/manipulation/BindingLabelProviderCore.java
+++ b/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/core/manipulation/BindingLabelProviderCore.java
@@ -124,7 +124,7 @@
 
 		// parameters
 		buffer.append('(');
-		if ((flags & JavaElementLabelsCore.M_PARAMETER_TYPES | JavaElementLabelsCore.M_PARAMETER_NAMES) != 0) {
+		if ((flags & (JavaElementLabelsCore.M_PARAMETER_TYPES | JavaElementLabelsCore.M_PARAMETER_NAMES)) != 0) {
 			ITypeBinding[] parameters= ((flags & JavaElementLabelsCore.M_PARAMETER_TYPES) != 0) ? binding.getParameterTypes() : null;
 			if (parameters != null) {
 				for (int index= 0; index < parameters.length; index++) {