Program: 52325
Project: 52325
Buggy source:
@Transactional @Override public void add(ConnectionGroup object) throws GuacamoleException {
  String name=object.getName().trim();
  if (name.isEmpty())   throw new GuacamoleClientException("String_Node_Str");
  permissionCheckService.verifySystemAccess(this.user_id,MySQLConstants.SYSTEM_CONNECTION_GROUP_CREATE);
  permissionCheckService.verifyConnectionGroupAccess(this.user_id,this.parentID,MySQLConstants.CONNECTION_GROUP_UPDATE);
  permissionCheckService.verifyConnectionGroupUsageAccess(parentID,user_id,MySQLConstants.CONNECTION_GROUP_ORGANIZATIONAL);
  MySQLConnectionGroup previousConnectionGroup=connectionGroupService.retrieveConnectionGroup(name,parentID,user_id);
  if (previousConnectionGroup != null)   throw new GuacamoleClientException("String_Node_Str");
  MySQLConnectionGroup connectionGroup=connectionGroupService.createConnectionGroup(name,user_id,parentID);
  ConnectionGroupPermissionKey newConnectionGroupPermission=new ConnectionGroupPermissionKey();
  newConnectionGroupPermission.setUser_id(this.user_id);
  newConnectionGroupPermission.setConnection_group_id(connectionGroup.getConnectionGroupID());
  newConnectionGroupPermission.setPermission(MySQLConstants.CONNECTION_GROUP_READ);
  connectionGroupPermissionDAO.insert(newConnectionGroupPermission);
  newConnectionGroupPermission.setPermission(MySQLConstants.CONNECTION_GROUP_UPDATE);
  connectionGroupPermissionDAO.insert(newConnectionGroupPermission);
  newConnectionGroupPermission.setPermission(MySQLConstants.CONNECTION_GROUP_DELETE);
  connectionGroupPermissionDAO.insert(newConnectionGroupPermission);
  newConnectionGroupPermission.setPermission(MySQLConstants.CONNECTION_GROUP_ADMINISTER);
  connectionGroupPermissionDAO.insert(newConnectionGroupPermission);
}

Fixed version (ground truth):
@Transactional @Override public void add(ConnectionGroup object) throws GuacamoleException {
  String name=object.getName().trim();
  if (name.isEmpty())   throw new GuacamoleClientException("String_Node_Str");
  Type type=object.getType();
  String mySQLType=MySQLConstants.getConnectionGroupTypeConstant(type);
  permissionCheckService.verifySystemAccess(this.user_id,MySQLConstants.SYSTEM_CONNECTION_GROUP_CREATE);
  permissionCheckService.verifyConnectionGroupAccess(this.user_id,this.parentID,MySQLConstants.CONNECTION_GROUP_UPDATE);
  permissionCheckService.verifyConnectionGroupUsageAccess(parentID,user_id,MySQLConstants.CONNECTION_GROUP_ORGANIZATIONAL);
  MySQLConnectionGroup previousConnectionGroup=connectionGroupService.retrieveConnectionGroup(name,parentID,user_id);
  if (previousConnectionGroup != null)   throw new GuacamoleClientException("String_Node_Str");
  MySQLConnectionGroup connectionGroup=connectionGroupService.createConnectionGroup(name,user_id,parentID,mySQLType);
  ConnectionGroupPermissionKey newConnectionGroupPermission=new ConnectionGroupPermissionKey();
  newConnectionGroupPermission.setUser_id(this.user_id);
  newConnectionGroupPermission.setConnection_group_id(connectionGroup.getConnectionGroupID());
  newConnectionGroupPermission.setPermission(MySQLConstants.CONNECTION_GROUP_READ);
  connectionGroupPermissionDAO.insert(newConnectionGroupPermission);
  newConnectionGroupPermission.setPermission(MySQLConstants.CONNECTION_GROUP_UPDATE);
  connectionGroupPermissionDAO.insert(newConnectionGroupPermission);
  newConnectionGroupPermission.setPermission(MySQLConstants.CONNECTION_GROUP_DELETE);
  connectionGroupPermissionDAO.insert(newConnectionGroupPermission);
  newConnectionGroupPermission.setPermission(MySQLConstants.CONNECTION_GROUP_ADMINISTER);
  connectionGroupPermissionDAO.insert(newConnectionGroupPermission);
}