Buggy code:
public class RequestHandler { private static DataBaseManager dbm ; private static ServerSocket server ; private static Set < ServerClientHandler > currently_connected ; public static final int PORT = 80 ; public static final long CHECK_FOR_EXPECTED_INPUT_INTERVAL = 500 ; public static final long WAIT_BEFORE_TIMOUT = 60000 ; public static final char STATUS_OK = 'a' ; public static final char STATUS_DISCONNECTED = 's' ; public static void main ( String [ ] args ) { } private static void init ( ) { } private static void dispose ( ) { } private static void acceptClients ( ) { } public static boolean isLoggedIn ( String username ) { } public static void disconnectUser ( ServerClientHandler client ) { } public static User logIn ( String username , String password ) throws UserDoesNotExistException , WrongPasswordException { } private static synchronized void validate ( User requestor ) throws SessionExpiredException { } public static synchronized boolean createUser ( User user ) throws UsernameAlreadyExistsException { } public static synchronized boolean editUser ( User requestor , User updated_user ) throws HasNotTheRightsException , SessionExpiredException , UserDoesNotExistException { RequestHandler . validate ( requestor ) ; <START_BUG> if ( ( updated_user . getUsername ( ) ) != ( requestor . getUsername ( ) ) ) <END_BUG> throw new HasNotTheRightsException ( ) ; return RequestHandler . dbm . editUser ( updated_user ) ; } public static synchronized boolean makeAdmin ( User requestor , String username , int entry_id ) throws EntryDoesNotExistException , HasNotTheRightsException , SessionExpiredException , UserDoesNotExistException { } public static synchronized boolean createEntry ( User requestor , CalendarEntry entry ) throws SessionExpiredException , UserDoesNotExistException { } public static synchronized boolean deleteEntry ( User requestor , int entry_id ) throws EntryDoesNotExistException , HasNotTheRightsException , SessionExpiredException , UserDoesNotExistException { } public static synchronized boolean editEntry ( User requestor , CalendarEntry entry ) throws EntryDoesNotExistException , HasNotTheRightsException , SessionExpiredException , UserDoesNotExistException { } public static synchronized boolean kickUserFromEntry ( User requestor , String username , int entry_id ) throws EntryDoesNotExistException , HasNotTheRightsException , SessionExpiredException , UserDoesNotExistException { } public static synchronized boolean kickGroupFromEntry ( User requestor , String groupname , int entry_id ) throws EntryDoesNotExistException , GroupDoesNotExistException , HasNotTheRightsException , SessionExpiredException , UserDoesNotExistException , UserInGroupDoesNotExistsException { } public static synchronized boolean inviteUserToEntry ( User requestor , String username , int entry_id ) throws EntryDoesNotExistException , HasNotTheRightsException , SessionExpiredException , UserDoesNotExistException { } public static synchronized boolean inviteGroupToEntry ( User requestor , String groupname , int entry_id ) throws EntryDoesNotExistException , GroupDoesNotExistException , HasNotTheRightsException , SessionExpiredException , UserDoesNotExistException { } public static synchronized boolean createGroup ( User requestor , Group group ) throws GroupAlreadyExistsException , SessionExpiredException , UserDoesNotExistException , UserInGroupDoesNotExistsException { } public static synchronized boolean addUserToGroup ( User requestor , String username , String groupname ) throws GroupDoesNotExistException , HasNotTheRightsException , SessionExpiredException , UserDoesNotExistException { } public static synchronized boolean removeUserFromGroup ( User requestor , String username , String groupname ) throws GroupDoesNotExistException , HasNotTheRightsException , SessionExpiredException , UserDoesNotExistException { } public static synchronized Calendar createCalendar ( User requestor ) throws SessionExpiredException , UserDoesNotExistException { } public static synchronized boolean invitationAnswer ( User requestor , int entry_id , boolean answer ) throws EntryDoesNotExistException , SessionExpiredException , UserDoesNotExistException { } }

Fix:
if ( ! ( updated_user . getUsername ( ) . equals ( requestor . getUsername ( ) ) ) )