I think I found the problem. Along these 
[lines](http://github.com/saros-project/saros/blob/master@%7B2015-11-01%7D/de.fu_berlin.inf.dpp/src/de/fu_berlin/inf/dpp/ui/wizards/pages/EnterProjectNamePage.java#L637),
 the variable projectName receives newProjectName as value, then in the 
following loop, when the project name is sought in the guest workspace, the 
name of the original project is not compared, but a name without the numbers 
right. I made some black box testing and everything went normally . I also 
suggest changing the value idx 
[here](http://github.com/saros-project/saros/blob/master@%7B2015-11-01%7D/de.fu_berlin.inf.dpp/src/de/fu_berlin/inf/dpp/ui/wizards/pages/EnterProjectNamePage.java#L633)
 and 
[here](http://github.com/saros-project/saros/blob/master@%7B2015-11-01%7D/de.fu_berlin.inf.dpp/src/de/fu_berlin/inf/dpp/ui/wizards/pages/EnterProjectNamePage.java#L628)
 to get equal 1.

Then, the function can be like this:

~~~~
    String findProjectNameProposal(String projectName,
        String... reservedProjectNames) {

        int idx;

        for (idx = projectName.length() - 1; idx >= 0
            && Character.isDigit(projectName.charAt(idx)); idx--) {
            // NOP
        }

        String newProjectName;

        if (idx < 0)
            newProjectName = "";
        else
            newProjectName = projectName.substring(0, idx + 1);

        if (idx == projectName.length() - 1)
            idx = 1;
        else {
            try {
                idx = Integer.valueOf(projectName.substring(idx + 1));
            } catch (NumberFormatException e) {
                idx = 1;
            }
        }
       
        while (!projectNameIsUnique(projectName, reservedProjectNames)){
            projectName = newProjectName + idx;
            idx++;
        }

        return projectName;
    }

~~~~


---

** [bugs:#837] Project names with trailing numbers are truncated in Wizard**

**Status:** open
**Group:** OTHER
**Created:** Wed Oct 15, 2014 10:52 AM UTC by Franz Zieris
**Last Updated:** Thu Nov 05, 2015 01:33 PM UTC
**Owner:** nobody


* Share a project with a trailing number in its name, such as "ALP4".
* In the "Add Projects" dialog on the recipients side, the text box under the 
option "Create new project" is pre-filled with the project name without the 
number, i.e. "ALP" in the above mentioned example.

(This should probably by fixed in 
<code>EnterProjectNamePage.findProjectNameProposal()</code>)


---

Sent from sourceforge.net because [email protected] is subscribed 
to https://sourceforge.net/p/dpp/bugs/

To unsubscribe from further messages, a project admin can change settings at 
https://sourceforge.net/p/dpp/admin/bugs/options.  Or, if this is a mailing 
list, you can unsubscribe from the mailing list.
------------------------------------------------------------------------------
_______________________________________________
DPP-Robot mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dpp-robot

Reply via email to