diff options
Diffstat (limited to 'server')
8 files changed, 93 insertions, 15 deletions
diff --git a/server/src/com/vaadin/data/Property.java b/server/src/com/vaadin/data/Property.java index 8316d765ce..0aa6de1c2e 100644 --- a/server/src/com/vaadin/data/Property.java +++ b/server/src/com/vaadin/data/Property.java @@ -116,9 +116,9 @@ public interface Property<T> extends Serializable { * or rollback. * * Note that this does not refer to e.g. database transactions but rather - * two-phase commit that allows resetting old field values on a form etc. if - * the commit of one of the properties fails after others have already been - * committed. If + * two-phase commit that allows resetting old field values (in e.g. a + * FieldGroup) if the commit of one of the properties fails after other + * properties have already been committed. * * @param <T> * The type of the property diff --git a/server/src/com/vaadin/data/fieldgroup/BeanFieldGroup.java b/server/src/com/vaadin/data/fieldgroup/BeanFieldGroup.java index 502394f38a..0b4e3a8049 100644 --- a/server/src/com/vaadin/data/fieldgroup/BeanFieldGroup.java +++ b/server/src/com/vaadin/data/fieldgroup/BeanFieldGroup.java @@ -89,7 +89,7 @@ public class BeanFieldGroup<T> extends FieldGroup { java.lang.reflect.Field field1 = cls .getDeclaredField(propertyId); return field1; - } catch (NoSuchFieldError e) { + } catch (NoSuchFieldException e) { // Try super classes until we reach Object Class<?> superClass = cls.getSuperclass(); if (superClass != null && superClass != Object.class) { diff --git a/server/src/com/vaadin/data/util/BeanContainer.java b/server/src/com/vaadin/data/util/BeanContainer.java index 36ac414ad6..4e435aabcc 100644 --- a/server/src/com/vaadin/data/util/BeanContainer.java +++ b/server/src/com/vaadin/data/util/BeanContainer.java @@ -55,8 +55,7 @@ import java.util.Collection; * </p> * * <p> - * It is not possible to add additional properties to the container and nested - * bean properties are not supported. + * It is not possible to add additional properties to the container. * </p> * * @param <IDTYPE> diff --git a/server/src/com/vaadin/data/util/BeanItemContainer.java b/server/src/com/vaadin/data/util/BeanItemContainer.java index b501c06426..e7b38d8b88 100644 --- a/server/src/com/vaadin/data/util/BeanItemContainer.java +++ b/server/src/com/vaadin/data/util/BeanItemContainer.java @@ -43,8 +43,7 @@ import java.util.Collection; * </p> * * <p> - * It is not possible to add additional properties to the container and nested - * bean properties are not supported. + * It is not possible to add additional properties to the container. * </p> * * @param <BEANTYPE> diff --git a/server/src/com/vaadin/server/BootstrapHandler.java b/server/src/com/vaadin/server/BootstrapHandler.java index f280bc80b7..03421ce487 100644 --- a/server/src/com/vaadin/server/BootstrapHandler.java +++ b/server/src/com/vaadin/server/BootstrapHandler.java @@ -372,6 +372,18 @@ public abstract class BootstrapHandler implements RequestHandler { boolean isDebug = !context.getSession().getConfiguration() .isProductionMode(); + if (isDebug) { + /* + * Add tracking needed for getting bootstrap metrics to the client + * side Profiler if another implementation hasn't already been + * added. + */ + builder.append("if (typeof window.__gwtStatsEvent != 'function') {\n"); + builder.append("vaadin.gwtStatsEvents = [];\n"); + builder.append("window.__gwtStatsEvent = function(event) {vaadin.gwtStatsEvents.push(event); return true;};\n"); + builder.append("}\n"); + } + builder.append("vaadin.initApplication(\""); builder.append(context.getAppId()); builder.append("\","); diff --git a/server/src/com/vaadin/server/StreamResource.java b/server/src/com/vaadin/server/StreamResource.java index adc2e23a3c..7210bcaffb 100644 --- a/server/src/com/vaadin/server/StreamResource.java +++ b/server/src/com/vaadin/server/StreamResource.java @@ -23,9 +23,7 @@ import com.vaadin.util.FileTypeResolver; /** * <code>StreamResource</code> is a resource provided to the client directly by - * the application. The strean resource is fetched from URI that is most often - * in the context of the application or window. The resource is automatically - * registered to window in creation. + * the application. * * @author Vaadin Ltd. * @since 3.0 @@ -65,8 +63,6 @@ public class StreamResource implements ConnectorResource { * the source Stream. * @param filename * the name of the file. - * @param application - * the Application object. */ public StreamResource(StreamSource streamSource, String filename) { setFilename(filename); diff --git a/server/tests/src/com/vaadin/data/fieldgroup/BeanFieldGroupTest.java b/server/tests/src/com/vaadin/data/fieldgroup/BeanFieldGroupTest.java new file mode 100644 index 0000000000..a01c2dea8f --- /dev/null +++ b/server/tests/src/com/vaadin/data/fieldgroup/BeanFieldGroupTest.java @@ -0,0 +1,71 @@ +/* + * Copyright 2012 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.data.fieldgroup; + +import junit.framework.Assert; + +import org.junit.Test; + +public class BeanFieldGroupTest { + + class Main { + private String mainField; + + public String getMainField() { + return mainField; + } + + public void setMainField(String mainField) { + this.mainField = mainField; + } + + } + + class Sub1 extends Main { + private Integer sub1Field; + + public Integer getSub1Field() { + return sub1Field; + } + + public void setSub1Field(Integer sub1Field) { + this.sub1Field = sub1Field; + } + + } + + class Sub2 extends Sub1 { + private boolean sub2field; + + public boolean isSub2field() { + return sub2field; + } + + public void setSub2field(boolean sub2field) { + this.sub2field = sub2field; + } + + } + + @Test + public void propertyTypeWithoutItem() { + BeanFieldGroup<Sub2> s = new BeanFieldGroup<BeanFieldGroupTest.Sub2>( + Sub2.class); + Assert.assertEquals(boolean.class, s.getPropertyType("sub2field")); + Assert.assertEquals(Integer.class, s.getPropertyType("sub1Field")); + Assert.assertEquals(String.class, s.getPropertyType("mainField")); + } +} diff --git a/server/tests/src/com/vaadin/tests/server/component/ui/CustomUIClassLoader.java b/server/tests/src/com/vaadin/tests/server/component/ui/CustomUIClassLoader.java index e02fafeaff..8884c0c27c 100644 --- a/server/tests/src/com/vaadin/tests/server/component/ui/CustomUIClassLoader.java +++ b/server/tests/src/com/vaadin/tests/server/component/ui/CustomUIClassLoader.java @@ -52,13 +52,14 @@ public class CustomUIClassLoader extends TestCase { * @throws Exception * if thrown */ - public void testWithNullClassLoader() throws Exception { + public void testWithDefaultClassLoader() throws Exception { VaadinSession application = createStubApplication(); application.setConfiguration(createConfigurationMock()); DefaultUIProvider uiProvider = new DefaultUIProvider(); Class<? extends UI> uiClass = uiProvider - .getUIClass(new UIClassSelectionEvent(createRequestMock(null))); + .getUIClass(new UIClassSelectionEvent( + createRequestMock(getClass().getClassLoader()))); assertEquals(MyUI.class, uiClass); } |