Buggy code:
public class PolicyHandler { public static boolean canUserDeleteComment ( Forum forum , SubForum subForum , User user , Message comment ) { <START_BUG> if ( ( ( ( ( forum . getSubForums ( ) . contains ( subForum ) ) && ( forum . getMembers ( ) . contains ( user ) ) ) && ( ! ( user . isGuest ( ) ) ) ) && ( user . isActive ( ) ) ) && ( ( ( comment . getUser ( ) . equals ( user ) ) || ( user . isAdmin ( ) ) ) || ( ( user . isMod ( ) ) && ( forum . getPolicy ( ) . isCanModeratorEditPosts ( ) ) ) ) ) <END_BUG> return true ; return false ; } public static boolean canUserEditComment ( Forum forum , SubForum subForum , User user , Message msg ) { } public static boolean canUserOpenThread ( Forum forum , User user ) { } public static boolean canUserViewSubForums ( Forum forum , User user ) { } public static boolean canUserDeleteSubForum ( Forum forum , User admin ) { } public static boolean canUserAddSubForum ( Forum forum , User admin ) { } public static boolean canBanModerator ( Forum forum , SubForum subForum , User admin , User mod ) { } public static boolean canReplaceModerator ( Forum forum , SubForum subForum , User admin , User oldModerator , User newModerator ) { } public static boolean canUnAppointModerator ( Forum forum , SubForum subForum , User admin , User moderator ) { } public static boolean canAppointModerator ( Forum forum , SubForum subForum , User admin , User moderator ) { } public static boolean canUserHaveFriends ( Forum forum , User user ) { } public static boolean canUserBanMember ( SubForum subForum , User moderator , User member ) { } public static boolean canUserReply ( Forum forum , User user ) { } public static boolean canUserAddForum ( User superAdmin ) { } public static boolean canUserRemoveForum ( User superAdmin ) { } public static boolean canReplaceAdmin ( User superAdmin , Forum forum , User admin ) { } public static boolean canUserChangePolicy ( User superAdmin , Forum forum ) { } public static boolean canUserReplyToFriendRequest ( Forum forum , User user , FriendRequest request ) { } public static boolean canUserReportAdmin ( Forum forum , User reporter , User admin ) { } private static boolean didUserPostInModeratorSubForums ( User moderator , User member ) { } public static boolean canUserBeDeactivated ( User user ) { } public static boolean canUserDestroyForumSystem ( User superAdmin ) { } public static boolean canUserGetNumberOfMessagesInSubForum ( Forum forum , User admin , SubForum subForum ) { } public static boolean canUserGetNumberOfMessagesOfMember ( Forum forum , User admin , User member ) { } public static boolean canUserGetModeratorList ( Forum forum , User admin ) { } public static boolean canUserGetNumberOfForums ( User superAdmin ) { } public static boolean shouldUserChangePassword ( Forum forum , User user ) { } public static boolean canUserGetNotifications ( ) { } public static boolean canUserAddRemoveStatusType ( Forum forum , User admin ) { } public static boolean canGetModeratorSubForumList ( Forum forum , User admin , User moderator ) { } public static boolean canUserBeModerator ( User moderator , Forum forum , SubForum subForum ) { } }

Fix:
if ( ( ( ( ( forum . getSubForums ( ) . contains ( subForum ) ) && ( forum . getMembers ( ) . contains ( user ) ) ) && ( ! ( user . isGuest ( ) ) ) ) && ( user . isActive ( ) ) ) && ( ( ( comment . getUser ( ) . equals ( user ) ) || ( user . isAdmin ( ) ) ) || ( ( subForum . getModerators ( ) . contains ( user ) ) && ( forum . getPolicy ( ) . isCanModeratorEditPosts ( ) ) ) ) )