Index: lams_central/src/java/org/lamsfoundation/lams/webservice/xml/LessonJoinServlet.java =================================================================== RCS file: /usr/local/cvsroot/lams_central/src/java/org/lamsfoundation/lams/webservice/xml/LessonJoinServlet.java,v diff -u -r1.7 -r1.8 --- lams_central/src/java/org/lamsfoundation/lams/webservice/xml/LessonJoinServlet.java 24 Mar 2009 04:18:04 -0000 1.7 +++ lams_central/src/java/org/lamsfoundation/lams/webservice/xml/LessonJoinServlet.java 10 Sep 2009 10:21:24 -0000 1.8 @@ -75,6 +75,7 @@ */ public class LessonJoinServlet extends HttpServlet { + private static final long serialVersionUID = -8013072844129192750L; private static Logger log = Logger.getLogger(LessonJoinServlet.class); private static ILessonService lessonService = null; private static IUserManagementService userService = null; @@ -99,7 +100,7 @@ "integrationService"); } - public void doGet(HttpServletRequest request, HttpServletResponse response) + public synchronized void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { PrintWriter out = response.getWriter(); @@ -301,22 +302,24 @@ } private String incrementLessonName(String name) { + String newName = name; if (!StringUtils.isBlank(name)) { int i = name.lastIndexOf(' '); if (i >= 0) { String counterStr = name.substring(i).trim(); try { int counterInt = Integer.parseInt(counterStr); counterInt++; - return (name.substring(0, i) + " " + counterInt); + newName = (name.substring(0, i) + " " + counterInt); } catch (NumberFormatException e) { - return name + " 2"; + newName = name + " 2"; } } else { - return name + " 2"; + newName = name + " 2"; } } - return name; + log.debug("Created new lesson name '" + newName + "' from original '" + name + "'"); + return newName; } private List getListFromSet(Set users) {