Hello!

I am quite baffled by the NullPointerException i get when i add
suggestions to a MultiWordSuggestOracle in order to create a
suggestion box later.

MultiWordSuggestOracle oracle = new MultiWordSuggestOracle();
List<String> suggestions = new ArrayList<String>();

for(int i = 0; i < getWidgetData().length; i++)
        suggestions.add(getWidgetData()[i]);

oracle.addAll(suggestions);  -> NULL POINTER EXCEPTION

Searching around, i found out that the exception is being propagated
from the following method (method that belongs to the class
com.google.gwt.user.client.ui.MultiWordSuggestOracle)

private String  [Search] normalizeSuggestion(String
formattedSuggestion) {
    // Formatted suggestions should already have normalized
whitespace. So we
    // can skip that step.
    // Lower case suggestion.

    formattedSuggestion = formattedSuggestion.toLowerCase(); -> NULL
POINTER EXCEPTION

    // Apply whitespace.

    if (whitespaceChars != null) {
      for (int i = 0; i < whitespaceChars.length; i++) {
        char ignore = whitespaceChars[i];
        formattedSuggestion = formattedSuggestion.replace(ignore,
WHITESPACE_CHAR);
      }
   }
    return formattedSuggestion;
}

I have to admit i am having trouble coming up with an explanation or
solution, so any help will be most welcome and appreciated!

Thanks in advance!

Rafael

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to