From 636f4f05a26b38547b83b60bc1ce36e7c3460a1d Mon Sep 17 00:00:00 2001 From: Frank Hossfeld Date: Thu, 30 Mar 2023 14:26:34 +0200 Subject: [PATCH 1/5] done --- gwt-editor-gwt2-tests/pom.xml | 2 +- .../editor/processor/DriverProcessor.java | 199 +++++++++++++----- .../editor/client/SimpleBeanEditorTest.java | 36 ++-- .../processor/model/EditorModelTest.java | 23 +- .../result/TestEditor01_Driver_Impl.java | 2 + .../result/TestEditor01_id_Context.java | 15 +- .../result/TestEditor02_Driver_Impl.java | 2 + .../result/TestEditor02_id_Context.java | 15 +- .../result/TestEditor03_Driver_Impl.java | 2 + .../result/TestEditor03_id_Context.java | 15 +- .../result/TestEditor04_Driver_Impl.java | 2 + .../result/TestEditor04_active_Context.java | 15 +- .../result/TestEditor04_age_Context.java | 15 +- .../result/TestEditor04_email_Context.java | 13 +- .../TestEditor04_firstName_Context.java | 15 +- .../result/TestEditor04_id_Context.java | 15 +- .../result/TestEditor04_lastName_Context.java | 15 +- .../result/TestEditor04_phone_Context.java | 15 +- .../result/TestEditor05_Driver_Impl.java | 2 + .../result/TestEditor05_email_Context.java | 15 +- .../result/TestEditor05_id_Context.java | 5 +- .../result/TestEditor05_name_Context.java | 5 +- .../result/TestEditor05_phone_Context.java | 5 +- .../result/TestEditor06_email_Context.java | 15 +- .../result/TestEditor07_Driver_Impl.java | 7 +- ...TestEditor07_SimpleBeanEditorDelegate.java | 22 +- .../result/TestEditor07_email_Context.java | 15 +- .../result/TestEditor07_id_Context.java | 5 +- .../result/TestEditor07_name_Context.java | 17 +- .../result/TestEditor07_phone_Context.java | 5 +- .../result/TestEditor08_Driver_Impl.java | 2 + ...TestEditor08_SimpleBeanEditorDelegate.java | 26 +-- .../result/TestEditor08_email_Context.java | 15 +- .../result/TestEditor08_id_Context.java | 5 +- .../result/TestEditor08_name_Context.java | 5 +- .../result/TestEditor08_phone_Context.java | 5 +- .../editor/client/impl/Initializer.java | 3 - 37 files changed, 324 insertions(+), 271 deletions(-) diff --git a/gwt-editor-gwt2-tests/pom.xml b/gwt-editor-gwt2-tests/pom.xml index 16049a6..406331e 100644 --- a/gwt-editor-gwt2-tests/pom.xml +++ b/gwt-editor-gwt2-tests/pom.xml @@ -18,7 +18,7 @@ 1.0.0 - 2.9.0 + 2.10.0 4.13.1 diff --git a/gwt-editor-processor/src/main/java/org/gwtproject/editor/processor/DriverProcessor.java b/gwt-editor-processor/src/main/java/org/gwtproject/editor/processor/DriverProcessor.java index 8edc9d2..2311c30 100644 --- a/gwt-editor-processor/src/main/java/org/gwtproject/editor/processor/DriverProcessor.java +++ b/gwt-editor-processor/src/main/java/org/gwtproject/editor/processor/DriverProcessor.java @@ -20,13 +20,30 @@ import com.google.auto.common.MoreTypes; import com.google.auto.service.AutoService; import com.google.common.base.Stopwatch; -import com.squareup.javapoet.*; +import com.squareup.javapoet.AnnotationSpec; +import com.squareup.javapoet.ClassName; +import com.squareup.javapoet.FieldSpec; +import com.squareup.javapoet.JavaFile; +import com.squareup.javapoet.MethodSpec; +import com.squareup.javapoet.ParameterizedTypeName; +import com.squareup.javapoet.TypeName; +import com.squareup.javapoet.TypeSpec; import java.io.IOException; import java.io.PrintWriter; import java.io.StringWriter; -import java.util.*; +import java.util.ArrayList; +import java.util.IdentityHashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.StringJoiner; import java.util.stream.Stream; -import javax.annotation.processing.*; +import javax.annotation.processing.AbstractProcessor; +import javax.annotation.processing.Filer; +import javax.annotation.processing.Messager; +import javax.annotation.processing.ProcessingEnvironment; +import javax.annotation.processing.Processor; +import javax.annotation.processing.RoundEnvironment; import javax.lang.model.SourceVersion; import javax.lang.model.element.Element; import javax.lang.model.element.Modifier; @@ -164,6 +181,10 @@ protected void generate(TypeElement interfaceToImplement, EditorModel rootEditor .addModifiers(Modifier.PUBLIC) .returns(void.class) .addAnnotation(Override.class) + .addAnnotation( + AnnotationSpec.builder(SuppressWarnings.class) + .addMember("value", "$S", "unchecked") + .build()) .addParameter(EditorVisitor.class, "visitor") // ugly cast to shut up java warnings at compile time - however, this might be overkill, // could just use raw types @@ -240,6 +261,10 @@ protected void generate(TypeElement interfaceToImplement, EditorModel rootEditor /** * Joins the name of the type with any enclosing types, with "_" as the delimeter, and appends an * optional suffix. + * + * @param interfaceToImplement TypeElement of the interface to implement + * @param suffix suffix to use or null (no suffix) + * @return created name */ protected String createNameFromEnclosedTypes(TypeElement interfaceToImplement, String suffix) { StringJoiner joiner = new StringJoiner("_", "", suffix == null ? "" : suffix); @@ -272,22 +297,38 @@ protected ClassName getEditorDelegate(EditorModel editorModel, EditorProperty da TypeSpec.classBuilder(delegateSimpleName) .addOriginatingElement(types.asElement(data.getEditedType())) .addOriginatingElement(types.asElement(data.getEditorType())) - .addModifiers(Modifier.PUBLIC) - // Once GWT supports the new package of the Generated class - // we can uncomment this code - // .addAnnotation( - // AnnotationSpec.builder(getGeneratedClassName()) - // .addMember("value", "\"$L\"", - // DriverProcessor.class.getCanonicalName()) - // .build()) - .superclass(getEditorDelegateType()); // raw type here, for the same reason as above + .addModifiers(Modifier.PUBLIC); + // Once GWT supports the new package of the Generated class + // we can uncomment this code + // .addAnnotation( + // AnnotationSpec.builder(getGeneratedClassName()) + // .addMember("value", "\"$L\"", + // DriverProcessor.class.getCanonicalName()) + // .build()) + if (data.getEditedType() != null && data.getEditorType() != null) { + ParameterizedTypeName delegateType = + ParameterizedTypeName.get( + getEditorDelegateType(), + TypeName.get(data.getEditedType()), + TypeName.get(data.getEditorType())); + delegateTypeBuilder.superclass(delegateType); + } else { + delegateTypeBuilder.superclass(getEditorDelegateType()); + } NameFactory names = new NameFactory(); Map delegateFields = new IdentityHashMap<>(); - delegateTypeBuilder.addField( - FieldSpec.builder(rawEditorType, "editor", Modifier.PRIVATE).build()); - names.addName("editor"); + if (data.getEditorType() != null) { + delegateTypeBuilder.addField( + FieldSpec.builder(ClassName.get(data.getEditorType()), "editor", Modifier.PRIVATE) + .build()); + names.addName("editor"); + } else { + delegateTypeBuilder.addField( + FieldSpec.builder(rawEditorType, "editor", Modifier.PRIVATE).build()); + names.addName("editor"); + } delegateTypeBuilder.addField( FieldSpec.builder(ClassName.get(data.getEditedType()), "object", Modifier.PRIVATE).build()); names.addName("object"); @@ -298,26 +339,48 @@ protected ClassName getEditorDelegate(EditorModel editorModel, EditorProperty da String fieldName = names.createName(d.getPropertyName() + "Delegate"); delegateFields.put(d, fieldName); delegateTypeBuilder.addField( - getEditorDelegateType(), fieldName, Modifier.PRIVATE); // TODO parameterize + ParameterizedTypeName.get( + getEditorDelegateType(), + TypeName.get(d.getEditedType()), + TypeName.get(d.getEditorType())), + fieldName, + Modifier.PRIVATE); } } - delegateTypeBuilder.addMethod( - MethodSpec.methodBuilder("getEditor") - .addModifiers(Modifier.PROTECTED) - .returns(rawEditorType) - .addAnnotation(Override.class) - .addStatement("return editor") - .build()); - - delegateTypeBuilder.addMethod( - MethodSpec.methodBuilder("setEditor") - .addModifiers(Modifier.PROTECTED) - .returns(void.class) - .addAnnotation(Override.class) - .addParameter(Editor.class, "editor") - .addStatement("this.editor = ($T) editor", rawEditorType) - .build()); + if (data.getEditorType() != null) { + delegateTypeBuilder.addMethod( + MethodSpec.methodBuilder("getEditor") + .addModifiers(Modifier.PROTECTED) + .returns(ClassName.get(data.getEditorType())) + .addAnnotation(Override.class) + .addStatement("return editor") + .build()); + delegateTypeBuilder.addMethod( + MethodSpec.methodBuilder("setEditor") + .addModifiers(Modifier.PROTECTED) + .returns(void.class) + .addAnnotation(Override.class) + .addParameter(ClassName.get(data.getEditorType()), "editor") + .addStatement("this.editor = editor") + .build()); + } else { + delegateTypeBuilder.addMethod( + MethodSpec.methodBuilder("getEditor") + .addModifiers(Modifier.PROTECTED) + .returns(rawEditorType) + .addAnnotation(Override.class) + .addStatement("return editor") + .build()); + delegateTypeBuilder.addMethod( + MethodSpec.methodBuilder("setEditor") + .addModifiers(Modifier.PROTECTED) + .returns(void.class) + .addAnnotation(Override.class) + .addParameter(Editor.class, "editor") + .addStatement("this.editor = editor") + .build()); + } delegateTypeBuilder.addMethod( MethodSpec.methodBuilder("getObject") @@ -327,14 +390,25 @@ protected ClassName getEditorDelegate(EditorModel editorModel, EditorProperty da .addStatement("return object") .build()); - delegateTypeBuilder.addMethod( - MethodSpec.methodBuilder("setObject") - .addModifiers(Modifier.PROTECTED) - .returns(void.class) - .addAnnotation(Override.class) - .addParameter(ClassName.get(Object.class), "object") - .addStatement("this.object = ($T) object", ClassName.get(data.getEditedType())) - .build()); + if (data.getEditedType() != null) { + delegateTypeBuilder.addMethod( + MethodSpec.methodBuilder("setObject") + .addModifiers(Modifier.PROTECTED) + .returns(void.class) + .addAnnotation(Override.class) + .addParameter(ClassName.get(data.getEditedType()), "object") + .addStatement("this.object = object") + .build()); + } else { + delegateTypeBuilder.addMethod( + MethodSpec.methodBuilder("setObject") + .addModifiers(Modifier.PROTECTED) + .returns(void.class) + .addAnnotation(Override.class) + .addParameter(ClassName.get(Object.class), "object") + .addStatement("this.object = ($T) object", ClassName.get(data.getEditedType())) + .build()); + } MethodSpec.Builder initializeSubDelegatesBuilder = MethodSpec.methodBuilder("initializeSubDelegates") @@ -520,18 +594,49 @@ private ClassName getEditorContext(EditorProperty parent, EditorProperty data) { MethodSpec.methodBuilder("checkAssignment") .addModifiers(Modifier.PUBLIC) .addAnnotation(Override.class) + .addAnnotation( + AnnotationSpec.builder(SuppressWarnings.class) + .addMember("value", "$S", "unchecked") + .build()) .returns(ClassName.get(data.getEditedType())) .addParameter(Object.class, "value") .addStatement("return ($T) value", ClassName.get(data.getEditedType())) .build()); - contextTypeBuilder.addMethod( - MethodSpec.methodBuilder("getEditedType") - .addModifiers(Modifier.PUBLIC) - .addAnnotation(Override.class) - .returns(Class.class) - .addStatement("return $L.class", MoreTypes.asElement(data.getEditedType())) - .build()); + if (MoreTypes.asDeclared(data.getEditorType()).getTypeArguments().size() > 1) { + contextTypeBuilder.addMethod( + MethodSpec.methodBuilder("getEditedType") + .addModifiers(Modifier.PUBLIC) + .addAnnotation(Override.class) + .addAnnotation( + AnnotationSpec.builder(SuppressWarnings.class) + .addMember("value", "$S", "unchecked") + .build()) + .returns( + ParameterizedTypeName.get( + ClassName.get(Class.class), ClassName.get(data.getEditedType()))) + .addStatement( + "return ($T<$T>) ($T) $L.class", + ClassName.get(Class.class), + ClassName.get(data.getEditedType()), + ClassName.get(Class.class), + MoreTypes.asElement(data.getEditedType())) + .build()); + } else { + contextTypeBuilder.addMethod( + MethodSpec.methodBuilder("getEditedType") + .addModifiers(Modifier.PUBLIC) + .addAnnotation(Override.class) + .addAnnotation( + AnnotationSpec.builder(SuppressWarnings.class) + .addMember("value", "$S", "unchecked") + .build()) + .returns( + ParameterizedTypeName.get( + ClassName.get(Class.class), ClassName.get(data.getEditedType()))) + .addStatement("return $L.class", MoreTypes.asElement(data.getEditedType())) + .build()); + } contextTypeBuilder.addMethod( MethodSpec.methodBuilder("getFromModel") diff --git a/gwt-editor-processor/src/test/java/org/gwtproject/editor/client/SimpleBeanEditorTest.java b/gwt-editor-processor/src/test/java/org/gwtproject/editor/client/SimpleBeanEditorTest.java index 351220f..693bcd2 100644 --- a/gwt-editor-processor/src/test/java/org/gwtproject/editor/client/SimpleBeanEditorTest.java +++ b/gwt-editor-processor/src/test/java/org/gwtproject/editor/client/SimpleBeanEditorTest.java @@ -28,8 +28,9 @@ * AbstractEditorDriverGenerator. */ public class SimpleBeanEditorTest extends TestCase { - class AddressCoEditorView extends LeafAddressEditor implements IsEditor { - private LeafAddressEditor addressEditor = new LeafAddressEditor(); + static class AddressCoEditorView extends LeafAddressEditor + implements IsEditor { + private final LeafAddressEditor addressEditor = new LeafAddressEditor(); @Override public LeafAddressEditor asEditor() { @@ -131,7 +132,7 @@ public static class PersonEditorWithAddressEditorView implements Editor interface PersonEditorWithAddressEditorViewDriver extends SimpleBeanEditorDriver {} - class SampleView implements Editor { + static class SampleView implements Editor { SimpleEditor id = SimpleEditor.of(0); } @@ -151,7 +152,7 @@ public static class PersonEditorWithAliasedSubEditors implements Editor interface PersonEditorWithAliasedSubEditorsDriver extends SimpleBeanEditorDriver {} - class PersonEditorWithCoAddressEditorView implements Editor { + static class PersonEditorWithCoAddressEditorView implements Editor { AddressCoEditorView addressEditor = new AddressCoEditorView(); SimpleEditor name = SimpleEditor.of(UNINITIALIZED); } @@ -221,7 +222,7 @@ public PersonEditorWithOptionalAddressEditor(AddressEditor delegate) { } } - class PersonEditorWithValueAwareAddressEditor implements Editor { + static class PersonEditorWithValueAwareAddressEditor implements Editor { ValueAwareAddressEditor addressEditor = new ValueAwareAddressEditor(); SimpleEditor name = SimpleEditor.of(UNINITIALIZED); @@ -233,7 +234,7 @@ class PersonEditorWithValueAwareAddressEditor implements Editor { interface PersonEditorWithValueAwareAddressEditorDriver extends SimpleBeanEditorDriver {} - class PersonEditorWithValueAwareLeafAddressEditor implements Editor { + static class PersonEditorWithValueAwareLeafAddressEditor implements Editor { ValueAwareLeafAddressEditor addressEditor = new ValueAwareLeafAddressEditor(); SimpleEditor name = SimpleEditor.of(UNINITIALIZED); @@ -249,7 +250,7 @@ static class PersonGenericEditor implements Editor { SimpleEditor name = SimpleEditor.of(UNINITIALIZED); } - class PersonWithList { + static class PersonWithList { String name = "PersonWithList"; List
addresses = new ArrayList
(); @@ -262,7 +263,7 @@ public String getName() { } } - class PersonWithListEditor implements Editor { + static class PersonWithListEditor implements Editor { SimpleEditor nameEditor = SimpleEditor.of(UNINITIALIZED); ListEditor addressesEditor = ListEditor.of( @@ -320,7 +321,8 @@ public void setValue(Address value) { } /** All the mix-ins. Not that this seems like a good idea... */ - class ValueAwareLeafAddressEditor extends LeafAddressEditor implements ValueAwareEditor
{ + static class ValueAwareLeafAddressEditor extends LeafAddressEditor + implements ValueAwareEditor
{ int flushCalled; int setDelegateCalled; @@ -338,7 +340,7 @@ public void setDelegate(EditorDelegate
delegate) { } } - class TaggedItemAddressEditor implements Editor> { + static class TaggedItemAddressEditor implements Editor> { @Path("item.city") SimpleEditor itemCityEditor = SimpleEditor.of(UNINITIALIZED); @@ -575,8 +577,9 @@ public void testLifecycle() { public void testListEditor() { final SortedMap> positionMap = new TreeMap>(); - @SuppressWarnings("unchecked") - final SimpleEditor[] disposed = new SimpleEditor[1]; + // final SimpleEditor[] disposed = new SimpleEditor[1]; + final List> disposed = new ArrayList<>(); + disposed.add(null); class StringSource extends EditorSource> { @Override public SimpleEditor create(int index) { @@ -587,7 +590,7 @@ public SimpleEditor create(int index) { @Override public void dispose(SimpleEditor editor) { - disposed[0] = editor; + disposed.set(0, editor); positionMap.values().remove(editor); } @@ -636,7 +639,7 @@ public void setIndex(SimpleEditor editor, int index) { // Delete an element SimpleEditor expectedDisposed = editors.get(0); mutableList.remove(0); - assertSame(expectedDisposed, disposed[0]); + assertSame(expectedDisposed, disposed.get(0)); assertEquals(3, editors.size()); assertEquals("quux", editors.get(2).getValue()); assertEquals(editors, new ArrayList<>(positionMap.values())); @@ -654,9 +657,8 @@ public void setIndex(SimpleEditor editor, int index) { assertEquals(editors, new ArrayList<>(positionMap.values())); // Edit again: should reuse sub-editors and dispose unneeded ones - disposed[0] = null; + disposed.set(0, null); expectedDisposed = editors.get(2); - @SuppressWarnings("unchecked") List> expectedEditors = Arrays.asList(editors.get(0), editors.get(1)); driver.edit(rawData); assertEquals(expectedEditors, editors); @@ -665,7 +667,7 @@ public void setIndex(SimpleEditor editor, int index) { assertEquals(rawData.size(), editors.size()); assertEquals(rawData, Arrays.asList(editors.get(0).getValue(), editors.get(1).getValue())); assertEquals(editors, new ArrayList>(positionMap.values())); - assertEquals(expectedDisposed, disposed[0]); + assertEquals(expectedDisposed, disposed.get(0)); } /** Ensure that a ListEditor deeper in the chain is properly flushed. */ diff --git a/gwt-editor-processor/src/test/java/org/gwtproject/editor/processor/model/EditorModelTest.java b/gwt-editor-processor/src/test/java/org/gwtproject/editor/processor/model/EditorModelTest.java index 713748b..68bcdbf 100644 --- a/gwt-editor-processor/src/test/java/org/gwtproject/editor/processor/model/EditorModelTest.java +++ b/gwt-editor-processor/src/test/java/org/gwtproject/editor/processor/model/EditorModelTest.java @@ -23,7 +23,6 @@ import com.google.web.bindery.requestfactory.shared.RequestFactory; import java.util.Arrays; import java.util.List; -import javax.lang.model.element.Element; import javax.lang.model.type.TypeMirror; import javax.lang.model.util.Elements; import javax.lang.model.util.Types; @@ -360,10 +359,10 @@ public void testMethodEditors() { checkPersonReadonly(fields.get(1)); } - /** - * Tests the case where an Editor wants to editor a property that is not provided by its - * associated Proxy type. - */ + // /** + // * Tests the case where an Editor wants to editor a property that is not provided by its + // * associated Proxy type. + // */ // public void testMissingGetter() { // UnitTestTreeLogger.Builder builder = new UnitTestTreeLogger.Builder(); // builder.setLowestLogLevel(TreeLogger.ERROR); @@ -384,7 +383,7 @@ public void testMethodEditors() { // testLogger.assertCorrectLogEntries(); // } - /** Tests the sanity-check error messages emitted by the constructor. */ + // /** Tests the sanity-check error messages emitted by the constructor. */ // public void testSanityErrorMessages() { // UnitTestTreeLogger.Builder builder = new UnitTestTreeLogger.Builder(); // builder.setLowestLogLevel(TreeLogger.ERROR); @@ -498,7 +497,7 @@ private void checkPersonName(EditorProperty editorField) { Assert.assertEquals("setName", editorField.getSetterName()); } - /** @param editorField */ + /** @param editorField editor property */ private void checkPersonReadonly(EditorProperty editorField) { assertNotNull(editorField); assertEquals(typeMirrorFor(SimpleEditor.class), raw(editorField.getEditorType())); @@ -515,9 +514,9 @@ private static void assertEquals(TypeMirror expected, TypeMirror actual) { MoreTypes.equivalence().equivalent(expected, actual)); } - private Element typeElementFor(Class clazz) { - return MoreTypes.asElement(raw(elements.getTypeElement(clazz.getCanonicalName()).asType())); - } + // private Element typeElementFor(Class clazz) { + // return MoreTypes.asElement(raw(elements.getTypeElement(clazz.getCanonicalName()).asType())); + // } private TypeMirror typeMirrorFor(Class clazz) { return raw(elements.getTypeElement(clazz.getCanonicalName()).asType()); @@ -683,7 +682,7 @@ static class PersonEditor implements Editor { SimpleEditor lastModified; public SimpleEditor name; SimpleEditor readonly; - public static SimpleEditor ignoredStatic; + public static SimpleEditor ignoredStatic; private SimpleEditor ignoredPrivate; @Editor.Ignore public SimpleEditor ignoredPublic; } @@ -740,7 +739,7 @@ interface UnparameterizedEditorEditorDriver interface AProxy extends EntityProxy {} interface AEditor extends Editor { - SimpleEditor needsParameterization(); + SimpleEditor needsParameterization(); } } diff --git a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test01/result/TestEditor01_Driver_Impl.java b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test01/result/TestEditor01_Driver_Impl.java index d17830a..8085b39 100644 --- a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test01/result/TestEditor01_Driver_Impl.java +++ b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test01/result/TestEditor01_Driver_Impl.java @@ -1,6 +1,7 @@ package org.gwtproject.editor.processor.test01; import java.lang.Override; +import java.lang.SuppressWarnings; import org.gwtproject.editor.client.EditorVisitor; import org.gwtproject.editor.client.impl.AbstractSimpleBeanEditorDriver; import org.gwtproject.editor.client.impl.RootEditorContext; @@ -9,6 +10,7 @@ public class TestEditor01_Driver_Impl extends AbstractSimpleBeanEditorDriver implements TestEditor01.Driver { @Override + @SuppressWarnings("unchecked") public void accept(EditorVisitor visitor) { RootEditorContext ctx = new RootEditorContext(getDelegate(), (Class)(Class)org.gwtproject.editor.processor.common.EditorBean.class, getObject()); ctx.traverse(visitor, getDelegate()); diff --git a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test01/result/TestEditor01_id_Context.java b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test01/result/TestEditor01_id_Context.java index 8a40858..2c95f8a 100644 --- a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test01/result/TestEditor01_id_Context.java +++ b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test01/result/TestEditor01_id_Context.java @@ -1,43 +1,38 @@ package org.gwtproject.editor.processor.test01; - import java.lang.Class; import java.lang.Object; import java.lang.Override; import java.lang.String; +import java.lang.SuppressWarnings; import org.gwtproject.editor.client.Editor; import org.gwtproject.editor.client.impl.AbstractEditorContext; import org.gwtproject.editor.processor.common.EditorBean; - public class TestEditor01_id_Context extends AbstractEditorContext { private final EditorBean parent; - public TestEditor01_id_Context(EditorBean parent, Editor editor, String path) { super(editor, path); this.parent = parent; } - @Override public boolean canSetInModel() { return parent != null && true && true; } - @Override + @SuppressWarnings("unchecked") public String checkAssignment(Object value) { return (String) value; } - @Override - public Class getEditedType() { + @SuppressWarnings("unchecked") + public Class getEditedType() { return java.lang.String.class; } - @Override public String getFromModel() { return (parent != null && true) ? parent.getId() : null; } - @Override public void setInModel(String data) { parent.setId(data); } -} +} \ No newline at end of file diff --git a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test02/result/TestEditor02_Driver_Impl.java b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test02/result/TestEditor02_Driver_Impl.java index 2451300..df2e235 100644 --- a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test02/result/TestEditor02_Driver_Impl.java +++ b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test02/result/TestEditor02_Driver_Impl.java @@ -1,6 +1,7 @@ package org.gwtproject.editor.processor.test02; import java.lang.Override; +import java.lang.SuppressWarnings; import org.gwtproject.editor.client.EditorVisitor; import org.gwtproject.editor.client.impl.AbstractSimpleBeanEditorDriver; import org.gwtproject.editor.client.impl.RootEditorContext; @@ -9,6 +10,7 @@ public class TestEditor02_Driver_Impl extends AbstractSimpleBeanEditorDriver implements TestEditor02.Driver { @Override + @SuppressWarnings("unchecked") public void accept(EditorVisitor visitor) { RootEditorContext ctx = new RootEditorContext(getDelegate(), (Class)(Class)org.gwtproject.editor.processor.common.EditorBeanWithInterface.class, getObject()); ctx.traverse(visitor, getDelegate()); diff --git a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test02/result/TestEditor02_id_Context.java b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test02/result/TestEditor02_id_Context.java index 1d44887..ea7bf86 100644 --- a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test02/result/TestEditor02_id_Context.java +++ b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test02/result/TestEditor02_id_Context.java @@ -1,44 +1,39 @@ package org.gwtproject.editor.processor.test02; - import java.lang.Class; import java.lang.Object; import java.lang.Override; import java.lang.String; +import java.lang.SuppressWarnings; import org.gwtproject.editor.client.Editor; import org.gwtproject.editor.client.impl.AbstractEditorContext; import org.gwtproject.editor.processor.common.EditorBeanWithInterface; - public class TestEditor02_id_Context extends AbstractEditorContext { private final EditorBeanWithInterface parent; - public TestEditor02_id_Context(EditorBeanWithInterface parent, Editor editor, String path) { super(editor, path); this.parent = parent; } - @Override public boolean canSetInModel() { return parent != null && true && true; } - @Override + @SuppressWarnings("unchecked") public String checkAssignment(Object value) { return (String) value; } - @Override - public Class getEditedType() { + @SuppressWarnings("unchecked") + public Class getEditedType() { return java.lang.String.class; } - @Override public String getFromModel() { return (parent != null && true) ? parent.getId() : null; } - @Override public void setInModel(String data) { parent.setId(data); } -} +} \ No newline at end of file diff --git a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test03/result/TestEditor03_Driver_Impl.java b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test03/result/TestEditor03_Driver_Impl.java index 2f931fc..1277187 100644 --- a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test03/result/TestEditor03_Driver_Impl.java +++ b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test03/result/TestEditor03_Driver_Impl.java @@ -1,6 +1,7 @@ package org.gwtproject.editor.processor.test03; import java.lang.Override; +import java.lang.SuppressWarnings; import org.gwtproject.editor.client.EditorVisitor; import org.gwtproject.editor.client.impl.AbstractSimpleBeanEditorDriver; import org.gwtproject.editor.client.impl.RootEditorContext; @@ -9,6 +10,7 @@ public class TestEditor03_Driver_Impl extends AbstractSimpleBeanEditorDriver implements TestEditor03.Driver { @Override + @SuppressWarnings("unchecked") public void accept(EditorVisitor visitor) { RootEditorContext ctx = new RootEditorContext(getDelegate(), (Class)(Class)org.gwtproject.editor.processor.common.EditorBeanWithInterface.class, getObject()); ctx.traverse(visitor, getDelegate()); diff --git a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test03/result/TestEditor03_id_Context.java b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test03/result/TestEditor03_id_Context.java index ecdac13..2a2257c 100644 --- a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test03/result/TestEditor03_id_Context.java +++ b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test03/result/TestEditor03_id_Context.java @@ -1,44 +1,39 @@ package org.gwtproject.editor.processor.test03; - import java.lang.Class; import java.lang.Object; import java.lang.Override; import java.lang.String; +import java.lang.SuppressWarnings; import org.gwtproject.editor.client.Editor; import org.gwtproject.editor.client.impl.AbstractEditorContext; import org.gwtproject.editor.processor.common.EditorBeanWithInterface; - public class TestEditor03_id_Context extends AbstractEditorContext { private final EditorBeanWithInterface parent; - public TestEditor03_id_Context(EditorBeanWithInterface parent, Editor editor, String path) { super(editor, path); this.parent = parent; } - @Override public boolean canSetInModel() { return parent != null && true && true; } - @Override + @SuppressWarnings("unchecked") public String checkAssignment(Object value) { return (String) value; } - @Override - public Class getEditedType() { + @SuppressWarnings("unchecked") + public Class getEditedType() { return java.lang.String.class; } - @Override public String getFromModel() { return (parent != null && true) ? parent.getId() : null; } - @Override public void setInModel(String data) { parent.setId(data); } -} +} \ No newline at end of file diff --git a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test04/result/TestEditor04_Driver_Impl.java b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test04/result/TestEditor04_Driver_Impl.java index 9797051..e2b4ce8 100644 --- a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test04/result/TestEditor04_Driver_Impl.java +++ b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test04/result/TestEditor04_Driver_Impl.java @@ -1,6 +1,7 @@ package org.gwtproject.editor.processor.test04; import java.lang.Override; +import java.lang.SuppressWarnings; import org.gwtproject.editor.client.EditorVisitor; import org.gwtproject.editor.client.impl.AbstractSimpleBeanEditorDriver; import org.gwtproject.editor.client.impl.RootEditorContext; @@ -9,6 +10,7 @@ public class TestEditor04_Driver_Impl extends AbstractSimpleBeanEditorDriver implements TestEditor04.Driver { @Override + @SuppressWarnings("unchecked") public void accept(EditorVisitor visitor) { RootEditorContext ctx = new RootEditorContext(getDelegate(), (Class)(Class)org.gwtproject.editor.processor.common.UserDto.class, getObject()); ctx.traverse(visitor, getDelegate()); diff --git a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test04/result/TestEditor04_active_Context.java b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test04/result/TestEditor04_active_Context.java index ef6d113..f6e0b79 100644 --- a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test04/result/TestEditor04_active_Context.java +++ b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test04/result/TestEditor04_active_Context.java @@ -1,44 +1,39 @@ package org.gwtproject.editor.processor.test04; - import java.lang.Boolean; import java.lang.Class; import java.lang.Object; import java.lang.Override; import java.lang.String; +import java.lang.SuppressWarnings; import org.gwtproject.editor.client.Editor; import org.gwtproject.editor.client.impl.AbstractEditorContext; import org.gwtproject.editor.processor.common.UserDto; - public class TestEditor04_active_Context extends AbstractEditorContext { private final UserDto parent; - public TestEditor04_active_Context(UserDto parent, Editor editor, String path) { super(editor, path); this.parent = parent; } - @Override public boolean canSetInModel() { return parent != null && true && true; } - @Override + @SuppressWarnings("unchecked") public Boolean checkAssignment(Object value) { return (Boolean) value; } - @Override - public Class getEditedType() { + @SuppressWarnings("unchecked") + public Class getEditedType() { return java.lang.Boolean.class; } - @Override public Boolean getFromModel() { return (parent != null && true) ? parent.isActive() : null; } - @Override public void setInModel(Boolean data) { parent.setActive(data); } -} +} \ No newline at end of file diff --git a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test04/result/TestEditor04_age_Context.java b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test04/result/TestEditor04_age_Context.java index 439a54b..39692b1 100644 --- a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test04/result/TestEditor04_age_Context.java +++ b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test04/result/TestEditor04_age_Context.java @@ -1,44 +1,39 @@ package org.gwtproject.editor.processor.test04; - import java.lang.Class; import java.lang.Integer; import java.lang.Object; import java.lang.Override; import java.lang.String; +import java.lang.SuppressWarnings; import org.gwtproject.editor.client.Editor; import org.gwtproject.editor.client.impl.AbstractEditorContext; import org.gwtproject.editor.processor.common.UserDto; - public class TestEditor04_age_Context extends AbstractEditorContext { private final UserDto parent; - public TestEditor04_age_Context(UserDto parent, Editor editor, String path) { super(editor, path); this.parent = parent; } - @Override public boolean canSetInModel() { return parent != null && true && true; } - @Override + @SuppressWarnings("unchecked") public Integer checkAssignment(Object value) { return (Integer) value; } - @Override - public Class getEditedType() { + @SuppressWarnings("unchecked") + public Class getEditedType() { return java.lang.Integer.class; } - @Override public Integer getFromModel() { return (parent != null && true) ? parent.getAge() : null; } - @Override public void setInModel(Integer data) { parent.setAge(data); } -} +} \ No newline at end of file diff --git a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test04/result/TestEditor04_email_Context.java b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test04/result/TestEditor04_email_Context.java index 3d3d4a6..1ce8aaf 100644 --- a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test04/result/TestEditor04_email_Context.java +++ b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test04/result/TestEditor04_email_Context.java @@ -1,41 +1,36 @@ package org.gwtproject.editor.processor.test04; - import java.lang.Class; import java.lang.Object; import java.lang.Override; import java.lang.String; +import java.lang.SuppressWarnings; import org.gwtproject.editor.client.Editor; import org.gwtproject.editor.client.impl.AbstractEditorContext; import org.gwtproject.editor.processor.common.UserDto; - public class TestEditor04_email_Context extends AbstractEditorContext { private final UserDto parent; - public TestEditor04_email_Context(UserDto parent, Editor editor, String path) { super(editor, path); this.parent = parent; } - @Override public boolean canSetInModel() { return parent != null && true && true; } - @Override + @SuppressWarnings("unchecked") public String checkAssignment(Object value) { return (String) value; } - @Override - public Class getEditedType() { + @SuppressWarnings("unchecked") + public Class getEditedType() { return java.lang.String.class; } - @Override public String getFromModel() { return (parent != null && true) ? parent.getEmail() : null; } - @Override public void setInModel(String data) { parent.setEmail(data); diff --git a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test04/result/TestEditor04_firstName_Context.java b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test04/result/TestEditor04_firstName_Context.java index 2ebbf7e..c70c626 100644 --- a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test04/result/TestEditor04_firstName_Context.java +++ b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test04/result/TestEditor04_firstName_Context.java @@ -1,43 +1,38 @@ package org.gwtproject.editor.processor.test04; - import java.lang.Class; import java.lang.Object; import java.lang.Override; import java.lang.String; +import java.lang.SuppressWarnings; import org.gwtproject.editor.client.Editor; import org.gwtproject.editor.client.impl.AbstractEditorContext; import org.gwtproject.editor.processor.common.UserDto; - public class TestEditor04_firstName_Context extends AbstractEditorContext { private final UserDto parent; - public TestEditor04_firstName_Context(UserDto parent, Editor editor, String path) { super(editor, path); this.parent = parent; } - @Override public boolean canSetInModel() { return parent != null && true && true; } - @Override + @SuppressWarnings("unchecked") public String checkAssignment(Object value) { return (String) value; } - @Override - public Class getEditedType() { + @SuppressWarnings("unchecked") + public Class getEditedType() { return java.lang.String.class; } - @Override public String getFromModel() { return (parent != null && true) ? parent.getFirstName() : null; } - @Override public void setInModel(String data) { parent.setFirstName(data); } -} +} \ No newline at end of file diff --git a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test04/result/TestEditor04_id_Context.java b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test04/result/TestEditor04_id_Context.java index cb63914..77e0839 100644 --- a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test04/result/TestEditor04_id_Context.java +++ b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test04/result/TestEditor04_id_Context.java @@ -1,44 +1,39 @@ package org.gwtproject.editor.processor.test04; - import java.lang.Class; import java.lang.Long; import java.lang.Object; import java.lang.Override; import java.lang.String; +import java.lang.SuppressWarnings; import org.gwtproject.editor.client.Editor; import org.gwtproject.editor.client.impl.AbstractEditorContext; import org.gwtproject.editor.processor.common.UserDto; - public class TestEditor04_id_Context extends AbstractEditorContext { private final UserDto parent; - public TestEditor04_id_Context(UserDto parent, Editor editor, String path) { super(editor, path); this.parent = parent; } - @Override public boolean canSetInModel() { return parent != null && true && true; } - @Override + @SuppressWarnings("unchecked") public Long checkAssignment(Object value) { return (Long) value; } - @Override - public Class getEditedType() { + @SuppressWarnings("unchecked") + public Class getEditedType() { return java.lang.Long.class; } - @Override public Long getFromModel() { return (parent != null && true) ? parent.getId() : null; } - @Override public void setInModel(Long data) { parent.setId(data); } -} +} \ No newline at end of file diff --git a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test04/result/TestEditor04_lastName_Context.java b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test04/result/TestEditor04_lastName_Context.java index 63c28b6..3ef8d34 100644 --- a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test04/result/TestEditor04_lastName_Context.java +++ b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test04/result/TestEditor04_lastName_Context.java @@ -1,43 +1,38 @@ package org.gwtproject.editor.processor.test04; - import java.lang.Class; import java.lang.Object; import java.lang.Override; import java.lang.String; +import java.lang.SuppressWarnings; import org.gwtproject.editor.client.Editor; import org.gwtproject.editor.client.impl.AbstractEditorContext; import org.gwtproject.editor.processor.common.UserDto; - public class TestEditor04_lastName_Context extends AbstractEditorContext { private final UserDto parent; - public TestEditor04_lastName_Context(UserDto parent, Editor editor, String path) { super(editor, path); this.parent = parent; } - @Override public boolean canSetInModel() { return parent != null && true && true; } - @Override + @SuppressWarnings("unchecked") public String checkAssignment(Object value) { return (String) value; } - @Override - public Class getEditedType() { + @SuppressWarnings("unchecked") + public Class getEditedType() { return java.lang.String.class; } - @Override public String getFromModel() { return (parent != null && true) ? parent.getLastName() : null; } - @Override public void setInModel(String data) { parent.setLastName(data); } -} +} \ No newline at end of file diff --git a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test04/result/TestEditor04_phone_Context.java b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test04/result/TestEditor04_phone_Context.java index 3222740..e7be4ef 100644 --- a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test04/result/TestEditor04_phone_Context.java +++ b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test04/result/TestEditor04_phone_Context.java @@ -1,43 +1,38 @@ package org.gwtproject.editor.processor.test04; - import java.lang.Class; import java.lang.Object; import java.lang.Override; import java.lang.String; +import java.lang.SuppressWarnings; import org.gwtproject.editor.client.Editor; import org.gwtproject.editor.client.impl.AbstractEditorContext; import org.gwtproject.editor.processor.common.UserDto; - public class TestEditor04_phone_Context extends AbstractEditorContext { private final UserDto parent; - public TestEditor04_phone_Context(UserDto parent, Editor editor, String path) { super(editor, path); this.parent = parent; } - @Override public boolean canSetInModel() { return parent != null && true && true; } - @Override + @SuppressWarnings("unchecked") public String checkAssignment(Object value) { return (String) value; } - @Override - public Class getEditedType() { + @SuppressWarnings("unchecked") + public Class getEditedType() { return java.lang.String.class; } - @Override public String getFromModel() { return (parent != null && true) ? parent.getPhone() : null; } - @Override public void setInModel(String data) { parent.setPhone(data); } -} +} \ No newline at end of file diff --git a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test05/result/TestEditor05_Driver_Impl.java b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test05/result/TestEditor05_Driver_Impl.java index 9846a2a..95a30b5 100644 --- a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test05/result/TestEditor05_Driver_Impl.java +++ b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test05/result/TestEditor05_Driver_Impl.java @@ -1,6 +1,7 @@ package org.gwtproject.editor.processor.test05; import java.lang.Override; +import java.lang.SuppressWarnings; import org.gwtproject.editor.client.EditorVisitor; import org.gwtproject.editor.client.impl.AbstractSimpleBeanEditorDriver; import org.gwtproject.editor.client.impl.RootEditorContext; @@ -9,6 +10,7 @@ public class TestEditor05_Driver_Impl extends AbstractSimpleBeanEditorDriver implements TestEditor05.Driver { @Override + @SuppressWarnings("unchecked") public void accept(EditorVisitor visitor) { RootEditorContext ctx = new RootEditorContext(getDelegate(), (Class)(Class)org.gwtproject.editor.processor.common.Model01Dto.class, getObject()); ctx.traverse(visitor, getDelegate()); diff --git a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test05/result/TestEditor05_email_Context.java b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test05/result/TestEditor05_email_Context.java index 3c702dc..953a3fc 100644 --- a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test05/result/TestEditor05_email_Context.java +++ b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test05/result/TestEditor05_email_Context.java @@ -1,43 +1,38 @@ package org.gwtproject.editor.processor.test05; - import java.lang.Class; import java.lang.Object; import java.lang.Override; import java.lang.String; +import java.lang.SuppressWarnings; import org.gwtproject.editor.client.Editor; import org.gwtproject.editor.client.impl.AbstractEditorContext; import org.gwtproject.editor.processor.common.Model01Dto; - public class TestEditor05_email_Context extends AbstractEditorContext { private final Model01Dto parent; - public TestEditor05_email_Context(Model01Dto parent, Editor editor, String path) { super(editor, path); this.parent = parent; } - @Override public boolean canSetInModel() { return parent != null && true && true; } - @Override + @SuppressWarnings("unchecked") public String checkAssignment(Object value) { return (String) value; } - @Override - public Class getEditedType() { + @SuppressWarnings("unchecked") + public Class getEditedType() { return java.lang.String.class; } - @Override public String getFromModel() { return (parent != null && true) ? parent.getEmail() : null; } - @Override public void setInModel(String data) { parent.setEmail(data); } -} +} \ No newline at end of file diff --git a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test05/result/TestEditor05_id_Context.java b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test05/result/TestEditor05_id_Context.java index 70784b6..771690b 100644 --- a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test05/result/TestEditor05_id_Context.java +++ b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test05/result/TestEditor05_id_Context.java @@ -5,6 +5,7 @@ import java.lang.Object; import java.lang.Override; import java.lang.String; +import java.lang.SuppressWarnings; import org.gwtproject.editor.client.Editor; import org.gwtproject.editor.client.impl.AbstractEditorContext; import org.gwtproject.editor.processor.common.Model01Dto; @@ -23,12 +24,14 @@ public boolean canSetInModel() { } @Override + @SuppressWarnings("unchecked") public Long checkAssignment(Object value) { return (Long) value; } @Override - public Class getEditedType() { + @SuppressWarnings("unchecked") + public Class getEditedType() { return java.lang.Long.class; } diff --git a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test05/result/TestEditor05_name_Context.java b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test05/result/TestEditor05_name_Context.java index 29f9568..ee74c91 100644 --- a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test05/result/TestEditor05_name_Context.java +++ b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test05/result/TestEditor05_name_Context.java @@ -4,6 +4,7 @@ import java.lang.Object; import java.lang.Override; import java.lang.String; +import java.lang.SuppressWarnings; import org.gwtproject.editor.client.Editor; import org.gwtproject.editor.client.impl.AbstractEditorContext; import org.gwtproject.editor.processor.common.Model01Dto; @@ -22,12 +23,14 @@ public boolean canSetInModel() { } @Override + @SuppressWarnings("unchecked") public String checkAssignment(Object value) { return (String) value; } @Override - public Class getEditedType() { + @SuppressWarnings("unchecked") + public Class getEditedType() { return java.lang.String.class; } diff --git a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test05/result/TestEditor05_phone_Context.java b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test05/result/TestEditor05_phone_Context.java index 9882284..6896361 100644 --- a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test05/result/TestEditor05_phone_Context.java +++ b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test05/result/TestEditor05_phone_Context.java @@ -4,6 +4,7 @@ import java.lang.Object; import java.lang.Override; import java.lang.String; +import java.lang.SuppressWarnings; import org.gwtproject.editor.client.Editor; import org.gwtproject.editor.client.impl.AbstractEditorContext; import org.gwtproject.editor.processor.common.Model01Dto; @@ -22,12 +23,14 @@ public boolean canSetInModel() { } @Override + @SuppressWarnings("unchecked") public String checkAssignment(Object value) { return (String) value; } @Override - public Class getEditedType() { + @SuppressWarnings("unchecked") + public Class getEditedType() { return java.lang.String.class; } diff --git a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test06/result/TestEditor06_email_Context.java b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test06/result/TestEditor06_email_Context.java index afc448e..c1d14c3 100644 --- a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test06/result/TestEditor06_email_Context.java +++ b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test06/result/TestEditor06_email_Context.java @@ -1,43 +1,38 @@ package org.gwtproject.editor.processor.test06; - import java.lang.Class; import java.lang.Object; import java.lang.Override; import java.lang.String; +import java.lang.SuppressWarnings; import org.gwtproject.editor.client.Editor; import org.gwtproject.editor.client.impl.AbstractEditorContext; import org.gwtproject.editor.processor.common.BadModel01Dto; - public class TestEditor06_email_Context extends AbstractEditorContext { private final BadModel01Dto parent; - public TestEditor06_email_Context(BadModel01Dto parent, Editor editor, String path) { super(editor, path); this.parent = parent; } - @Override public boolean canSetInModel() { return parent != null && false && true; } - @Override + @SuppressWarnings("unchecked") public String checkAssignment(Object value) { return (String) value; } - @Override - public Class getEditedType() { + @SuppressWarnings("unchecked") + public Class getEditedType() { return java.lang.String.class; } - @Override public String getFromModel() { return (parent != null && true) ? parent.getEmail() : null; } - @Override public void setInModel(String data) { throw new UnsupportedOperationException(); } -} +} \ No newline at end of file diff --git a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test07/result/TestEditor07_Driver_Impl.java b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test07/result/TestEditor07_Driver_Impl.java index 30eecd6..dc76216 100644 --- a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test07/result/TestEditor07_Driver_Impl.java +++ b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test07/result/TestEditor07_Driver_Impl.java @@ -1,22 +1,21 @@ package org.gwtproject.editor.processor.test07; - import java.lang.Override; import java.lang.String; +import java.lang.SuppressWarnings; import org.gwtproject.editor.client.EditorVisitor; import org.gwtproject.editor.client.impl.AbstractSimpleBeanEditorDriver; import org.gwtproject.editor.client.impl.RootEditorContext; import org.gwtproject.editor.client.impl.SimpleBeanEditorDelegate; import org.gwtproject.editor.processor.common.Model01Generic02Dto; - public class TestEditor07_Driver_Impl extends AbstractSimpleBeanEditorDriver, TestEditor07> implements TestEditor07.Driver { @Override + @SuppressWarnings("unchecked") public void accept(EditorVisitor visitor) { RootEditorContext> ctx = new RootEditorContext>(getDelegate(), (Class>)(Class)org.gwtproject.editor.processor.common.Model01Generic02Dto.class, getObject()); ctx.traverse(visitor, getDelegate()); } - @Override protected SimpleBeanEditorDelegate, TestEditor07> createDelegate() { return new TestEditor07_SimpleBeanEditorDelegate(); } -} +} \ No newline at end of file diff --git a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test07/result/TestEditor07_SimpleBeanEditorDelegate.java b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test07/result/TestEditor07_SimpleBeanEditorDelegate.java index 12de8f6..7fecde3 100644 --- a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test07/result/TestEditor07_SimpleBeanEditorDelegate.java +++ b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test07/result/TestEditor07_SimpleBeanEditorDelegate.java @@ -1,41 +1,31 @@ package org.gwtproject.editor.processor.test07; -import java.lang.Object; import java.lang.Override; import java.lang.String; -import org.gwtproject.editor.client.Editor; import org.gwtproject.editor.client.EditorVisitor; import org.gwtproject.editor.client.impl.SimpleBeanEditorDelegate; import org.gwtproject.editor.processor.common.Model01Generic02Dto; - -public class TestEditor07_SimpleBeanEditorDelegate extends SimpleBeanEditorDelegate { - +public class TestEditor07_SimpleBeanEditorDelegate extends SimpleBeanEditorDelegate, TestEditor07> { private TestEditor07 editor; private Model01Generic02Dto object; - @Override protected TestEditor07 getEditor() { return editor; } - @Override - protected void setEditor(Editor editor) { - this.editor = (TestEditor07) editor; + protected void setEditor(TestEditor07 editor) { + this.editor = editor; } - @Override public Model01Generic02Dto getObject() { return object; } - @Override - protected void setObject(Object object) { - this.object = (Model01Generic02Dto) object; + protected void setObject(Model01Generic02Dto object) { + this.object = object; } - @Override protected void initializeSubDelegates() { } - @Override public void accept(EditorVisitor visitor) { { @@ -55,4 +45,4 @@ public void accept(EditorVisitor visitor) { ctx.traverse(visitor, null); } } -} +} \ No newline at end of file diff --git a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test07/result/TestEditor07_email_Context.java b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test07/result/TestEditor07_email_Context.java index 0550534..17c4b77 100644 --- a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test07/result/TestEditor07_email_Context.java +++ b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test07/result/TestEditor07_email_Context.java @@ -1,44 +1,39 @@ package org.gwtproject.editor.processor.test07; - import java.lang.Class; import java.lang.Object; import java.lang.Override; import java.lang.String; +import java.lang.SuppressWarnings; import org.gwtproject.editor.client.Editor; import org.gwtproject.editor.client.impl.AbstractEditorContext; import org.gwtproject.editor.processor.common.Model01Generic02Dto; - public class TestEditor07_email_Context extends AbstractEditorContext { private final Model01Generic02Dto parent; - public TestEditor07_email_Context(Model01Generic02Dto parent, Editor editor, String path) { super(editor, path); this.parent = parent; } - @Override public boolean canSetInModel() { return parent != null && true && true; } - @Override + @SuppressWarnings("unchecked") public String checkAssignment(Object value) { return (String) value; } - @Override - public Class getEditedType() { + @SuppressWarnings("unchecked") + public Class getEditedType() { return java.lang.String.class; } - @Override public String getFromModel() { return (parent != null && true) ? parent.getEmail() : null; } - @Override public void setInModel(String data) { parent.setEmail(data); } -} +} \ No newline at end of file diff --git a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test07/result/TestEditor07_id_Context.java b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test07/result/TestEditor07_id_Context.java index 3690a04..8ec25ee 100644 --- a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test07/result/TestEditor07_id_Context.java +++ b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test07/result/TestEditor07_id_Context.java @@ -5,6 +5,7 @@ import java.lang.Object; import java.lang.Override; import java.lang.String; +import java.lang.SuppressWarnings; import org.gwtproject.editor.client.Editor; import org.gwtproject.editor.client.impl.AbstractEditorContext; import org.gwtproject.editor.processor.common.Model01Generic02Dto; @@ -23,12 +24,14 @@ public boolean canSetInModel() { } @Override() + @SuppressWarnings("unchecked") public Long checkAssignment(Object value) { return (Long)value; } @Override() - public Class getEditedType() { + @SuppressWarnings("unchecked") + public Class getEditedType() { return java.lang.Long.class; } diff --git a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test07/result/TestEditor07_name_Context.java b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test07/result/TestEditor07_name_Context.java index a541a25..40a0da4 100644 --- a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test07/result/TestEditor07_name_Context.java +++ b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test07/result/TestEditor07_name_Context.java @@ -1,44 +1,39 @@ package org.gwtproject.editor.processor.test07; - import java.lang.Class; import java.lang.Object; import java.lang.Override; import java.lang.String; +import java.lang.SuppressWarnings; import org.gwtproject.editor.client.Editor; import org.gwtproject.editor.client.impl.AbstractEditorContext; import org.gwtproject.editor.processor.common.Model01Generic02Dto; - public class TestEditor07_name_Context extends AbstractEditorContext { private final Model01Generic02Dto parent; - public TestEditor07_name_Context(Model01Generic02Dto parent, Editor editor, - String path) { + String path) { super(editor, path); this.parent = parent; } - @Override public boolean canSetInModel() { return parent != null && true && true; } - @Override + @SuppressWarnings("unchecked") public String checkAssignment(Object value) { return (String) value; } - @Override - public Class getEditedType() { + @SuppressWarnings("unchecked") + public Class getEditedType() { return java.lang.String.class; } - @Override public String getFromModel() { return (parent != null && true) ? parent.getName() : null; } - @Override public void setInModel(String data) { parent.setName(data); } -} +} \ No newline at end of file diff --git a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test07/result/TestEditor07_phone_Context.java b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test07/result/TestEditor07_phone_Context.java index 2249300..e367fba 100644 --- a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test07/result/TestEditor07_phone_Context.java +++ b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test07/result/TestEditor07_phone_Context.java @@ -4,6 +4,7 @@ import java.lang.Object; import java.lang.Override; import java.lang.String; +import java.lang.SuppressWarnings; import org.gwtproject.editor.client.Editor; import org.gwtproject.editor.client.impl.AbstractEditorContext; import org.gwtproject.editor.processor.common.Model01Generic02Dto; @@ -23,12 +24,14 @@ public boolean canSetInModel() { } @Override + @SuppressWarnings("unchecked") public String checkAssignment(Object value) { return (String) value; } @Override - public Class getEditedType() { + @SuppressWarnings("unchecked") + public Class getEditedType() { return java.lang.String.class; } diff --git a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test08/result/TestEditor08_Driver_Impl.java b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test08/result/TestEditor08_Driver_Impl.java index 30726c1..5311682 100644 --- a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test08/result/TestEditor08_Driver_Impl.java +++ b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test08/result/TestEditor08_Driver_Impl.java @@ -1,6 +1,7 @@ package org.gwtproject.editor.processor.test08; import java.lang.Override; +import java.lang.SuppressWarnings; import org.gwtproject.editor.client.EditorVisitor; import org.gwtproject.editor.client.impl.AbstractSimpleBeanEditorDriver; import org.gwtproject.editor.client.impl.RootEditorContext; @@ -9,6 +10,7 @@ public class TestEditor08_Driver_Impl extends AbstractSimpleBeanEditorDriver implements TestEditor08.Driver { @Override + @SuppressWarnings("unchecked") public void accept(EditorVisitor visitor) { RootEditorContext ctx = new RootEditorContext(getDelegate(), (Class)(Class)org.gwtproject.editor.processor.common.Model01Dto.class, getObject()); ctx.traverse(visitor, getDelegate()); diff --git a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test08/result/TestEditor08_SimpleBeanEditorDelegate.java b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test08/result/TestEditor08_SimpleBeanEditorDelegate.java index bec3258..dbe9387 100644 --- a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test08/result/TestEditor08_SimpleBeanEditorDelegate.java +++ b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test08/result/TestEditor08_SimpleBeanEditorDelegate.java @@ -1,34 +1,35 @@ package org.gwtproject.editor.processor.test08; -import java.lang.Object; +import java.lang.Long; import java.lang.Override; -import org.gwtproject.editor.client.Editor; +import java.lang.String; import org.gwtproject.editor.client.EditorVisitor; import org.gwtproject.editor.client.impl.SimpleBeanEditorDelegate; +import org.gwtproject.editor.client.testing.FakeLeafValueEditorWithHasEditorDelegate; import org.gwtproject.editor.client.testing.FakeLeafValueEditorWithHasEditorDelegate_Long_SimpleBeanEditorDelegate; import org.gwtproject.editor.client.testing.FakeLeafValueEditorWithHasEditorDelegate_String_SimpleBeanEditorDelegate; import org.gwtproject.editor.processor.common.Model01Dto; -public class TestEditor08_SimpleBeanEditorDelegate extends SimpleBeanEditorDelegate { +public class TestEditor08_SimpleBeanEditorDelegate extends SimpleBeanEditorDelegate { private TestEditor08 editor; private Model01Dto object; - private SimpleBeanEditorDelegate idDelegate; - private SimpleBeanEditorDelegate nameDelegate; - private SimpleBeanEditorDelegate phoneDelegate; - private SimpleBeanEditorDelegate emailDelegate; + private SimpleBeanEditorDelegate> idDelegate; + private SimpleBeanEditorDelegate> nameDelegate; + private SimpleBeanEditorDelegate> phoneDelegate; + private SimpleBeanEditorDelegate> emailDelegate; @Override protected TestEditor08 getEditor() { return editor; } @Override - protected void setEditor(Editor editor) { - this.editor = (TestEditor08) editor; + protected void setEditor(TestEditor08 editor) { + this.editor = editor; } @Override public Model01Dto getObject() { return object; } @Override - protected void setObject(Object object) { - this.object = (Model01Dto) object; + protected void setObject(Model01Dto object) { + this.object = object; } @Override protected void initializeSubDelegates() { @@ -71,5 +72,4 @@ public void accept(EditorVisitor visitor) { ctx.setEditorDelegate(emailDelegate); ctx.traverse(visitor, emailDelegate); } - } -} + } \ No newline at end of file diff --git a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test08/result/TestEditor08_email_Context.java b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test08/result/TestEditor08_email_Context.java index fb2f570..702a263 100644 --- a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test08/result/TestEditor08_email_Context.java +++ b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test08/result/TestEditor08_email_Context.java @@ -1,43 +1,38 @@ package org.gwtproject.editor.processor.test08; - import java.lang.Class; import java.lang.Object; import java.lang.Override; import java.lang.String; +import java.lang.SuppressWarnings; import org.gwtproject.editor.client.Editor; import org.gwtproject.editor.client.impl.AbstractEditorContext; import org.gwtproject.editor.processor.common.Model01Dto; - public class TestEditor08_email_Context extends AbstractEditorContext { private final Model01Dto parent; - public TestEditor08_email_Context(Model01Dto parent, Editor editor, String path) { super(editor, path); this.parent = parent; } - @Override public boolean canSetInModel() { return parent != null && true && true; } - @Override + @SuppressWarnings("unchecked") public String checkAssignment(Object value) { return (String) value; } - @Override - public Class getEditedType() { + @SuppressWarnings("unchecked") + public Class getEditedType() { return java.lang.String.class; } - @Override public String getFromModel() { return (parent != null && true) ? parent.getEmail() : null; } - @Override public void setInModel(String data) { parent.setEmail(data); } -} +} \ No newline at end of file diff --git a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test08/result/TestEditor08_id_Context.java b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test08/result/TestEditor08_id_Context.java index 3ff50c5..753f385 100644 --- a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test08/result/TestEditor08_id_Context.java +++ b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test08/result/TestEditor08_id_Context.java @@ -5,6 +5,7 @@ import java.lang.Object; import java.lang.Override; import java.lang.String; +import java.lang.SuppressWarnings; import org.gwtproject.editor.client.Editor; import org.gwtproject.editor.client.impl.AbstractEditorContext; import org.gwtproject.editor.processor.common.Model01Dto; @@ -23,12 +24,14 @@ public boolean canSetInModel() { } @Override + @SuppressWarnings("unchecked") public Long checkAssignment(Object value) { return (Long) value; } @Override - public Class getEditedType() { + @SuppressWarnings("unchecked") + public Class getEditedType() { return java.lang.Long.class; } diff --git a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test08/result/TestEditor08_name_Context.java b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test08/result/TestEditor08_name_Context.java index 43140ab..09222c1 100644 --- a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test08/result/TestEditor08_name_Context.java +++ b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test08/result/TestEditor08_name_Context.java @@ -4,6 +4,7 @@ import java.lang.Object; import java.lang.Override; import java.lang.String; +import java.lang.SuppressWarnings; import org.gwtproject.editor.client.Editor; import org.gwtproject.editor.client.impl.AbstractEditorContext; import org.gwtproject.editor.processor.common.Model01Dto; @@ -22,12 +23,14 @@ public boolean canSetInModel() { } @Override + @SuppressWarnings("unchecked") public String checkAssignment(Object value) { return (String) value; } @Override - public Class getEditedType() { + @SuppressWarnings("unchecked") + public Class getEditedType() { return java.lang.String.class; } diff --git a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test08/result/TestEditor08_phone_Context.java b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test08/result/TestEditor08_phone_Context.java index 9784d83..90c6823 100644 --- a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test08/result/TestEditor08_phone_Context.java +++ b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test08/result/TestEditor08_phone_Context.java @@ -4,6 +4,7 @@ import java.lang.Object; import java.lang.Override; import java.lang.String; +import java.lang.SuppressWarnings; import org.gwtproject.editor.client.Editor; import org.gwtproject.editor.client.impl.AbstractEditorContext; import org.gwtproject.editor.processor.common.Model01Dto; @@ -22,12 +23,14 @@ public boolean canSetInModel() { } @Override + @SuppressWarnings("unchecked") public String checkAssignment(Object value) { return (String) value; } @Override - public Class getEditedType() { + @SuppressWarnings("unchecked") + public Class getEditedType() { return java.lang.String.class; } diff --git a/gwt-editor/src/main/java/org/gwtproject/editor/client/impl/Initializer.java b/gwt-editor/src/main/java/org/gwtproject/editor/client/impl/Initializer.java index 6c65072..af21fcb 100644 --- a/gwt-editor/src/main/java/org/gwtproject/editor/client/impl/Initializer.java +++ b/gwt-editor/src/main/java/org/gwtproject/editor/client/impl/Initializer.java @@ -24,12 +24,10 @@ * Extends the logic in Refresher to provide the editor instance with references to framework * plumbing fixes. */ -@SuppressWarnings("rawtypes") public class Initializer extends Refresher { @Override public boolean visit(EditorContext ctx) { - @SuppressWarnings("unchecked") AbstractEditorDelegate delegate = (AbstractEditorDelegate) ctx.getEditorDelegate(); // Pass in the EditorDelegate @@ -42,7 +40,6 @@ public boolean visit(EditorContext ctx) { CompositeEditor asComposite = ctx.asCompositeEditor(); if (asComposite != null) { // Various javac generics compilation problems here - @SuppressWarnings("rawtypes") EditorChain chain = delegate.getEditorChain(); asComposite.setEditorChain(chain); } From 883cf960d581531d64868426d455274afb8e51f7 Mon Sep 17 00:00:00 2001 From: Frank Hossfeld Date: Thu, 30 Mar 2023 14:26:34 +0200 Subject: [PATCH 2/5] #11 - [WARNING] /path/to/SomeType.java found raw type: org.gwtproject.editor.client.adapters.SimpleEditor missing type arguments... - done --- gwt-editor-gwt2-tests/pom.xml | 2 +- .../editor/processor/DriverProcessor.java | 199 +++++++++++++----- .../editor/client/SimpleBeanEditorTest.java | 36 ++-- .../processor/model/EditorModelTest.java | 23 +- .../result/TestEditor01_Driver_Impl.java | 2 + .../result/TestEditor01_id_Context.java | 15 +- .../result/TestEditor02_Driver_Impl.java | 2 + .../result/TestEditor02_id_Context.java | 15 +- .../result/TestEditor03_Driver_Impl.java | 2 + .../result/TestEditor03_id_Context.java | 15 +- .../result/TestEditor04_Driver_Impl.java | 2 + .../result/TestEditor04_active_Context.java | 15 +- .../result/TestEditor04_age_Context.java | 15 +- .../result/TestEditor04_email_Context.java | 13 +- .../TestEditor04_firstName_Context.java | 15 +- .../result/TestEditor04_id_Context.java | 15 +- .../result/TestEditor04_lastName_Context.java | 15 +- .../result/TestEditor04_phone_Context.java | 15 +- .../result/TestEditor05_Driver_Impl.java | 2 + .../result/TestEditor05_email_Context.java | 15 +- .../result/TestEditor05_id_Context.java | 5 +- .../result/TestEditor05_name_Context.java | 5 +- .../result/TestEditor05_phone_Context.java | 5 +- .../result/TestEditor06_email_Context.java | 15 +- .../result/TestEditor07_Driver_Impl.java | 7 +- ...TestEditor07_SimpleBeanEditorDelegate.java | 22 +- .../result/TestEditor07_email_Context.java | 15 +- .../result/TestEditor07_id_Context.java | 5 +- .../result/TestEditor07_name_Context.java | 17 +- .../result/TestEditor07_phone_Context.java | 5 +- .../result/TestEditor08_Driver_Impl.java | 2 + ...TestEditor08_SimpleBeanEditorDelegate.java | 26 +-- .../result/TestEditor08_email_Context.java | 15 +- .../result/TestEditor08_id_Context.java | 5 +- .../result/TestEditor08_name_Context.java | 5 +- .../result/TestEditor08_phone_Context.java | 5 +- .../editor/client/impl/Initializer.java | 3 - 37 files changed, 324 insertions(+), 271 deletions(-) diff --git a/gwt-editor-gwt2-tests/pom.xml b/gwt-editor-gwt2-tests/pom.xml index 16049a6..406331e 100644 --- a/gwt-editor-gwt2-tests/pom.xml +++ b/gwt-editor-gwt2-tests/pom.xml @@ -18,7 +18,7 @@ 1.0.0 - 2.9.0 + 2.10.0 4.13.1 diff --git a/gwt-editor-processor/src/main/java/org/gwtproject/editor/processor/DriverProcessor.java b/gwt-editor-processor/src/main/java/org/gwtproject/editor/processor/DriverProcessor.java index 8edc9d2..2311c30 100644 --- a/gwt-editor-processor/src/main/java/org/gwtproject/editor/processor/DriverProcessor.java +++ b/gwt-editor-processor/src/main/java/org/gwtproject/editor/processor/DriverProcessor.java @@ -20,13 +20,30 @@ import com.google.auto.common.MoreTypes; import com.google.auto.service.AutoService; import com.google.common.base.Stopwatch; -import com.squareup.javapoet.*; +import com.squareup.javapoet.AnnotationSpec; +import com.squareup.javapoet.ClassName; +import com.squareup.javapoet.FieldSpec; +import com.squareup.javapoet.JavaFile; +import com.squareup.javapoet.MethodSpec; +import com.squareup.javapoet.ParameterizedTypeName; +import com.squareup.javapoet.TypeName; +import com.squareup.javapoet.TypeSpec; import java.io.IOException; import java.io.PrintWriter; import java.io.StringWriter; -import java.util.*; +import java.util.ArrayList; +import java.util.IdentityHashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.StringJoiner; import java.util.stream.Stream; -import javax.annotation.processing.*; +import javax.annotation.processing.AbstractProcessor; +import javax.annotation.processing.Filer; +import javax.annotation.processing.Messager; +import javax.annotation.processing.ProcessingEnvironment; +import javax.annotation.processing.Processor; +import javax.annotation.processing.RoundEnvironment; import javax.lang.model.SourceVersion; import javax.lang.model.element.Element; import javax.lang.model.element.Modifier; @@ -164,6 +181,10 @@ protected void generate(TypeElement interfaceToImplement, EditorModel rootEditor .addModifiers(Modifier.PUBLIC) .returns(void.class) .addAnnotation(Override.class) + .addAnnotation( + AnnotationSpec.builder(SuppressWarnings.class) + .addMember("value", "$S", "unchecked") + .build()) .addParameter(EditorVisitor.class, "visitor") // ugly cast to shut up java warnings at compile time - however, this might be overkill, // could just use raw types @@ -240,6 +261,10 @@ protected void generate(TypeElement interfaceToImplement, EditorModel rootEditor /** * Joins the name of the type with any enclosing types, with "_" as the delimeter, and appends an * optional suffix. + * + * @param interfaceToImplement TypeElement of the interface to implement + * @param suffix suffix to use or null (no suffix) + * @return created name */ protected String createNameFromEnclosedTypes(TypeElement interfaceToImplement, String suffix) { StringJoiner joiner = new StringJoiner("_", "", suffix == null ? "" : suffix); @@ -272,22 +297,38 @@ protected ClassName getEditorDelegate(EditorModel editorModel, EditorProperty da TypeSpec.classBuilder(delegateSimpleName) .addOriginatingElement(types.asElement(data.getEditedType())) .addOriginatingElement(types.asElement(data.getEditorType())) - .addModifiers(Modifier.PUBLIC) - // Once GWT supports the new package of the Generated class - // we can uncomment this code - // .addAnnotation( - // AnnotationSpec.builder(getGeneratedClassName()) - // .addMember("value", "\"$L\"", - // DriverProcessor.class.getCanonicalName()) - // .build()) - .superclass(getEditorDelegateType()); // raw type here, for the same reason as above + .addModifiers(Modifier.PUBLIC); + // Once GWT supports the new package of the Generated class + // we can uncomment this code + // .addAnnotation( + // AnnotationSpec.builder(getGeneratedClassName()) + // .addMember("value", "\"$L\"", + // DriverProcessor.class.getCanonicalName()) + // .build()) + if (data.getEditedType() != null && data.getEditorType() != null) { + ParameterizedTypeName delegateType = + ParameterizedTypeName.get( + getEditorDelegateType(), + TypeName.get(data.getEditedType()), + TypeName.get(data.getEditorType())); + delegateTypeBuilder.superclass(delegateType); + } else { + delegateTypeBuilder.superclass(getEditorDelegateType()); + } NameFactory names = new NameFactory(); Map delegateFields = new IdentityHashMap<>(); - delegateTypeBuilder.addField( - FieldSpec.builder(rawEditorType, "editor", Modifier.PRIVATE).build()); - names.addName("editor"); + if (data.getEditorType() != null) { + delegateTypeBuilder.addField( + FieldSpec.builder(ClassName.get(data.getEditorType()), "editor", Modifier.PRIVATE) + .build()); + names.addName("editor"); + } else { + delegateTypeBuilder.addField( + FieldSpec.builder(rawEditorType, "editor", Modifier.PRIVATE).build()); + names.addName("editor"); + } delegateTypeBuilder.addField( FieldSpec.builder(ClassName.get(data.getEditedType()), "object", Modifier.PRIVATE).build()); names.addName("object"); @@ -298,26 +339,48 @@ protected ClassName getEditorDelegate(EditorModel editorModel, EditorProperty da String fieldName = names.createName(d.getPropertyName() + "Delegate"); delegateFields.put(d, fieldName); delegateTypeBuilder.addField( - getEditorDelegateType(), fieldName, Modifier.PRIVATE); // TODO parameterize + ParameterizedTypeName.get( + getEditorDelegateType(), + TypeName.get(d.getEditedType()), + TypeName.get(d.getEditorType())), + fieldName, + Modifier.PRIVATE); } } - delegateTypeBuilder.addMethod( - MethodSpec.methodBuilder("getEditor") - .addModifiers(Modifier.PROTECTED) - .returns(rawEditorType) - .addAnnotation(Override.class) - .addStatement("return editor") - .build()); - - delegateTypeBuilder.addMethod( - MethodSpec.methodBuilder("setEditor") - .addModifiers(Modifier.PROTECTED) - .returns(void.class) - .addAnnotation(Override.class) - .addParameter(Editor.class, "editor") - .addStatement("this.editor = ($T) editor", rawEditorType) - .build()); + if (data.getEditorType() != null) { + delegateTypeBuilder.addMethod( + MethodSpec.methodBuilder("getEditor") + .addModifiers(Modifier.PROTECTED) + .returns(ClassName.get(data.getEditorType())) + .addAnnotation(Override.class) + .addStatement("return editor") + .build()); + delegateTypeBuilder.addMethod( + MethodSpec.methodBuilder("setEditor") + .addModifiers(Modifier.PROTECTED) + .returns(void.class) + .addAnnotation(Override.class) + .addParameter(ClassName.get(data.getEditorType()), "editor") + .addStatement("this.editor = editor") + .build()); + } else { + delegateTypeBuilder.addMethod( + MethodSpec.methodBuilder("getEditor") + .addModifiers(Modifier.PROTECTED) + .returns(rawEditorType) + .addAnnotation(Override.class) + .addStatement("return editor") + .build()); + delegateTypeBuilder.addMethod( + MethodSpec.methodBuilder("setEditor") + .addModifiers(Modifier.PROTECTED) + .returns(void.class) + .addAnnotation(Override.class) + .addParameter(Editor.class, "editor") + .addStatement("this.editor = editor") + .build()); + } delegateTypeBuilder.addMethod( MethodSpec.methodBuilder("getObject") @@ -327,14 +390,25 @@ protected ClassName getEditorDelegate(EditorModel editorModel, EditorProperty da .addStatement("return object") .build()); - delegateTypeBuilder.addMethod( - MethodSpec.methodBuilder("setObject") - .addModifiers(Modifier.PROTECTED) - .returns(void.class) - .addAnnotation(Override.class) - .addParameter(ClassName.get(Object.class), "object") - .addStatement("this.object = ($T) object", ClassName.get(data.getEditedType())) - .build()); + if (data.getEditedType() != null) { + delegateTypeBuilder.addMethod( + MethodSpec.methodBuilder("setObject") + .addModifiers(Modifier.PROTECTED) + .returns(void.class) + .addAnnotation(Override.class) + .addParameter(ClassName.get(data.getEditedType()), "object") + .addStatement("this.object = object") + .build()); + } else { + delegateTypeBuilder.addMethod( + MethodSpec.methodBuilder("setObject") + .addModifiers(Modifier.PROTECTED) + .returns(void.class) + .addAnnotation(Override.class) + .addParameter(ClassName.get(Object.class), "object") + .addStatement("this.object = ($T) object", ClassName.get(data.getEditedType())) + .build()); + } MethodSpec.Builder initializeSubDelegatesBuilder = MethodSpec.methodBuilder("initializeSubDelegates") @@ -520,18 +594,49 @@ private ClassName getEditorContext(EditorProperty parent, EditorProperty data) { MethodSpec.methodBuilder("checkAssignment") .addModifiers(Modifier.PUBLIC) .addAnnotation(Override.class) + .addAnnotation( + AnnotationSpec.builder(SuppressWarnings.class) + .addMember("value", "$S", "unchecked") + .build()) .returns(ClassName.get(data.getEditedType())) .addParameter(Object.class, "value") .addStatement("return ($T) value", ClassName.get(data.getEditedType())) .build()); - contextTypeBuilder.addMethod( - MethodSpec.methodBuilder("getEditedType") - .addModifiers(Modifier.PUBLIC) - .addAnnotation(Override.class) - .returns(Class.class) - .addStatement("return $L.class", MoreTypes.asElement(data.getEditedType())) - .build()); + if (MoreTypes.asDeclared(data.getEditorType()).getTypeArguments().size() > 1) { + contextTypeBuilder.addMethod( + MethodSpec.methodBuilder("getEditedType") + .addModifiers(Modifier.PUBLIC) + .addAnnotation(Override.class) + .addAnnotation( + AnnotationSpec.builder(SuppressWarnings.class) + .addMember("value", "$S", "unchecked") + .build()) + .returns( + ParameterizedTypeName.get( + ClassName.get(Class.class), ClassName.get(data.getEditedType()))) + .addStatement( + "return ($T<$T>) ($T) $L.class", + ClassName.get(Class.class), + ClassName.get(data.getEditedType()), + ClassName.get(Class.class), + MoreTypes.asElement(data.getEditedType())) + .build()); + } else { + contextTypeBuilder.addMethod( + MethodSpec.methodBuilder("getEditedType") + .addModifiers(Modifier.PUBLIC) + .addAnnotation(Override.class) + .addAnnotation( + AnnotationSpec.builder(SuppressWarnings.class) + .addMember("value", "$S", "unchecked") + .build()) + .returns( + ParameterizedTypeName.get( + ClassName.get(Class.class), ClassName.get(data.getEditedType()))) + .addStatement("return $L.class", MoreTypes.asElement(data.getEditedType())) + .build()); + } contextTypeBuilder.addMethod( MethodSpec.methodBuilder("getFromModel") diff --git a/gwt-editor-processor/src/test/java/org/gwtproject/editor/client/SimpleBeanEditorTest.java b/gwt-editor-processor/src/test/java/org/gwtproject/editor/client/SimpleBeanEditorTest.java index 351220f..693bcd2 100644 --- a/gwt-editor-processor/src/test/java/org/gwtproject/editor/client/SimpleBeanEditorTest.java +++ b/gwt-editor-processor/src/test/java/org/gwtproject/editor/client/SimpleBeanEditorTest.java @@ -28,8 +28,9 @@ * AbstractEditorDriverGenerator. */ public class SimpleBeanEditorTest extends TestCase { - class AddressCoEditorView extends LeafAddressEditor implements IsEditor { - private LeafAddressEditor addressEditor = new LeafAddressEditor(); + static class AddressCoEditorView extends LeafAddressEditor + implements IsEditor { + private final LeafAddressEditor addressEditor = new LeafAddressEditor(); @Override public LeafAddressEditor asEditor() { @@ -131,7 +132,7 @@ public static class PersonEditorWithAddressEditorView implements Editor interface PersonEditorWithAddressEditorViewDriver extends SimpleBeanEditorDriver {} - class SampleView implements Editor { + static class SampleView implements Editor { SimpleEditor id = SimpleEditor.of(0); } @@ -151,7 +152,7 @@ public static class PersonEditorWithAliasedSubEditors implements Editor interface PersonEditorWithAliasedSubEditorsDriver extends SimpleBeanEditorDriver {} - class PersonEditorWithCoAddressEditorView implements Editor { + static class PersonEditorWithCoAddressEditorView implements Editor { AddressCoEditorView addressEditor = new AddressCoEditorView(); SimpleEditor name = SimpleEditor.of(UNINITIALIZED); } @@ -221,7 +222,7 @@ public PersonEditorWithOptionalAddressEditor(AddressEditor delegate) { } } - class PersonEditorWithValueAwareAddressEditor implements Editor { + static class PersonEditorWithValueAwareAddressEditor implements Editor { ValueAwareAddressEditor addressEditor = new ValueAwareAddressEditor(); SimpleEditor name = SimpleEditor.of(UNINITIALIZED); @@ -233,7 +234,7 @@ class PersonEditorWithValueAwareAddressEditor implements Editor { interface PersonEditorWithValueAwareAddressEditorDriver extends SimpleBeanEditorDriver {} - class PersonEditorWithValueAwareLeafAddressEditor implements Editor { + static class PersonEditorWithValueAwareLeafAddressEditor implements Editor { ValueAwareLeafAddressEditor addressEditor = new ValueAwareLeafAddressEditor(); SimpleEditor name = SimpleEditor.of(UNINITIALIZED); @@ -249,7 +250,7 @@ static class PersonGenericEditor implements Editor { SimpleEditor name = SimpleEditor.of(UNINITIALIZED); } - class PersonWithList { + static class PersonWithList { String name = "PersonWithList"; List
addresses = new ArrayList
(); @@ -262,7 +263,7 @@ public String getName() { } } - class PersonWithListEditor implements Editor { + static class PersonWithListEditor implements Editor { SimpleEditor nameEditor = SimpleEditor.of(UNINITIALIZED); ListEditor addressesEditor = ListEditor.of( @@ -320,7 +321,8 @@ public void setValue(Address value) { } /** All the mix-ins. Not that this seems like a good idea... */ - class ValueAwareLeafAddressEditor extends LeafAddressEditor implements ValueAwareEditor
{ + static class ValueAwareLeafAddressEditor extends LeafAddressEditor + implements ValueAwareEditor
{ int flushCalled; int setDelegateCalled; @@ -338,7 +340,7 @@ public void setDelegate(EditorDelegate
delegate) { } } - class TaggedItemAddressEditor implements Editor> { + static class TaggedItemAddressEditor implements Editor> { @Path("item.city") SimpleEditor itemCityEditor = SimpleEditor.of(UNINITIALIZED); @@ -575,8 +577,9 @@ public void testLifecycle() { public void testListEditor() { final SortedMap> positionMap = new TreeMap>(); - @SuppressWarnings("unchecked") - final SimpleEditor[] disposed = new SimpleEditor[1]; + // final SimpleEditor[] disposed = new SimpleEditor[1]; + final List> disposed = new ArrayList<>(); + disposed.add(null); class StringSource extends EditorSource> { @Override public SimpleEditor create(int index) { @@ -587,7 +590,7 @@ public SimpleEditor create(int index) { @Override public void dispose(SimpleEditor editor) { - disposed[0] = editor; + disposed.set(0, editor); positionMap.values().remove(editor); } @@ -636,7 +639,7 @@ public void setIndex(SimpleEditor editor, int index) { // Delete an element SimpleEditor expectedDisposed = editors.get(0); mutableList.remove(0); - assertSame(expectedDisposed, disposed[0]); + assertSame(expectedDisposed, disposed.get(0)); assertEquals(3, editors.size()); assertEquals("quux", editors.get(2).getValue()); assertEquals(editors, new ArrayList<>(positionMap.values())); @@ -654,9 +657,8 @@ public void setIndex(SimpleEditor editor, int index) { assertEquals(editors, new ArrayList<>(positionMap.values())); // Edit again: should reuse sub-editors and dispose unneeded ones - disposed[0] = null; + disposed.set(0, null); expectedDisposed = editors.get(2); - @SuppressWarnings("unchecked") List> expectedEditors = Arrays.asList(editors.get(0), editors.get(1)); driver.edit(rawData); assertEquals(expectedEditors, editors); @@ -665,7 +667,7 @@ public void setIndex(SimpleEditor editor, int index) { assertEquals(rawData.size(), editors.size()); assertEquals(rawData, Arrays.asList(editors.get(0).getValue(), editors.get(1).getValue())); assertEquals(editors, new ArrayList>(positionMap.values())); - assertEquals(expectedDisposed, disposed[0]); + assertEquals(expectedDisposed, disposed.get(0)); } /** Ensure that a ListEditor deeper in the chain is properly flushed. */ diff --git a/gwt-editor-processor/src/test/java/org/gwtproject/editor/processor/model/EditorModelTest.java b/gwt-editor-processor/src/test/java/org/gwtproject/editor/processor/model/EditorModelTest.java index 713748b..68bcdbf 100644 --- a/gwt-editor-processor/src/test/java/org/gwtproject/editor/processor/model/EditorModelTest.java +++ b/gwt-editor-processor/src/test/java/org/gwtproject/editor/processor/model/EditorModelTest.java @@ -23,7 +23,6 @@ import com.google.web.bindery.requestfactory.shared.RequestFactory; import java.util.Arrays; import java.util.List; -import javax.lang.model.element.Element; import javax.lang.model.type.TypeMirror; import javax.lang.model.util.Elements; import javax.lang.model.util.Types; @@ -360,10 +359,10 @@ public void testMethodEditors() { checkPersonReadonly(fields.get(1)); } - /** - * Tests the case where an Editor wants to editor a property that is not provided by its - * associated Proxy type. - */ + // /** + // * Tests the case where an Editor wants to editor a property that is not provided by its + // * associated Proxy type. + // */ // public void testMissingGetter() { // UnitTestTreeLogger.Builder builder = new UnitTestTreeLogger.Builder(); // builder.setLowestLogLevel(TreeLogger.ERROR); @@ -384,7 +383,7 @@ public void testMethodEditors() { // testLogger.assertCorrectLogEntries(); // } - /** Tests the sanity-check error messages emitted by the constructor. */ + // /** Tests the sanity-check error messages emitted by the constructor. */ // public void testSanityErrorMessages() { // UnitTestTreeLogger.Builder builder = new UnitTestTreeLogger.Builder(); // builder.setLowestLogLevel(TreeLogger.ERROR); @@ -498,7 +497,7 @@ private void checkPersonName(EditorProperty editorField) { Assert.assertEquals("setName", editorField.getSetterName()); } - /** @param editorField */ + /** @param editorField editor property */ private void checkPersonReadonly(EditorProperty editorField) { assertNotNull(editorField); assertEquals(typeMirrorFor(SimpleEditor.class), raw(editorField.getEditorType())); @@ -515,9 +514,9 @@ private static void assertEquals(TypeMirror expected, TypeMirror actual) { MoreTypes.equivalence().equivalent(expected, actual)); } - private Element typeElementFor(Class clazz) { - return MoreTypes.asElement(raw(elements.getTypeElement(clazz.getCanonicalName()).asType())); - } + // private Element typeElementFor(Class clazz) { + // return MoreTypes.asElement(raw(elements.getTypeElement(clazz.getCanonicalName()).asType())); + // } private TypeMirror typeMirrorFor(Class clazz) { return raw(elements.getTypeElement(clazz.getCanonicalName()).asType()); @@ -683,7 +682,7 @@ static class PersonEditor implements Editor { SimpleEditor lastModified; public SimpleEditor name; SimpleEditor readonly; - public static SimpleEditor ignoredStatic; + public static SimpleEditor ignoredStatic; private SimpleEditor ignoredPrivate; @Editor.Ignore public SimpleEditor ignoredPublic; } @@ -740,7 +739,7 @@ interface UnparameterizedEditorEditorDriver interface AProxy extends EntityProxy {} interface AEditor extends Editor { - SimpleEditor needsParameterization(); + SimpleEditor needsParameterization(); } } diff --git a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test01/result/TestEditor01_Driver_Impl.java b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test01/result/TestEditor01_Driver_Impl.java index d17830a..8085b39 100644 --- a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test01/result/TestEditor01_Driver_Impl.java +++ b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test01/result/TestEditor01_Driver_Impl.java @@ -1,6 +1,7 @@ package org.gwtproject.editor.processor.test01; import java.lang.Override; +import java.lang.SuppressWarnings; import org.gwtproject.editor.client.EditorVisitor; import org.gwtproject.editor.client.impl.AbstractSimpleBeanEditorDriver; import org.gwtproject.editor.client.impl.RootEditorContext; @@ -9,6 +10,7 @@ public class TestEditor01_Driver_Impl extends AbstractSimpleBeanEditorDriver implements TestEditor01.Driver { @Override + @SuppressWarnings("unchecked") public void accept(EditorVisitor visitor) { RootEditorContext ctx = new RootEditorContext(getDelegate(), (Class)(Class)org.gwtproject.editor.processor.common.EditorBean.class, getObject()); ctx.traverse(visitor, getDelegate()); diff --git a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test01/result/TestEditor01_id_Context.java b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test01/result/TestEditor01_id_Context.java index 8a40858..2c95f8a 100644 --- a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test01/result/TestEditor01_id_Context.java +++ b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test01/result/TestEditor01_id_Context.java @@ -1,43 +1,38 @@ package org.gwtproject.editor.processor.test01; - import java.lang.Class; import java.lang.Object; import java.lang.Override; import java.lang.String; +import java.lang.SuppressWarnings; import org.gwtproject.editor.client.Editor; import org.gwtproject.editor.client.impl.AbstractEditorContext; import org.gwtproject.editor.processor.common.EditorBean; - public class TestEditor01_id_Context extends AbstractEditorContext { private final EditorBean parent; - public TestEditor01_id_Context(EditorBean parent, Editor editor, String path) { super(editor, path); this.parent = parent; } - @Override public boolean canSetInModel() { return parent != null && true && true; } - @Override + @SuppressWarnings("unchecked") public String checkAssignment(Object value) { return (String) value; } - @Override - public Class getEditedType() { + @SuppressWarnings("unchecked") + public Class getEditedType() { return java.lang.String.class; } - @Override public String getFromModel() { return (parent != null && true) ? parent.getId() : null; } - @Override public void setInModel(String data) { parent.setId(data); } -} +} \ No newline at end of file diff --git a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test02/result/TestEditor02_Driver_Impl.java b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test02/result/TestEditor02_Driver_Impl.java index 2451300..df2e235 100644 --- a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test02/result/TestEditor02_Driver_Impl.java +++ b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test02/result/TestEditor02_Driver_Impl.java @@ -1,6 +1,7 @@ package org.gwtproject.editor.processor.test02; import java.lang.Override; +import java.lang.SuppressWarnings; import org.gwtproject.editor.client.EditorVisitor; import org.gwtproject.editor.client.impl.AbstractSimpleBeanEditorDriver; import org.gwtproject.editor.client.impl.RootEditorContext; @@ -9,6 +10,7 @@ public class TestEditor02_Driver_Impl extends AbstractSimpleBeanEditorDriver implements TestEditor02.Driver { @Override + @SuppressWarnings("unchecked") public void accept(EditorVisitor visitor) { RootEditorContext ctx = new RootEditorContext(getDelegate(), (Class)(Class)org.gwtproject.editor.processor.common.EditorBeanWithInterface.class, getObject()); ctx.traverse(visitor, getDelegate()); diff --git a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test02/result/TestEditor02_id_Context.java b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test02/result/TestEditor02_id_Context.java index 1d44887..ea7bf86 100644 --- a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test02/result/TestEditor02_id_Context.java +++ b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test02/result/TestEditor02_id_Context.java @@ -1,44 +1,39 @@ package org.gwtproject.editor.processor.test02; - import java.lang.Class; import java.lang.Object; import java.lang.Override; import java.lang.String; +import java.lang.SuppressWarnings; import org.gwtproject.editor.client.Editor; import org.gwtproject.editor.client.impl.AbstractEditorContext; import org.gwtproject.editor.processor.common.EditorBeanWithInterface; - public class TestEditor02_id_Context extends AbstractEditorContext { private final EditorBeanWithInterface parent; - public TestEditor02_id_Context(EditorBeanWithInterface parent, Editor editor, String path) { super(editor, path); this.parent = parent; } - @Override public boolean canSetInModel() { return parent != null && true && true; } - @Override + @SuppressWarnings("unchecked") public String checkAssignment(Object value) { return (String) value; } - @Override - public Class getEditedType() { + @SuppressWarnings("unchecked") + public Class getEditedType() { return java.lang.String.class; } - @Override public String getFromModel() { return (parent != null && true) ? parent.getId() : null; } - @Override public void setInModel(String data) { parent.setId(data); } -} +} \ No newline at end of file diff --git a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test03/result/TestEditor03_Driver_Impl.java b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test03/result/TestEditor03_Driver_Impl.java index 2f931fc..1277187 100644 --- a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test03/result/TestEditor03_Driver_Impl.java +++ b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test03/result/TestEditor03_Driver_Impl.java @@ -1,6 +1,7 @@ package org.gwtproject.editor.processor.test03; import java.lang.Override; +import java.lang.SuppressWarnings; import org.gwtproject.editor.client.EditorVisitor; import org.gwtproject.editor.client.impl.AbstractSimpleBeanEditorDriver; import org.gwtproject.editor.client.impl.RootEditorContext; @@ -9,6 +10,7 @@ public class TestEditor03_Driver_Impl extends AbstractSimpleBeanEditorDriver implements TestEditor03.Driver { @Override + @SuppressWarnings("unchecked") public void accept(EditorVisitor visitor) { RootEditorContext ctx = new RootEditorContext(getDelegate(), (Class)(Class)org.gwtproject.editor.processor.common.EditorBeanWithInterface.class, getObject()); ctx.traverse(visitor, getDelegate()); diff --git a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test03/result/TestEditor03_id_Context.java b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test03/result/TestEditor03_id_Context.java index ecdac13..2a2257c 100644 --- a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test03/result/TestEditor03_id_Context.java +++ b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test03/result/TestEditor03_id_Context.java @@ -1,44 +1,39 @@ package org.gwtproject.editor.processor.test03; - import java.lang.Class; import java.lang.Object; import java.lang.Override; import java.lang.String; +import java.lang.SuppressWarnings; import org.gwtproject.editor.client.Editor; import org.gwtproject.editor.client.impl.AbstractEditorContext; import org.gwtproject.editor.processor.common.EditorBeanWithInterface; - public class TestEditor03_id_Context extends AbstractEditorContext { private final EditorBeanWithInterface parent; - public TestEditor03_id_Context(EditorBeanWithInterface parent, Editor editor, String path) { super(editor, path); this.parent = parent; } - @Override public boolean canSetInModel() { return parent != null && true && true; } - @Override + @SuppressWarnings("unchecked") public String checkAssignment(Object value) { return (String) value; } - @Override - public Class getEditedType() { + @SuppressWarnings("unchecked") + public Class getEditedType() { return java.lang.String.class; } - @Override public String getFromModel() { return (parent != null && true) ? parent.getId() : null; } - @Override public void setInModel(String data) { parent.setId(data); } -} +} \ No newline at end of file diff --git a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test04/result/TestEditor04_Driver_Impl.java b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test04/result/TestEditor04_Driver_Impl.java index 9797051..e2b4ce8 100644 --- a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test04/result/TestEditor04_Driver_Impl.java +++ b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test04/result/TestEditor04_Driver_Impl.java @@ -1,6 +1,7 @@ package org.gwtproject.editor.processor.test04; import java.lang.Override; +import java.lang.SuppressWarnings; import org.gwtproject.editor.client.EditorVisitor; import org.gwtproject.editor.client.impl.AbstractSimpleBeanEditorDriver; import org.gwtproject.editor.client.impl.RootEditorContext; @@ -9,6 +10,7 @@ public class TestEditor04_Driver_Impl extends AbstractSimpleBeanEditorDriver implements TestEditor04.Driver { @Override + @SuppressWarnings("unchecked") public void accept(EditorVisitor visitor) { RootEditorContext ctx = new RootEditorContext(getDelegate(), (Class)(Class)org.gwtproject.editor.processor.common.UserDto.class, getObject()); ctx.traverse(visitor, getDelegate()); diff --git a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test04/result/TestEditor04_active_Context.java b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test04/result/TestEditor04_active_Context.java index ef6d113..f6e0b79 100644 --- a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test04/result/TestEditor04_active_Context.java +++ b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test04/result/TestEditor04_active_Context.java @@ -1,44 +1,39 @@ package org.gwtproject.editor.processor.test04; - import java.lang.Boolean; import java.lang.Class; import java.lang.Object; import java.lang.Override; import java.lang.String; +import java.lang.SuppressWarnings; import org.gwtproject.editor.client.Editor; import org.gwtproject.editor.client.impl.AbstractEditorContext; import org.gwtproject.editor.processor.common.UserDto; - public class TestEditor04_active_Context extends AbstractEditorContext { private final UserDto parent; - public TestEditor04_active_Context(UserDto parent, Editor editor, String path) { super(editor, path); this.parent = parent; } - @Override public boolean canSetInModel() { return parent != null && true && true; } - @Override + @SuppressWarnings("unchecked") public Boolean checkAssignment(Object value) { return (Boolean) value; } - @Override - public Class getEditedType() { + @SuppressWarnings("unchecked") + public Class getEditedType() { return java.lang.Boolean.class; } - @Override public Boolean getFromModel() { return (parent != null && true) ? parent.isActive() : null; } - @Override public void setInModel(Boolean data) { parent.setActive(data); } -} +} \ No newline at end of file diff --git a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test04/result/TestEditor04_age_Context.java b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test04/result/TestEditor04_age_Context.java index 439a54b..39692b1 100644 --- a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test04/result/TestEditor04_age_Context.java +++ b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test04/result/TestEditor04_age_Context.java @@ -1,44 +1,39 @@ package org.gwtproject.editor.processor.test04; - import java.lang.Class; import java.lang.Integer; import java.lang.Object; import java.lang.Override; import java.lang.String; +import java.lang.SuppressWarnings; import org.gwtproject.editor.client.Editor; import org.gwtproject.editor.client.impl.AbstractEditorContext; import org.gwtproject.editor.processor.common.UserDto; - public class TestEditor04_age_Context extends AbstractEditorContext { private final UserDto parent; - public TestEditor04_age_Context(UserDto parent, Editor editor, String path) { super(editor, path); this.parent = parent; } - @Override public boolean canSetInModel() { return parent != null && true && true; } - @Override + @SuppressWarnings("unchecked") public Integer checkAssignment(Object value) { return (Integer) value; } - @Override - public Class getEditedType() { + @SuppressWarnings("unchecked") + public Class getEditedType() { return java.lang.Integer.class; } - @Override public Integer getFromModel() { return (parent != null && true) ? parent.getAge() : null; } - @Override public void setInModel(Integer data) { parent.setAge(data); } -} +} \ No newline at end of file diff --git a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test04/result/TestEditor04_email_Context.java b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test04/result/TestEditor04_email_Context.java index 3d3d4a6..1ce8aaf 100644 --- a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test04/result/TestEditor04_email_Context.java +++ b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test04/result/TestEditor04_email_Context.java @@ -1,41 +1,36 @@ package org.gwtproject.editor.processor.test04; - import java.lang.Class; import java.lang.Object; import java.lang.Override; import java.lang.String; +import java.lang.SuppressWarnings; import org.gwtproject.editor.client.Editor; import org.gwtproject.editor.client.impl.AbstractEditorContext; import org.gwtproject.editor.processor.common.UserDto; - public class TestEditor04_email_Context extends AbstractEditorContext { private final UserDto parent; - public TestEditor04_email_Context(UserDto parent, Editor editor, String path) { super(editor, path); this.parent = parent; } - @Override public boolean canSetInModel() { return parent != null && true && true; } - @Override + @SuppressWarnings("unchecked") public String checkAssignment(Object value) { return (String) value; } - @Override - public Class getEditedType() { + @SuppressWarnings("unchecked") + public Class getEditedType() { return java.lang.String.class; } - @Override public String getFromModel() { return (parent != null && true) ? parent.getEmail() : null; } - @Override public void setInModel(String data) { parent.setEmail(data); diff --git a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test04/result/TestEditor04_firstName_Context.java b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test04/result/TestEditor04_firstName_Context.java index 2ebbf7e..c70c626 100644 --- a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test04/result/TestEditor04_firstName_Context.java +++ b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test04/result/TestEditor04_firstName_Context.java @@ -1,43 +1,38 @@ package org.gwtproject.editor.processor.test04; - import java.lang.Class; import java.lang.Object; import java.lang.Override; import java.lang.String; +import java.lang.SuppressWarnings; import org.gwtproject.editor.client.Editor; import org.gwtproject.editor.client.impl.AbstractEditorContext; import org.gwtproject.editor.processor.common.UserDto; - public class TestEditor04_firstName_Context extends AbstractEditorContext { private final UserDto parent; - public TestEditor04_firstName_Context(UserDto parent, Editor editor, String path) { super(editor, path); this.parent = parent; } - @Override public boolean canSetInModel() { return parent != null && true && true; } - @Override + @SuppressWarnings("unchecked") public String checkAssignment(Object value) { return (String) value; } - @Override - public Class getEditedType() { + @SuppressWarnings("unchecked") + public Class getEditedType() { return java.lang.String.class; } - @Override public String getFromModel() { return (parent != null && true) ? parent.getFirstName() : null; } - @Override public void setInModel(String data) { parent.setFirstName(data); } -} +} \ No newline at end of file diff --git a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test04/result/TestEditor04_id_Context.java b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test04/result/TestEditor04_id_Context.java index cb63914..77e0839 100644 --- a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test04/result/TestEditor04_id_Context.java +++ b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test04/result/TestEditor04_id_Context.java @@ -1,44 +1,39 @@ package org.gwtproject.editor.processor.test04; - import java.lang.Class; import java.lang.Long; import java.lang.Object; import java.lang.Override; import java.lang.String; +import java.lang.SuppressWarnings; import org.gwtproject.editor.client.Editor; import org.gwtproject.editor.client.impl.AbstractEditorContext; import org.gwtproject.editor.processor.common.UserDto; - public class TestEditor04_id_Context extends AbstractEditorContext { private final UserDto parent; - public TestEditor04_id_Context(UserDto parent, Editor editor, String path) { super(editor, path); this.parent = parent; } - @Override public boolean canSetInModel() { return parent != null && true && true; } - @Override + @SuppressWarnings("unchecked") public Long checkAssignment(Object value) { return (Long) value; } - @Override - public Class getEditedType() { + @SuppressWarnings("unchecked") + public Class getEditedType() { return java.lang.Long.class; } - @Override public Long getFromModel() { return (parent != null && true) ? parent.getId() : null; } - @Override public void setInModel(Long data) { parent.setId(data); } -} +} \ No newline at end of file diff --git a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test04/result/TestEditor04_lastName_Context.java b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test04/result/TestEditor04_lastName_Context.java index 63c28b6..3ef8d34 100644 --- a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test04/result/TestEditor04_lastName_Context.java +++ b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test04/result/TestEditor04_lastName_Context.java @@ -1,43 +1,38 @@ package org.gwtproject.editor.processor.test04; - import java.lang.Class; import java.lang.Object; import java.lang.Override; import java.lang.String; +import java.lang.SuppressWarnings; import org.gwtproject.editor.client.Editor; import org.gwtproject.editor.client.impl.AbstractEditorContext; import org.gwtproject.editor.processor.common.UserDto; - public class TestEditor04_lastName_Context extends AbstractEditorContext { private final UserDto parent; - public TestEditor04_lastName_Context(UserDto parent, Editor editor, String path) { super(editor, path); this.parent = parent; } - @Override public boolean canSetInModel() { return parent != null && true && true; } - @Override + @SuppressWarnings("unchecked") public String checkAssignment(Object value) { return (String) value; } - @Override - public Class getEditedType() { + @SuppressWarnings("unchecked") + public Class getEditedType() { return java.lang.String.class; } - @Override public String getFromModel() { return (parent != null && true) ? parent.getLastName() : null; } - @Override public void setInModel(String data) { parent.setLastName(data); } -} +} \ No newline at end of file diff --git a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test04/result/TestEditor04_phone_Context.java b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test04/result/TestEditor04_phone_Context.java index 3222740..e7be4ef 100644 --- a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test04/result/TestEditor04_phone_Context.java +++ b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test04/result/TestEditor04_phone_Context.java @@ -1,43 +1,38 @@ package org.gwtproject.editor.processor.test04; - import java.lang.Class; import java.lang.Object; import java.lang.Override; import java.lang.String; +import java.lang.SuppressWarnings; import org.gwtproject.editor.client.Editor; import org.gwtproject.editor.client.impl.AbstractEditorContext; import org.gwtproject.editor.processor.common.UserDto; - public class TestEditor04_phone_Context extends AbstractEditorContext { private final UserDto parent; - public TestEditor04_phone_Context(UserDto parent, Editor editor, String path) { super(editor, path); this.parent = parent; } - @Override public boolean canSetInModel() { return parent != null && true && true; } - @Override + @SuppressWarnings("unchecked") public String checkAssignment(Object value) { return (String) value; } - @Override - public Class getEditedType() { + @SuppressWarnings("unchecked") + public Class getEditedType() { return java.lang.String.class; } - @Override public String getFromModel() { return (parent != null && true) ? parent.getPhone() : null; } - @Override public void setInModel(String data) { parent.setPhone(data); } -} +} \ No newline at end of file diff --git a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test05/result/TestEditor05_Driver_Impl.java b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test05/result/TestEditor05_Driver_Impl.java index 9846a2a..95a30b5 100644 --- a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test05/result/TestEditor05_Driver_Impl.java +++ b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test05/result/TestEditor05_Driver_Impl.java @@ -1,6 +1,7 @@ package org.gwtproject.editor.processor.test05; import java.lang.Override; +import java.lang.SuppressWarnings; import org.gwtproject.editor.client.EditorVisitor; import org.gwtproject.editor.client.impl.AbstractSimpleBeanEditorDriver; import org.gwtproject.editor.client.impl.RootEditorContext; @@ -9,6 +10,7 @@ public class TestEditor05_Driver_Impl extends AbstractSimpleBeanEditorDriver implements TestEditor05.Driver { @Override + @SuppressWarnings("unchecked") public void accept(EditorVisitor visitor) { RootEditorContext ctx = new RootEditorContext(getDelegate(), (Class)(Class)org.gwtproject.editor.processor.common.Model01Dto.class, getObject()); ctx.traverse(visitor, getDelegate()); diff --git a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test05/result/TestEditor05_email_Context.java b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test05/result/TestEditor05_email_Context.java index 3c702dc..953a3fc 100644 --- a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test05/result/TestEditor05_email_Context.java +++ b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test05/result/TestEditor05_email_Context.java @@ -1,43 +1,38 @@ package org.gwtproject.editor.processor.test05; - import java.lang.Class; import java.lang.Object; import java.lang.Override; import java.lang.String; +import java.lang.SuppressWarnings; import org.gwtproject.editor.client.Editor; import org.gwtproject.editor.client.impl.AbstractEditorContext; import org.gwtproject.editor.processor.common.Model01Dto; - public class TestEditor05_email_Context extends AbstractEditorContext { private final Model01Dto parent; - public TestEditor05_email_Context(Model01Dto parent, Editor editor, String path) { super(editor, path); this.parent = parent; } - @Override public boolean canSetInModel() { return parent != null && true && true; } - @Override + @SuppressWarnings("unchecked") public String checkAssignment(Object value) { return (String) value; } - @Override - public Class getEditedType() { + @SuppressWarnings("unchecked") + public Class getEditedType() { return java.lang.String.class; } - @Override public String getFromModel() { return (parent != null && true) ? parent.getEmail() : null; } - @Override public void setInModel(String data) { parent.setEmail(data); } -} +} \ No newline at end of file diff --git a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test05/result/TestEditor05_id_Context.java b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test05/result/TestEditor05_id_Context.java index 70784b6..771690b 100644 --- a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test05/result/TestEditor05_id_Context.java +++ b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test05/result/TestEditor05_id_Context.java @@ -5,6 +5,7 @@ import java.lang.Object; import java.lang.Override; import java.lang.String; +import java.lang.SuppressWarnings; import org.gwtproject.editor.client.Editor; import org.gwtproject.editor.client.impl.AbstractEditorContext; import org.gwtproject.editor.processor.common.Model01Dto; @@ -23,12 +24,14 @@ public boolean canSetInModel() { } @Override + @SuppressWarnings("unchecked") public Long checkAssignment(Object value) { return (Long) value; } @Override - public Class getEditedType() { + @SuppressWarnings("unchecked") + public Class getEditedType() { return java.lang.Long.class; } diff --git a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test05/result/TestEditor05_name_Context.java b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test05/result/TestEditor05_name_Context.java index 29f9568..ee74c91 100644 --- a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test05/result/TestEditor05_name_Context.java +++ b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test05/result/TestEditor05_name_Context.java @@ -4,6 +4,7 @@ import java.lang.Object; import java.lang.Override; import java.lang.String; +import java.lang.SuppressWarnings; import org.gwtproject.editor.client.Editor; import org.gwtproject.editor.client.impl.AbstractEditorContext; import org.gwtproject.editor.processor.common.Model01Dto; @@ -22,12 +23,14 @@ public boolean canSetInModel() { } @Override + @SuppressWarnings("unchecked") public String checkAssignment(Object value) { return (String) value; } @Override - public Class getEditedType() { + @SuppressWarnings("unchecked") + public Class getEditedType() { return java.lang.String.class; } diff --git a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test05/result/TestEditor05_phone_Context.java b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test05/result/TestEditor05_phone_Context.java index 9882284..6896361 100644 --- a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test05/result/TestEditor05_phone_Context.java +++ b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test05/result/TestEditor05_phone_Context.java @@ -4,6 +4,7 @@ import java.lang.Object; import java.lang.Override; import java.lang.String; +import java.lang.SuppressWarnings; import org.gwtproject.editor.client.Editor; import org.gwtproject.editor.client.impl.AbstractEditorContext; import org.gwtproject.editor.processor.common.Model01Dto; @@ -22,12 +23,14 @@ public boolean canSetInModel() { } @Override + @SuppressWarnings("unchecked") public String checkAssignment(Object value) { return (String) value; } @Override - public Class getEditedType() { + @SuppressWarnings("unchecked") + public Class getEditedType() { return java.lang.String.class; } diff --git a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test06/result/TestEditor06_email_Context.java b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test06/result/TestEditor06_email_Context.java index afc448e..c1d14c3 100644 --- a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test06/result/TestEditor06_email_Context.java +++ b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test06/result/TestEditor06_email_Context.java @@ -1,43 +1,38 @@ package org.gwtproject.editor.processor.test06; - import java.lang.Class; import java.lang.Object; import java.lang.Override; import java.lang.String; +import java.lang.SuppressWarnings; import org.gwtproject.editor.client.Editor; import org.gwtproject.editor.client.impl.AbstractEditorContext; import org.gwtproject.editor.processor.common.BadModel01Dto; - public class TestEditor06_email_Context extends AbstractEditorContext { private final BadModel01Dto parent; - public TestEditor06_email_Context(BadModel01Dto parent, Editor editor, String path) { super(editor, path); this.parent = parent; } - @Override public boolean canSetInModel() { return parent != null && false && true; } - @Override + @SuppressWarnings("unchecked") public String checkAssignment(Object value) { return (String) value; } - @Override - public Class getEditedType() { + @SuppressWarnings("unchecked") + public Class getEditedType() { return java.lang.String.class; } - @Override public String getFromModel() { return (parent != null && true) ? parent.getEmail() : null; } - @Override public void setInModel(String data) { throw new UnsupportedOperationException(); } -} +} \ No newline at end of file diff --git a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test07/result/TestEditor07_Driver_Impl.java b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test07/result/TestEditor07_Driver_Impl.java index 30eecd6..dc76216 100644 --- a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test07/result/TestEditor07_Driver_Impl.java +++ b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test07/result/TestEditor07_Driver_Impl.java @@ -1,22 +1,21 @@ package org.gwtproject.editor.processor.test07; - import java.lang.Override; import java.lang.String; +import java.lang.SuppressWarnings; import org.gwtproject.editor.client.EditorVisitor; import org.gwtproject.editor.client.impl.AbstractSimpleBeanEditorDriver; import org.gwtproject.editor.client.impl.RootEditorContext; import org.gwtproject.editor.client.impl.SimpleBeanEditorDelegate; import org.gwtproject.editor.processor.common.Model01Generic02Dto; - public class TestEditor07_Driver_Impl extends AbstractSimpleBeanEditorDriver, TestEditor07> implements TestEditor07.Driver { @Override + @SuppressWarnings("unchecked") public void accept(EditorVisitor visitor) { RootEditorContext> ctx = new RootEditorContext>(getDelegate(), (Class>)(Class)org.gwtproject.editor.processor.common.Model01Generic02Dto.class, getObject()); ctx.traverse(visitor, getDelegate()); } - @Override protected SimpleBeanEditorDelegate, TestEditor07> createDelegate() { return new TestEditor07_SimpleBeanEditorDelegate(); } -} +} \ No newline at end of file diff --git a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test07/result/TestEditor07_SimpleBeanEditorDelegate.java b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test07/result/TestEditor07_SimpleBeanEditorDelegate.java index 12de8f6..7fecde3 100644 --- a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test07/result/TestEditor07_SimpleBeanEditorDelegate.java +++ b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test07/result/TestEditor07_SimpleBeanEditorDelegate.java @@ -1,41 +1,31 @@ package org.gwtproject.editor.processor.test07; -import java.lang.Object; import java.lang.Override; import java.lang.String; -import org.gwtproject.editor.client.Editor; import org.gwtproject.editor.client.EditorVisitor; import org.gwtproject.editor.client.impl.SimpleBeanEditorDelegate; import org.gwtproject.editor.processor.common.Model01Generic02Dto; - -public class TestEditor07_SimpleBeanEditorDelegate extends SimpleBeanEditorDelegate { - +public class TestEditor07_SimpleBeanEditorDelegate extends SimpleBeanEditorDelegate, TestEditor07> { private TestEditor07 editor; private Model01Generic02Dto object; - @Override protected TestEditor07 getEditor() { return editor; } - @Override - protected void setEditor(Editor editor) { - this.editor = (TestEditor07) editor; + protected void setEditor(TestEditor07 editor) { + this.editor = editor; } - @Override public Model01Generic02Dto getObject() { return object; } - @Override - protected void setObject(Object object) { - this.object = (Model01Generic02Dto) object; + protected void setObject(Model01Generic02Dto object) { + this.object = object; } - @Override protected void initializeSubDelegates() { } - @Override public void accept(EditorVisitor visitor) { { @@ -55,4 +45,4 @@ public void accept(EditorVisitor visitor) { ctx.traverse(visitor, null); } } -} +} \ No newline at end of file diff --git a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test07/result/TestEditor07_email_Context.java b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test07/result/TestEditor07_email_Context.java index 0550534..17c4b77 100644 --- a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test07/result/TestEditor07_email_Context.java +++ b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test07/result/TestEditor07_email_Context.java @@ -1,44 +1,39 @@ package org.gwtproject.editor.processor.test07; - import java.lang.Class; import java.lang.Object; import java.lang.Override; import java.lang.String; +import java.lang.SuppressWarnings; import org.gwtproject.editor.client.Editor; import org.gwtproject.editor.client.impl.AbstractEditorContext; import org.gwtproject.editor.processor.common.Model01Generic02Dto; - public class TestEditor07_email_Context extends AbstractEditorContext { private final Model01Generic02Dto parent; - public TestEditor07_email_Context(Model01Generic02Dto parent, Editor editor, String path) { super(editor, path); this.parent = parent; } - @Override public boolean canSetInModel() { return parent != null && true && true; } - @Override + @SuppressWarnings("unchecked") public String checkAssignment(Object value) { return (String) value; } - @Override - public Class getEditedType() { + @SuppressWarnings("unchecked") + public Class getEditedType() { return java.lang.String.class; } - @Override public String getFromModel() { return (parent != null && true) ? parent.getEmail() : null; } - @Override public void setInModel(String data) { parent.setEmail(data); } -} +} \ No newline at end of file diff --git a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test07/result/TestEditor07_id_Context.java b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test07/result/TestEditor07_id_Context.java index 3690a04..8ec25ee 100644 --- a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test07/result/TestEditor07_id_Context.java +++ b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test07/result/TestEditor07_id_Context.java @@ -5,6 +5,7 @@ import java.lang.Object; import java.lang.Override; import java.lang.String; +import java.lang.SuppressWarnings; import org.gwtproject.editor.client.Editor; import org.gwtproject.editor.client.impl.AbstractEditorContext; import org.gwtproject.editor.processor.common.Model01Generic02Dto; @@ -23,12 +24,14 @@ public boolean canSetInModel() { } @Override() + @SuppressWarnings("unchecked") public Long checkAssignment(Object value) { return (Long)value; } @Override() - public Class getEditedType() { + @SuppressWarnings("unchecked") + public Class getEditedType() { return java.lang.Long.class; } diff --git a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test07/result/TestEditor07_name_Context.java b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test07/result/TestEditor07_name_Context.java index a541a25..40a0da4 100644 --- a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test07/result/TestEditor07_name_Context.java +++ b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test07/result/TestEditor07_name_Context.java @@ -1,44 +1,39 @@ package org.gwtproject.editor.processor.test07; - import java.lang.Class; import java.lang.Object; import java.lang.Override; import java.lang.String; +import java.lang.SuppressWarnings; import org.gwtproject.editor.client.Editor; import org.gwtproject.editor.client.impl.AbstractEditorContext; import org.gwtproject.editor.processor.common.Model01Generic02Dto; - public class TestEditor07_name_Context extends AbstractEditorContext { private final Model01Generic02Dto parent; - public TestEditor07_name_Context(Model01Generic02Dto parent, Editor editor, - String path) { + String path) { super(editor, path); this.parent = parent; } - @Override public boolean canSetInModel() { return parent != null && true && true; } - @Override + @SuppressWarnings("unchecked") public String checkAssignment(Object value) { return (String) value; } - @Override - public Class getEditedType() { + @SuppressWarnings("unchecked") + public Class getEditedType() { return java.lang.String.class; } - @Override public String getFromModel() { return (parent != null && true) ? parent.getName() : null; } - @Override public void setInModel(String data) { parent.setName(data); } -} +} \ No newline at end of file diff --git a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test07/result/TestEditor07_phone_Context.java b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test07/result/TestEditor07_phone_Context.java index 2249300..e367fba 100644 --- a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test07/result/TestEditor07_phone_Context.java +++ b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test07/result/TestEditor07_phone_Context.java @@ -4,6 +4,7 @@ import java.lang.Object; import java.lang.Override; import java.lang.String; +import java.lang.SuppressWarnings; import org.gwtproject.editor.client.Editor; import org.gwtproject.editor.client.impl.AbstractEditorContext; import org.gwtproject.editor.processor.common.Model01Generic02Dto; @@ -23,12 +24,14 @@ public boolean canSetInModel() { } @Override + @SuppressWarnings("unchecked") public String checkAssignment(Object value) { return (String) value; } @Override - public Class getEditedType() { + @SuppressWarnings("unchecked") + public Class getEditedType() { return java.lang.String.class; } diff --git a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test08/result/TestEditor08_Driver_Impl.java b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test08/result/TestEditor08_Driver_Impl.java index 30726c1..5311682 100644 --- a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test08/result/TestEditor08_Driver_Impl.java +++ b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test08/result/TestEditor08_Driver_Impl.java @@ -1,6 +1,7 @@ package org.gwtproject.editor.processor.test08; import java.lang.Override; +import java.lang.SuppressWarnings; import org.gwtproject.editor.client.EditorVisitor; import org.gwtproject.editor.client.impl.AbstractSimpleBeanEditorDriver; import org.gwtproject.editor.client.impl.RootEditorContext; @@ -9,6 +10,7 @@ public class TestEditor08_Driver_Impl extends AbstractSimpleBeanEditorDriver implements TestEditor08.Driver { @Override + @SuppressWarnings("unchecked") public void accept(EditorVisitor visitor) { RootEditorContext ctx = new RootEditorContext(getDelegate(), (Class)(Class)org.gwtproject.editor.processor.common.Model01Dto.class, getObject()); ctx.traverse(visitor, getDelegate()); diff --git a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test08/result/TestEditor08_SimpleBeanEditorDelegate.java b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test08/result/TestEditor08_SimpleBeanEditorDelegate.java index bec3258..dbe9387 100644 --- a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test08/result/TestEditor08_SimpleBeanEditorDelegate.java +++ b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test08/result/TestEditor08_SimpleBeanEditorDelegate.java @@ -1,34 +1,35 @@ package org.gwtproject.editor.processor.test08; -import java.lang.Object; +import java.lang.Long; import java.lang.Override; -import org.gwtproject.editor.client.Editor; +import java.lang.String; import org.gwtproject.editor.client.EditorVisitor; import org.gwtproject.editor.client.impl.SimpleBeanEditorDelegate; +import org.gwtproject.editor.client.testing.FakeLeafValueEditorWithHasEditorDelegate; import org.gwtproject.editor.client.testing.FakeLeafValueEditorWithHasEditorDelegate_Long_SimpleBeanEditorDelegate; import org.gwtproject.editor.client.testing.FakeLeafValueEditorWithHasEditorDelegate_String_SimpleBeanEditorDelegate; import org.gwtproject.editor.processor.common.Model01Dto; -public class TestEditor08_SimpleBeanEditorDelegate extends SimpleBeanEditorDelegate { +public class TestEditor08_SimpleBeanEditorDelegate extends SimpleBeanEditorDelegate { private TestEditor08 editor; private Model01Dto object; - private SimpleBeanEditorDelegate idDelegate; - private SimpleBeanEditorDelegate nameDelegate; - private SimpleBeanEditorDelegate phoneDelegate; - private SimpleBeanEditorDelegate emailDelegate; + private SimpleBeanEditorDelegate> idDelegate; + private SimpleBeanEditorDelegate> nameDelegate; + private SimpleBeanEditorDelegate> phoneDelegate; + private SimpleBeanEditorDelegate> emailDelegate; @Override protected TestEditor08 getEditor() { return editor; } @Override - protected void setEditor(Editor editor) { - this.editor = (TestEditor08) editor; + protected void setEditor(TestEditor08 editor) { + this.editor = editor; } @Override public Model01Dto getObject() { return object; } @Override - protected void setObject(Object object) { - this.object = (Model01Dto) object; + protected void setObject(Model01Dto object) { + this.object = object; } @Override protected void initializeSubDelegates() { @@ -71,5 +72,4 @@ public void accept(EditorVisitor visitor) { ctx.setEditorDelegate(emailDelegate); ctx.traverse(visitor, emailDelegate); } - } -} + } \ No newline at end of file diff --git a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test08/result/TestEditor08_email_Context.java b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test08/result/TestEditor08_email_Context.java index fb2f570..702a263 100644 --- a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test08/result/TestEditor08_email_Context.java +++ b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test08/result/TestEditor08_email_Context.java @@ -1,43 +1,38 @@ package org.gwtproject.editor.processor.test08; - import java.lang.Class; import java.lang.Object; import java.lang.Override; import java.lang.String; +import java.lang.SuppressWarnings; import org.gwtproject.editor.client.Editor; import org.gwtproject.editor.client.impl.AbstractEditorContext; import org.gwtproject.editor.processor.common.Model01Dto; - public class TestEditor08_email_Context extends AbstractEditorContext { private final Model01Dto parent; - public TestEditor08_email_Context(Model01Dto parent, Editor editor, String path) { super(editor, path); this.parent = parent; } - @Override public boolean canSetInModel() { return parent != null && true && true; } - @Override + @SuppressWarnings("unchecked") public String checkAssignment(Object value) { return (String) value; } - @Override - public Class getEditedType() { + @SuppressWarnings("unchecked") + public Class getEditedType() { return java.lang.String.class; } - @Override public String getFromModel() { return (parent != null && true) ? parent.getEmail() : null; } - @Override public void setInModel(String data) { parent.setEmail(data); } -} +} \ No newline at end of file diff --git a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test08/result/TestEditor08_id_Context.java b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test08/result/TestEditor08_id_Context.java index 3ff50c5..753f385 100644 --- a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test08/result/TestEditor08_id_Context.java +++ b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test08/result/TestEditor08_id_Context.java @@ -5,6 +5,7 @@ import java.lang.Object; import java.lang.Override; import java.lang.String; +import java.lang.SuppressWarnings; import org.gwtproject.editor.client.Editor; import org.gwtproject.editor.client.impl.AbstractEditorContext; import org.gwtproject.editor.processor.common.Model01Dto; @@ -23,12 +24,14 @@ public boolean canSetInModel() { } @Override + @SuppressWarnings("unchecked") public Long checkAssignment(Object value) { return (Long) value; } @Override - public Class getEditedType() { + @SuppressWarnings("unchecked") + public Class getEditedType() { return java.lang.Long.class; } diff --git a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test08/result/TestEditor08_name_Context.java b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test08/result/TestEditor08_name_Context.java index 43140ab..09222c1 100644 --- a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test08/result/TestEditor08_name_Context.java +++ b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test08/result/TestEditor08_name_Context.java @@ -4,6 +4,7 @@ import java.lang.Object; import java.lang.Override; import java.lang.String; +import java.lang.SuppressWarnings; import org.gwtproject.editor.client.Editor; import org.gwtproject.editor.client.impl.AbstractEditorContext; import org.gwtproject.editor.processor.common.Model01Dto; @@ -22,12 +23,14 @@ public boolean canSetInModel() { } @Override + @SuppressWarnings("unchecked") public String checkAssignment(Object value) { return (String) value; } @Override - public Class getEditedType() { + @SuppressWarnings("unchecked") + public Class getEditedType() { return java.lang.String.class; } diff --git a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test08/result/TestEditor08_phone_Context.java b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test08/result/TestEditor08_phone_Context.java index 9784d83..90c6823 100644 --- a/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test08/result/TestEditor08_phone_Context.java +++ b/gwt-editor-processor/src/test/resources/org/gwtproject/editor/processor/test08/result/TestEditor08_phone_Context.java @@ -4,6 +4,7 @@ import java.lang.Object; import java.lang.Override; import java.lang.String; +import java.lang.SuppressWarnings; import org.gwtproject.editor.client.Editor; import org.gwtproject.editor.client.impl.AbstractEditorContext; import org.gwtproject.editor.processor.common.Model01Dto; @@ -22,12 +23,14 @@ public boolean canSetInModel() { } @Override + @SuppressWarnings("unchecked") public String checkAssignment(Object value) { return (String) value; } @Override - public Class getEditedType() { + @SuppressWarnings("unchecked") + public Class getEditedType() { return java.lang.String.class; } diff --git a/gwt-editor/src/main/java/org/gwtproject/editor/client/impl/Initializer.java b/gwt-editor/src/main/java/org/gwtproject/editor/client/impl/Initializer.java index 6c65072..af21fcb 100644 --- a/gwt-editor/src/main/java/org/gwtproject/editor/client/impl/Initializer.java +++ b/gwt-editor/src/main/java/org/gwtproject/editor/client/impl/Initializer.java @@ -24,12 +24,10 @@ * Extends the logic in Refresher to provide the editor instance with references to framework * plumbing fixes. */ -@SuppressWarnings("rawtypes") public class Initializer extends Refresher { @Override public boolean visit(EditorContext ctx) { - @SuppressWarnings("unchecked") AbstractEditorDelegate delegate = (AbstractEditorDelegate) ctx.getEditorDelegate(); // Pass in the EditorDelegate @@ -42,7 +40,6 @@ public boolean visit(EditorContext ctx) { CompositeEditor asComposite = ctx.asCompositeEditor(); if (asComposite != null) { // Various javac generics compilation problems here - @SuppressWarnings("rawtypes") EditorChain chain = delegate.getEditorChain(); asComposite.setEditorChain(chain); } From 7aabe64828950b4319fddf10e8daae5ad1d58a74 Mon Sep 17 00:00:00 2001 From: Frank Hossfeld Date: Wed, 13 Mar 2024 10:07:19 +0100 Subject: [PATCH 3/5] improve error message in case a getter is not found --- .../editor/processor/model/EditorModel.java | 8 ++++---- .../processor/model/EditorProperty.java | 19 +++++++++++++++---- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/gwt-editor-processor/src/main/java/org/gwtproject/editor/processor/model/EditorModel.java b/gwt-editor-processor/src/main/java/org/gwtproject/editor/processor/model/EditorModel.java index 10bc1f4..e94e9b4 100644 --- a/gwt-editor-processor/src/main/java/org/gwtproject/editor/processor/model/EditorModel.java +++ b/gwt-editor-processor/src/main/java/org/gwtproject/editor/processor/model/EditorModel.java @@ -111,7 +111,7 @@ private List calculateEditorData() { TypeMirror fieldClassType = field.asType(); if (shouldExamine(fieldClassType)) { List data = - new EditorProperty.Builder(editorTypes, dataType) + new EditorProperty.Builder(editorTypes, dataType, editorType) .access(field) .build(Optional.ofNullable(editorSoFar)); accumulateEditorData(data, flatData, toReturn); @@ -145,7 +145,7 @@ private List calculateEditorData() { } List data = - new EditorProperty.Builder(editorTypes, dataType) + new EditorProperty.Builder(editorTypes, dataType, editorType) .access(method) .build(Optional.ofNullable(editorSoFar)); accumulateEditorData(data, flatData, toReturn); @@ -162,7 +162,7 @@ private List calculateEditorData() { .get(2); EditorProperty subEditor = - new EditorProperty.Builder(editorTypes, dataType) + new EditorProperty.Builder(editorTypes, dataType, editorType) .root(subEditorType) .build(Optional.ofNullable(editorSoFar)) .get(0); // doesn't matter which instance, there must be at least one @@ -266,7 +266,7 @@ public List getEditorData(TypeMirror editor) { } public EditorProperty getRootData() { - return new EditorProperty.Builder(editorTypes, dataType) + return new EditorProperty.Builder(editorTypes, dataType, editorType) .root(getEditorType()) .build(Optional.empty()) .get(0); diff --git a/gwt-editor-processor/src/main/java/org/gwtproject/editor/processor/model/EditorProperty.java b/gwt-editor-processor/src/main/java/org/gwtproject/editor/processor/model/EditorProperty.java index afeb0c9..9bae1f6 100644 --- a/gwt-editor-processor/src/main/java/org/gwtproject/editor/processor/model/EditorProperty.java +++ b/gwt-editor-processor/src/main/java/org/gwtproject/editor/processor/model/EditorProperty.java @@ -17,6 +17,7 @@ import com.google.auto.common.MoreElements; import java.util.List; +import java.util.Objects; import java.util.Optional; import java.util.function.Consumer; import java.util.regex.Pattern; @@ -43,10 +44,12 @@ public static class Builder { private Stream.Builder builder = Stream.builder(); private Stream stream; + private TypeMirror editorType; - public Builder(EditorTypes types, TypeMirror dataType) { + public Builder(EditorTypes types, TypeMirror dataType, TypeMirror editorType) { this.types = types; this.dataType = dataType; + this.editorType = editorType; } public Builder root(TypeMirror type) { @@ -237,8 +240,16 @@ private void findBeanPropertyMethods(String path, TypeMirror propertyType) { if (!foundGetterForPart) { // poison(noGetterMessage(path, proxyType)); // return; - throw new IllegalStateException( - "generation aborted! No getter exists for >>" + path + "<<"); + String message = + "gwt-editor ==> generation aborted! No getter exists for >>" + + path + + "<< of owner >>" + + owner.toString() + + "<<"; + if (Objects.nonNull(this.editorType)) { + message += " in editor >>" + this.editorType + "<<"; + } + throw new IllegalStateException(message); } } @@ -308,7 +319,7 @@ public List build(Optional parent) { property.editorType) .get(2); property.composedData = - new Builder(types, dataType) + new Builder(types, dataType, editorType) .root(subEditorType) .build(Optional.of(property)) .get(0); From a2fe7ca6656124bcb5878f5414fe2a9c54a73748 Mon Sep 17 00:00:00 2001 From: Frank Hossfeld Date: Wed, 13 Mar 2024 10:07:58 +0100 Subject: [PATCH 4/5] udpate versions --- gwt-editor-gwt2-tests/pom.xml | 8 ++++---- gwt-editor/pom.xml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gwt-editor-gwt2-tests/pom.xml b/gwt-editor-gwt2-tests/pom.xml index 406331e..d474217 100644 --- a/gwt-editor-gwt2-tests/pom.xml +++ b/gwt-editor-gwt2-tests/pom.xml @@ -16,21 +16,21 @@ Test cases for the GWT 2 tests - 1.0.0 + 1.1.0 - 2.10.0 + 2.11.0 4.13.1 - com.google.gwt + org.gwtproject gwt-user ${gwt.version} test - com.google.gwt + org.gwtproject gwt-dev ${gwt.version} test diff --git a/gwt-editor/pom.xml b/gwt-editor/pom.xml index ca1610b..de7dd23 100644 --- a/gwt-editor/pom.xml +++ b/gwt-editor/pom.xml @@ -47,7 +47,7 @@ 2018 - 1.0.0 + 1.1.0 1.0.0-RC1 From 6ccac1f83aca10ca820a6e423ac342964980e581 Mon Sep 17 00:00:00 2001 From: Frank Hossfeld Date: Fri, 8 Nov 2024 11:23:18 +0100 Subject: [PATCH 5/5] udpate versions --- .../validation/client/impl/ConstraintViolationImpl.java | 2 +- gwt-editor-processor/pom.xml | 4 ++-- pom.xml | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gwt-editor-j2cl-tests/src/test/java/org/gwtproject/validation/client/impl/ConstraintViolationImpl.java b/gwt-editor-j2cl-tests/src/test/java/org/gwtproject/validation/client/impl/ConstraintViolationImpl.java index 37305a4..bf2bfbd 100644 --- a/gwt-editor-j2cl-tests/src/test/java/org/gwtproject/validation/client/impl/ConstraintViolationImpl.java +++ b/gwt-editor-j2cl-tests/src/test/java/org/gwtproject/validation/client/impl/ConstraintViolationImpl.java @@ -65,7 +65,7 @@ public boolean equals(Object o) { } else if (!(o instanceof ConstraintViolationImpl)) { return false; } else { - ConstraintViolationImpl other = (ConstraintViolationImpl) o; + ConstraintViolationImpl other = (ConstraintViolationImpl) o; return Objects.equals(this.message, other.message) && Objects.equals(this.propertyPath, other.propertyPath) && Objects.equals(this.rootBean, other.rootBean) diff --git a/gwt-editor-processor/pom.xml b/gwt-editor-processor/pom.xml index 99a381a..d2fa2f8 100644 --- a/gwt-editor-processor/pom.xml +++ b/gwt-editor-processor/pom.xml @@ -46,8 +46,8 @@ UTF-8 - 1.8 - 1.8 + 11 + 11 1.1 1.0 diff --git a/pom.xml b/pom.xml index d5ea77f..661d258 100644 --- a/pom.xml +++ b/pom.xml @@ -54,8 +54,8 @@ UTF-8 - 1.8 - 1.8 + 11 + 11 3.8.1 3.0.0-M1