Multiple calls to setFlag will result in unexpected behavior, due to the fact that addition is being used instead of a bitwise or.
Consider the following:
message.setFlag(Message.OOB);
// message.isFlagSet(Message.OOB) is true
message.setFlag(Message.OOB);
// message.isFlagSet(Message.OOB) is false now!
Similar problems on isFlagSet and clearFlag