URISyntaxException while handling URI containing whitespaces

Hi guys. Before posting a bug, I would like to post it here as I might get my facts wrong.
I created a sample application with vaadin 7.0.beta9 and authorize into vk.com. I create a button and handle response parameters after oauth mechanism has done its job. I am running vaadin with inside embedded jetty server. If authorization succeeds, then everything fine and main page of my application renders flawlessly. But if I deny authorization, then exception is thrown. The request uri for vaadin servlet is “http://localhost:8080/#error=access_denied&error_reason=user_denied&error_description=User denied your request”. It seems that the whitespace in “error_reason” parameter is the cause here.


package ru.misty.crm;

import com.vaadin.annotations.PreserveOnRefresh;
import com.vaadin.server.Page;
import com.vaadin.server.Page.UriFragmentChangedEvent;
import com.vaadin.server.VaadinRequest;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.UI;
import com.vaadin.ui.VerticalLayout;
import java.util.HashMap;
import java.util.Map;
import java.util.StringTokenizer;

/**
 * The Application's "main" class
 */
@SuppressWarnings("serial")
@PreserveOnRefresh
public class MyVaadinUI extends UI {

    @Override
    protected void init(VaadinRequest request) {
        Button button = new Button("Click Me");
        final VerticalLayout vl = new VerticalLayout();        
        Page.getCurrent().addUriFragmentChangedListener(new Page.UriFragmentChangedListener() {
            @Override
            public void uriFragmentChanged(UriFragmentChangedEvent event) {
                String uriFragment = event.getUriFragment();
                Map<String, String> params = getParams(uriFragment);
                System.out.println("Map is " + params);
            }
        });
        button.addClickListener(new Button.ClickListener() {
            public void buttonClick(ClickEvent event) {
                fireVkRequest();
            }
        });
        vl.addComponent(button);
        setContent(vl);
    }

    
    private void fireVkRequest() {
        Page.getCurrent().open("https://oauth.vk.com/authorize?client_id=3216201&scope=groups,wall,offline&redirect_uri=http://localhost:8080&display=page&response_type=token", "_self");
    }

    private Map<String, String> getParams(String fragment) {
        StringTokenizer paramGroup = new StringTokenizer(fragment, "&");
        Map<String, String> paramValues = new HashMap<String, String>();
        while (paramGroup.hasMoreTokens()) {
            StringTokenizer value = new StringTokenizer(paramGroup.nextToken(), "=");
            paramValues.put(value.nextToken(), value.nextToken());
        }
        return paramValues;
    }

web.xml


<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
    <display-name>Vaadin Web Application</display-name>
    <context-param>
        <description>Vaadin production mode</description>
        <param-name>productionMode</param-name>
        <param-value>false</param-value>
    </context-param>
    <servlet>
        <servlet-name>Vaadin Application Servlet</servlet-name>
        <servlet-class>com.vaadin.server.VaadinServlet</servlet-class>
        <!--<servlet-class>ru.misty.crm.VaadinFixedServlet</servlet-class>-->
        <init-param>
            <description>Vaadin UI to display</description>
            <param-name>UI</param-name>
            <param-value>ru.misty.crm.MyVaadinUI</param-value>
        </init-param>
                <init-param>
            <description>Application widgetset</description>
            <param-name>widgetset</param-name>
            <param-value>ru.misty.crm.AppWidgetSet</param-value>
        </init-param>
    </servlet>
    <servlet-mapping>
        <servlet-name>Vaadin Application Servlet</servlet-name>
        <url-pattern>/*</url-pattern>
    </servlet-mapping>
</web-app>