@@ -0,0 +1,1963 @@
+%0A/*%0A * Copyright (C) 2011 Archie L. Cobbs. All rights reserved.%0A *%0A * $Id$%0A */%0A%0Apackage org.dellroad.stuff.vaadin;%0A%0A/**%0A * Miscellaneous utility methods.%0A */%0Apublic final class VaadinUtil %7B%0A%0A    private VaadinUtil() %7B%0A    %7D%0A%0A    /**%0A     * Verify that we are running in the context of the given %7B@link ContextApplication%7D and that it is locked.%0A     * This method can be used by any code that manipulates Vaadin state to assert that the proper Vaadin%0A     * locking has been performed.%0A     *%0A     * @param application the %7B@link ContextApplication%7D we are supposed to be running with%0A     * @throws IllegalArgumentException if %7B@code application%7D is null%0A     * @throws IllegalStateException if there is no %7B@link ContextApplication%7D associated with the current thread%0A     * @throws IllegalStateException if the %7B@link ContextApplication%7D associated with the current thread is not %7B@code application%7D%0A     * @throws IllegalStateException if the %7B@link ContextApplication%7D associated with the current thread is not locked%0A     */%0A    public static void assertApplication(ContextApplication application) %7B%0A        if (application == null)%0A            throw new IllegalArgumentException(%22null application%22);%0A        final ContextApplication currentApplication = ContextApplication.currentApplication();%0A        if (currentApplication == null)%0A            throw new IllegalStateException(%22there is no ContextApplication associated with the current thread%22);%0A        if (currentApplication != application) %7B%0A            throw new IllegalStateException(%22the ContextApplication associated with the current thread %22 + currentApplication%0A              + %22 is not the same application as the given one %22 + application);%0A        %7D%0A        if (!Thread.holdsLock(application)) %7B%0A            throw new IllegalStateException(%22the ContextApplication associated with the current thread %22 + currentApplication%0A              + %22 is not locked by this thread%22);%0A        %7D%0A    %7D%0A%7D%0A%0A

Add Vaadin 6.x version of VaadinUtil.