Buggy code:
public class GroupManagerDao { private Database db ; protected NameLayerPlugin plugin = NameLayerPlugin . getInstance ( ) ; public GroupManagerDao ( Database db ) { } public void checkUpdate ( ) { } public void initializeProcedures ( ) { db . execute ( "drop<seq2seq4repair_space>procedure<seq2seq4repair_space>if<seq2seq4repair_space>exists<seq2seq4repair_space>deletegroupfromtable;" ) ; db . execute ( ( "create<seq2seq4repair_space>definer=current_user<seq2seq4repair_space>procedure<seq2seq4repair_space>deletegroupfromtable(" + ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( "in<seq2seq4repair_space>groupName<seq2seq4repair_space>varchar(36)," + "in<seq2seq4repair_space>specialAdminGroup<seq2seq4repair_space>varchar(36)" ) + ")<seq2seq4repair_space>sql<seq2seq4repair_space>security<seq2seq4repair_space>invoker<seq2seq4repair_space>begin<seq2seq4repair_space>" ) + "delete<seq2seq4repair_space>fm.*<seq2seq4repair_space>from<seq2seq4repair_space>faction_member<seq2seq4repair_space>fm<seq2seq4repair_space>" ) + "inner<seq2seq4repair_space>join<seq2seq4repair_space>faction_id<seq2seq4repair_space>fi<seq2seq4repair_space>on<seq2seq4repair_space>fm.group_id<seq2seq4repair_space>=<seq2seq4repair_space>fi.group_id<seq2seq4repair_space>" ) + "where<seq2seq4repair_space>fi.group_name<seq2seq4repair_space>=<seq2seq4repair_space>groupName;" ) + "delete<seq2seq4repair_space>b.*<seq2seq4repair_space>from<seq2seq4repair_space>blacklist<seq2seq4repair_space>b<seq2seq4repair_space>" ) + "inner<seq2seq4repair_space>join<seq2seq4repair_space>faction_id<seq2seq4repair_space>fi<seq2seq4repair_space>on<seq2seq4repair_space>b.group_id<seq2seq4repair_space>=<seq2seq4repair_space>fi.group_id<seq2seq4repair_space>" ) + "where<seq2seq4repair_space>fi.group_name<seq2seq4repair_space>=<seq2seq4repair_space>groupName;" ) + "delete<seq2seq4repair_space>s.*<seq2seq4repair_space>from<seq2seq4repair_space>subgroup<seq2seq4repair_space>s<seq2seq4repair_space>" ) + "inner<seq2seq4repair_space>join<seq2seq4repair_space>faction_id<seq2seq4repair_space>fi<seq2seq4repair_space>on<seq2seq4repair_space>s.group_id<seq2seq4repair_space>=<seq2seq4repair_space>fi.group_id<seq2seq4repair_space>" ) + "where<seq2seq4repair_space>fi.group_name<seq2seq4repair_space>=<seq2seq4repair_space>groupName;" ) + "delete<seq2seq4repair_space>p.*<seq2seq4repair_space>from<seq2seq4repair_space>permissions<seq2seq4repair_space>p<seq2seq4repair_space>" ) + "inner<seq2seq4repair_space>join<seq2seq4repair_space>faction_id<seq2seq4repair_space>fi<seq2seq4repair_space>on<seq2seq4repair_space>p.group_id<seq2seq4repair_space>=<seq2seq4repair_space>fi.group_id<seq2seq4repair_space>" ) + "where<seq2seq4repair_space>fi.group_name<seq2seq4repair_space>=<seq2seq4repair_space>groupName;" ) + "update<seq2seq4repair_space>faction<seq2seq4repair_space>f<seq2seq4repair_space>set<seq2seq4repair_space>f.group_name<seq2seq4repair_space>=<seq2seq4repair_space>specialAdminGroup<seq2seq4repair_space>" ) + "where<seq2seq4repair_space>f.group_name<seq2seq4repair_space>=<seq2seq4repair_space>specialAdminGroup;" ) + "update<seq2seq4repair_space>faction_id<seq2seq4repair_space>set<seq2seq4repair_space>group_name<seq2seq4repair_space>=<seq2seq4repair_space>specialAdminGroup<seq2seq4repair_space>where<seq2seq4repair_space>group_name<seq2seq4repair_space>=<seq2seq4repair_space>groupName;" ) + "delete<seq2seq4repair_space>from<seq2seq4repair_space>faction<seq2seq4repair_space>where<seq2seq4repair_space>group_name<seq2seq4repair_space>=<seq2seq4repair_space>groupName;" ) + "end;" ) ) ) ; db . execute ( "drop<seq2seq4repair_space>procedure<seq2seq4repair_space>if<seq2seq4repair_space>exists<seq2seq4repair_space>mergeintogroup;" ) ; <START_BUG> db . execute ( ( "create<seq2seq4repair_space>definer=current_user<seq2seq4repair_space>procedure<seq2seq4repair_space>mergeintogroup(" + ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( "in<seq2seq4repair_space>groupName<seq2seq4repair_space>varchar(255),<seq2seq4repair_space>in<seq2seq4repair_space>tomerge<seq2seq4repair_space>varchar(255))<seq2seq4repair_space>" + "sql<seq2seq4repair_space>security<seq2seq4repair_space>invoker<seq2seq4repair_space>begin<seq2seq4repair_space>" ) + "update<seq2seq4repair_space>ignore<seq2seq4repair_space>faction_member<seq2seq4repair_space>fm<seq2seq4repair_space>" ) + "inner<seq2seq4repair_space>join<seq2seq4repair_space>faction_id<seq2seq4repair_space>fi<seq2seq4repair_space>on<seq2seq4repair_space>fi.group_name<seq2seq4repair_space>=<seq2seq4repair_space>groupName<seq2seq4repair_space>" ) + "inner<seq2seq4repair_space>join<seq2seq4repair_space>faction_id<seq2seq4repair_space>fii<seq2seq4repair_space>on<seq2seq4repair_space>fii.group_name<seq2seq4repair_space>=<seq2seq4repair_space>tomerge<seq2seq4repair_space>" ) + "set<seq2seq4repair_space>fm.group_id<seq2seq4repair_space>=<seq2seq4repair_space>fi.group_name<seq2seq4repair_space>" ) + "where<seq2seq4repair_space>fm.group_id<seq2seq4repair_space>=<seq2seq4repair_space>fii.group_id;" ) + "delete<seq2seq4repair_space>fm.*<seq2seq4repair_space>from<seq2seq4repair_space>faction_member<seq2seq4repair_space>fm<seq2seq4repair_space>" ) + "inner<seq2seq4repair_space>join<seq2seq4repair_space>faction_id<seq2seq4repair_space>fi<seq2seq4repair_space>on<seq2seq4repair_space>fi.group_name<seq2seq4repair_space>=<seq2seq4repair_space>tomerge<seq2seq4repair_space>" ) + "where<seq2seq4repair_space>fm.group_id<seq2seq4repair_space>=<seq2seq4repair_space>fi.group_id;" ) + "delete<seq2seq4repair_space>from<seq2seq4repair_space>faction<seq2seq4repair_space>where<seq2seq4repair_space>group_name<seq2seq4repair_space>=<seq2seq4repair_space>tomerge;" ) + "update<seq2seq4repair_space>faction_id<seq2seq4repair_space>fi<seq2seq4repair_space>" ) + "inner<seq2seq4repair_space>join<seq2seq4repair_space>faction_id<seq2seq4repair_space>fii<seq2seq4repair_space>on<seq2seq4repair_space>fii.group_name<seq2seq4repair_space>=<seq2seq4repair_space>tomerge<seq2seq4repair_space>" ) + "set<seq2seq4repair_space>fi.group_name<seq2seq4repair_space>=<seq2seq4repair_space>groupName<seq2seq4repair_space>" ) + "where<seq2seq4repair_space>fi.group_id<seq2seq4repair_space>=<seq2seq4repair_space>fii.group_id;" ) + "end;" ) ) ) ; <END_BUG> db . execute ( "drop<seq2seq4repair_space>procedure<seq2seq4repair_space>if<seq2seq4repair_space>exists<seq2seq4repair_space>createGroup;" ) ; db . execute ( ( "create<seq2seq4repair_space>definer=current_user<seq2seq4repair_space>procedure<seq2seq4repair_space>createGroup(" + ( ( ( ( ( ( ( ( ( ( ( "in<seq2seq4repair_space>group_name<seq2seq4repair_space>varchar(255)," + "in<seq2seq4repair_space>founder<seq2seq4repair_space>varchar(36)," ) + "in<seq2seq4repair_space>password<seq2seq4repair_space>varchar(255)," ) + "in<seq2seq4repair_space>discipline_flags<seq2seq4repair_space>int(11)," ) + "in<seq2seq4repair_space>group_type<seq2seq4repair_space>varchar(40))" ) + "sql<seq2seq4repair_space>security<seq2seq4repair_space>invoker<seq2seq4repair_space>begin<seq2seq4repair_space>" ) + "insert<seq2seq4repair_space>into<seq2seq4repair_space>faction_id(group_name)<seq2seq4repair_space>values<seq2seq4repair_space>(group_name);" ) + "insert<seq2seq4repair_space>into<seq2seq4repair_space>faction(group_name,<seq2seq4repair_space>founder,<seq2seq4repair_space>password,<seq2seq4repair_space>discipline_flags," ) + "group_type)<seq2seq4repair_space>values<seq2seq4repair_space>(group_name,<seq2seq4repair_space>founder,<seq2seq4repair_space>password,<seq2seq4repair_space>discipline_flags,<seq2seq4repair_space>group_type);" ) + "insert<seq2seq4repair_space>into<seq2seq4repair_space>faction_member<seq2seq4repair_space>(member_name,<seq2seq4repair_space>role,<seq2seq4repair_space>group_id)<seq2seq4repair_space>" ) + "select<seq2seq4repair_space>founder,<seq2seq4repair_space>'OWNER',<seq2seq4repair_space>f.group_id<seq2seq4repair_space>from<seq2seq4repair_space>faction_id<seq2seq4repair_space>f<seq2seq4repair_space>where<seq2seq4repair_space>f.group_name<seq2seq4repair_space>=<seq2seq4repair_space>group_name;" ) + "end;" ) ) ) ; } private PreparedStatement version ; private PreparedStatement updateVersion ; private PreparedStatement createGroup ; private PreparedStatement getGroup ; private PreparedStatement getAllGroupsNames ; private PreparedStatement deleteGroup ; private PreparedStatement addMember ; private PreparedStatement getMembers ; private PreparedStatement removeMember ; private PreparedStatement updatePassword ; private PreparedStatement addSubGroup ; private PreparedStatement getSubGroups ; private PreparedStatement getSuperGroup ; private PreparedStatement removeSubGroup ; private PreparedStatement addPerm ; private PreparedStatement getPerms ; private PreparedStatement updatePerm ; private PreparedStatement mergeGroup ; private PreparedStatement countGroups ; private PreparedStatement addAutoAcceptGroup ; private PreparedStatement getAutoAcceptGroup ; private PreparedStatement removeAutoAcceptGroup ; public void initializeStatements ( ) { } public int checkVersion ( String name ) { } public int updateVersion ( int version , String pluginname ) { } public void createGroup ( String group , UUID owner , String password , GroupType type ) { } public Group getGroup ( String groupName ) { } public List < String > getGroupNames ( UUID uuid ) { } public void deleteGroup ( String groupName ) { } public void addMember ( UUID member , String faction , PlayerType role ) { } public List < UUID > getAllMembers ( String groupName , PlayerType role ) { } public void removeMember ( UUID member , String group ) { } public void addSubGroup ( String group , String subGroup ) { } public List < Group > getSubGroups ( String group ) { } public Group getSuperGroup ( String subGroup ) { } public void removeSubGroup ( String group , String subGroup ) { } public void addPermission ( String groupName , String role , String values ) { } public Map < PlayerType , List < PermissionType > > getPermissions ( String group ) { } public void updatePermissions ( String group , PlayerType pType , String perms ) { } public int countGroups ( ) { } public void mergeGroup ( String groupName , String toMerge ) { } public void updatePassword ( String groupName , String password ) { } public void autoAcceptGroups ( UUID uuid ) { } public boolean shouldAutoAcceptGroups ( UUID uuid ) { } public void removeAutoAcceptGroup ( UUID uuid ) { } }

Fix:
db . execute ( ( "create<seq2seq4repair_space>definer=current_user<seq2seq4repair_space>procedure<seq2seq4repair_space>mergeintogroup(" + ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( "in<seq2seq4repair_space>groupName<seq2seq4repair_space>varchar(255),<seq2seq4repair_space>in<seq2seq4repair_space>tomerge<seq2seq4repair_space>varchar(255))<seq2seq4repair_space>" + "sql<seq2seq4repair_space>security<seq2seq4repair_space>invoker<seq2seq4repair_space>begin<seq2seq4repair_space>" ) + "update<seq2seq4repair_space>ignore<seq2seq4repair_space>faction_member<seq2seq4repair_space>fm<seq2seq4repair_space>" ) + "inner<seq2seq4repair_space>join<seq2seq4repair_space>faction_id<seq2seq4repair_space>fi<seq2seq4repair_space>on<seq2seq4repair_space>fi.group_name<seq2seq4repair_space>=<seq2seq4repair_space>groupName<seq2seq4repair_space>" ) + "inner<seq2seq4repair_space>join<seq2seq4repair_space>faction_id<seq2seq4repair_space>fii<seq2seq4repair_space>on<seq2seq4repair_space>fii.group_name<seq2seq4repair_space>=<seq2seq4repair_space>tomerge<seq2seq4repair_space>" ) + "set<seq2seq4repair_space>fm.group_id<seq2seq4repair_space>=<seq2seq4repair_space>fi.group_id<seq2seq4repair_space>" ) + "where<seq2seq4repair_space>fm.group_id<seq2seq4repair_space>=<seq2seq4repair_space>fii.group_id;" ) + "delete<seq2seq4repair_space>fm.*<seq2seq4repair_space>from<seq2seq4repair_space>faction_member<seq2seq4repair_space>fm<seq2seq4repair_space>" ) + "inner<seq2seq4repair_space>join<seq2seq4repair_space>faction_id<seq2seq4repair_space>fi<seq2seq4repair_space>on<seq2seq4repair_space>fi.group_name<seq2seq4repair_space>=<seq2seq4repair_space>tomerge<seq2seq4repair_space>" ) + "where<seq2seq4repair_space>fm.group_id<seq2seq4repair_space>=<seq2seq4repair_space>fi.group_id;" ) + "delete<seq2seq4repair_space>from<seq2seq4repair_space>faction<seq2seq4repair_space>where<seq2seq4repair_space>group_name<seq2seq4repair_space>=<seq2seq4repair_space>tomerge;" ) + "update<seq2seq4repair_space>faction_id<seq2seq4repair_space>fi<seq2seq4repair_space>" ) + "inner<seq2seq4repair_space>join<seq2seq4repair_space>faction_id<seq2seq4repair_space>fii<seq2seq4repair_space>on<seq2seq4repair_space>fii.group_name<seq2seq4repair_space>=<seq2seq4repair_space>tomerge<seq2seq4repair_space>" ) + "set<seq2seq4repair_space>fi.group_name<seq2seq4repair_space>=<seq2seq4repair_space>groupName<seq2seq4repair_space>" ) + "where<seq2seq4repair_space>fi.group_id<seq2seq4repair_space>=<seq2seq4repair_space>fii.group_id;" ) + "end;" ) ) ) ;