ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/PrepareString.java [3397:3558]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        target[newPos++] = c;
                        
                        pos++;
                        normState = NormStateEnum.INITIAL_CHAR;
                    }
                    
                    break;
                    
                case INITIAL_CHAR :
                    if ( pos == origin.length )
                    {
                        // We are done, add a space
                        target[newPos++] = ' ';
                        normState = NormStateEnum.END;
                        
                        break;
                    }
                    
                    c = origin[pos];
                    
                    if ( c == ' ' )
                    {
                        // Switch to the SPACES state
                        pos++;
                        normState = NormStateEnum.SPACES;
                    }
                    else
                    {
                        // Add the char
                        target[newPos++] = c;
                        pos++;
                        normState = NormStateEnum.CHARS;
                    }
                    
                    break;

                case INITIAL_SPACES :
                    if ( pos == origin.length )
                    {
                        // We are done, this is an empty String
                        return "  ";
                    }
                    
                    c = origin[pos];
                    
                    if ( c == ' ' )
                    {
                        pos++;
                        // Keep going with the current state
                    }
                    else
                    {
                        // Add a space
                        target[newPos++] = ' ';
                        
                        // Add the char
                        target[newPos++] = c;
                        pos++;
                        normState = NormStateEnum.INITIAL_CHAR;
                    }
                    
                    break;

                case CHARS :
                    if ( pos == origin.length )
                    {
                        // We are done, add a Space
                        target[newPos++] = ' ';
                        normState = NormStateEnum.END;
                        
                        break;
                    }
                    
                    c = origin[pos];
                    
                    if ( c == ' ' )
                    {
                        pos++;
                        normState = NormStateEnum.SPACES;
                    }
                    else
                    {
                        // Add the char
                        target[newPos++] = c;
                        pos++;
                        // We keep going on the same state
                    }
                    
                    break;

                case SPACES :
                    if ( pos == origin.length )
                    {
                        // We are done, add a Space
                        target[newPos++] = ' ';
                        normState = NormStateEnum.END;

                        break;
                    }
                    
                    c = origin[pos];
                    
                    if ( c == ' ' )
                    {
                        pos++;
                        // We keep going on the same state
                    }
                    else
                    {
                        // Add the two spaces
                        target[newPos++] = ' ';
                        target[newPos++] = ' ';
                        
                        // Add the char
                        target[newPos++] = c;
                        pos++;
                        
                        // Switch to SPACE_CHAR state
                        normState = NormStateEnum.SPACE_CHAR;
                    }
                    
                    break;

                case SPACE_CHAR :
                    if ( pos == origin.length )
                    {
                        // We are done, add a Space
                        target[newPos++] = ' ';
                        normState = NormStateEnum.END;

                        break;
                    }
                    
                    c = origin[pos];
                    
                    if ( c == ' ' )
                    {
                        pos++;
                        
                        // Switch to Spaces state
                        normState = NormStateEnum.SPACES;
                    }
                    else
                    {
                        // Add the char
                        target[newPos++] = c;
                        pos++;
                        
                        // Switch to CHARS state
                        normState = NormStateEnum.CHARS;
                    }
                    
                    break;
                    
                default :
                    // Do nothing
                    break;
            }
        }

        // create the resulting String
        return new String( target, 0, newPos );
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/PrepareString.java [4054:4215]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        target[newPos++] = c;
                        
                        pos++;
                        normState = NormStateEnum.INITIAL_CHAR;
                    }
                    
                    break;
                    
                case INITIAL_CHAR :
                    if ( pos == origin.length )
                    {
                        // We are done, add a space
                        target[newPos++] = ' ';
                        normState = NormStateEnum.END;
                        
                        break;
                    }
                    
                    c = origin[pos];
                    
                    if ( c == ' ' )
                    {
                        // Switch to the SPACES state
                        pos++;
                        normState = NormStateEnum.SPACES;
                    }
                    else
                    {
                        // Add the char
                        target[newPos++] = c;
                        pos++;
                        normState = NormStateEnum.CHARS;
                    }
                    
                    break;

                case INITIAL_SPACES :
                    if ( pos == origin.length )
                    {
                        // We are done, this is an empty String
                        return " ";
                    }
                    
                    c = origin[pos];
                    
                    if ( c == ' ' )
                    {
                        pos++;
                        // Keep going with the current state
                    }
                    else
                    {
                        // Add a space
                        target[newPos++] = ' ';
                        
                        // Add the char
                        target[newPos++] = c;
                        pos++;
                        normState = NormStateEnum.INITIAL_CHAR;
                    }
                    
                    break;

                case CHARS :
                    if ( pos == origin.length )
                    {
                        // We are done, add a Space
                        target[newPos++] = ' ';
                        normState = NormStateEnum.END;
                        
                        break;
                    }
                    
                    c = origin[pos];
                    
                    if ( c == ' ' )
                    {
                        pos++;
                        normState = NormStateEnum.SPACES;
                    }
                    else
                    {
                        // Add the char
                        target[newPos++] = c;
                        pos++;
                        // We keep going on the same state
                    }
                    
                    break;

                case SPACES :
                    if ( pos == origin.length )
                    {
                        // We are done, add a Space
                        target[newPos++] = ' ';
                        normState = NormStateEnum.END;

                        break;
                    }
                    
                    c = origin[pos];
                    
                    if ( c == ' ' )
                    {
                        pos++;
                        // We keep going on the same state
                    }
                    else
                    {
                        // Add the two spaces
                        target[newPos++] = ' ';
                        target[newPos++] = ' ';
                        
                        // Add the char
                        target[newPos++] = c;
                        pos++;
                        
                        // Switch to SPACE_CHAR state
                        normState = NormStateEnum.SPACE_CHAR;
                    }
                    
                    break;

                case SPACE_CHAR :
                    if ( pos == origin.length )
                    {
                        // We are done, add a Space
                        target[newPos++] = ' ';
                        normState = NormStateEnum.END;

                        break;
                    }
                    
                    c = origin[pos];
                    
                    if ( c == ' ' )
                    {
                        pos++;
                        
                        // Switch to Spaces state
                        normState = NormStateEnum.SPACES;
                    }
                    else
                    {
                        // Add the char
                        target[newPos++] = c;
                        pos++;
                        
                        // Switch to CHARS state
                        normState = NormStateEnum.CHARS;
                    }
                    
                    break;
                    
                default :
                    // Do nothing
                    break;
            }
        }

        // create the resulting String
        return new String( target, 0, newPos );
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



