From 55d9f1f4592ea8f9b7ee5733c1ea5f9b24534aaa Mon Sep 17 00:00:00 2001 From: Manfred Tremmel Date: Tue, 10 Dec 2024 15:37:56 +0100 Subject: [PATCH] update to new gin version and jakarta namespace - also updated dependencies - using gwt 2.12.1 - java 11 as compile target - new checkstyle version and included configuration --- .gitignore | 2 + .../codequality/checkstyle.xml | 150 ++++++++++++++++++ .../codequality/opensource.java.header | 15 ++ .../codequality/suppressions.xml | 15 ++ dispatch-rest-delegates/pom.xml | 36 ++--- .../delegates/client/ResourceDelegate.java | 16 +- .../processors/DelegateProcessor.java | 4 +- .../test/AbstractDelegateStubber.java | 2 +- .../rest/delegates/test/DelegateMocking.java | 2 +- .../delegates/test/DelegateTestUtils.java | 4 +- .../rest/delegates/ResourceDelegate.gwt.xml | 4 +- .../rest/delegates/processors/Delegate.vm | 2 +- ginuibinder/pom.xml | 31 +++- .../gwt/uibinder/rebind/FieldManager.java | 20 ++- .../uibinder/rebind/GinUiBinderGenerator.java | 2 +- 15 files changed, 251 insertions(+), 54 deletions(-) create mode 100644 dispatch-rest-delegates/codequality/checkstyle.xml create mode 100644 dispatch-rest-delegates/codequality/opensource.java.header create mode 100644 dispatch-rest-delegates/codequality/suppressions.xml diff --git a/.gitignore b/.gitignore index 2a75796..b39dca1 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,5 @@ META-INF .checkstyle chromedriver.log *.versionsBackup +.factorypath + diff --git a/dispatch-rest-delegates/codequality/checkstyle.xml b/dispatch-rest-delegates/codequality/checkstyle.xml new file mode 100644 index 0000000..b937aa8 --- /dev/null +++ b/dispatch-rest-delegates/codequality/checkstyle.xml @@ -0,0 +1,150 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dispatch-rest-delegates/codequality/opensource.java.header b/dispatch-rest-delegates/codequality/opensource.java.header new file mode 100644 index 0000000..7467547 --- /dev/null +++ b/dispatch-rest-delegates/codequality/opensource.java.header @@ -0,0 +1,15 @@ +/\*\*? + \* Copyright \d{4} ArcBees Inc\. + \* + \* Licensed under the Apache License, Version 2\.0 \(the "License"\); you may not + \* use this file except in compliance with the License\. You may obtain a copy of + \* the License at + \* + \* http://www\.apache\.org/licenses/LICENSE-2\.0 + \* + \* Unless required by applicable law or agreed to in writing, software + \* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + \* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\. See the + \* License for the specific language governing permissions and limitations under + \* the License\. + \*/ diff --git a/dispatch-rest-delegates/codequality/suppressions.xml b/dispatch-rest-delegates/codequality/suppressions.xml new file mode 100644 index 0000000..8e6d283 --- /dev/null +++ b/dispatch-rest-delegates/codequality/suppressions.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + diff --git a/dispatch-rest-delegates/pom.xml b/dispatch-rest-delegates/pom.xml index 2e28927..d8ed64e 100644 --- a/dispatch-rest-delegates/pom.xml +++ b/dispatch-rest-delegates/pom.xml @@ -20,18 +20,17 @@ 2.0-SNAPSHOT - 2.8.0 - 1.0-rc2 - 1.10.8 - 4.12 - - 3.5.1 - 2.15 - 6.12 - 1.2 - 2.10.3 - - 1.8 + 2.12.1 + 1.1.1 + 4.11.0 + 4.13.2 + + 3.13.0 + 3.6.0 + 10.20.1 + 3.11.1 + + 11 UTF-8 UTF-8 @@ -78,12 +77,12 @@ ${gwtp.version} - com.google.gwt + org.gwtproject gwt-user ${gwt.version} - com.google.gwt + org.gwtproject gwt-dev ${gwt.version} @@ -146,8 +145,8 @@ ${maven-checkstyle-plugin.version} - /checkstyle.xml - /suppressions.xml + /codequality/checkstyle.xml + /codequality/suppressions.xml basedir=${basedir} true true @@ -161,11 +160,6 @@ checkstyle ${checkstyle.version} - - com.arcbees - checkstyle - ${arcbees-checkstyle.version} - diff --git a/dispatch-rest-delegates/src/main/java/com/gwtplatform/dispatch/rest/delegates/client/ResourceDelegate.java b/dispatch-rest-delegates/src/main/java/com/gwtplatform/dispatch/rest/delegates/client/ResourceDelegate.java index 05fb422..3a84cde 100644 --- a/dispatch-rest-delegates/src/main/java/com/gwtplatform/dispatch/rest/delegates/client/ResourceDelegate.java +++ b/dispatch-rest-delegates/src/main/java/com/gwtplatform/dispatch/rest/delegates/client/ResourceDelegate.java @@ -28,35 +28,35 @@ * interface and {@link com.gwtplatform.dispatch.rest.client.RestDispatch} to simplify your code. Note that if your * resource interfaces don't return {@link com.gwtplatform.dispatch.rest.shared.RestAction RestAction<?>}s but the * result type directly, you will need to inject a {@link ResourceDelegate} to use your resource. - *

+ *

* This delegate will not send the HTTP request until you call a method, that is not a sub-resource, from the underlying * resource. The underlying resource is returned when either {@link #withoutCallback()} or {@link - * #withCallback(RestCallback)} are called. - *

+ * #withCallback(AsyncCallback)} are called. + *

* The following example shows how to retrieve the {@link DispatchRequest} and delete a potential car: *


  * {@literal @}Path("/cars")
  * public interface CarsResource {
  *      CarResource car(int id);
  * }
- * 

+ * * public interface CarResource { * {@literal @}DELETE * void delete(); * } - *

+ * * public class CarPresenter { * private final ResourceDelegate<CarsResource> carsResourceDelegate; - *

+ * * {@literal @}Inject * CarPresenter(ResourceDelegate<CarsResource> carsResourceDelegate) { * this.carsResourceDelegate = carsResourceDelegate; * } - *

+ * * {@literal @}Override * public void onReveal() { * DelegatingDispatchRequest dispatchRequest = new DelegatingDispatchRequest(); - *

+ * * carsResourceDelegate * .withDelegatingDispatchRequest(dispatchRequest) * .withCallback(new AsyncCallback<Void>() {/{@literal * snip *}/}); diff --git a/dispatch-rest-delegates/src/main/java/com/gwtplatform/dispatch/rest/delegates/processors/DelegateProcessor.java b/dispatch-rest-delegates/src/main/java/com/gwtplatform/dispatch/rest/delegates/processors/DelegateProcessor.java index fd33c60..415da16 100644 --- a/dispatch-rest-delegates/src/main/java/com/gwtplatform/dispatch/rest/delegates/processors/DelegateProcessor.java +++ b/dispatch-rest-delegates/src/main/java/com/gwtplatform/dispatch/rest/delegates/processors/DelegateProcessor.java @@ -21,8 +21,6 @@ import java.util.List; import java.util.Set; -import javax.inject.Singleton; - import com.gwtplatform.dispatch.rest.delegates.client.ResourceDelegate; import com.gwtplatform.dispatch.rest.delegates.processors.methods.DelegateMethodProcessors; import com.gwtplatform.processors.tools.AbstractContextProcessor; @@ -34,6 +32,8 @@ import com.gwtplatform.processors.tools.outputter.Outputter; import com.gwtplatform.processors.tools.utils.Utils; +import jakarta.inject.Singleton; + import static com.gwtplatform.dispatch.rest.processors.NameUtils.findRestModuleType; import static com.gwtplatform.processors.tools.bindings.BindingContext.newBinding; diff --git a/dispatch-rest-delegates/src/main/java/com/gwtplatform/dispatch/rest/delegates/test/AbstractDelegateStubber.java b/dispatch-rest-delegates/src/main/java/com/gwtplatform/dispatch/rest/delegates/test/AbstractDelegateStubber.java index 1923c27..48ed363 100644 --- a/dispatch-rest-delegates/src/main/java/com/gwtplatform/dispatch/rest/delegates/test/AbstractDelegateStubber.java +++ b/dispatch-rest-delegates/src/main/java/com/gwtplatform/dispatch/rest/delegates/test/AbstractDelegateStubber.java @@ -70,7 +70,7 @@ public S withResponse(Response response) { /** * This is similar than calling {@link #withResponse(Response)}. Instead, a mock of {@link Response} is created and * configured to return status. - *

+ *

* If {@link #withResponse(Response)} was previously called, the previously configured {@link Response} will be * overwritten. * diff --git a/dispatch-rest-delegates/src/main/java/com/gwtplatform/dispatch/rest/delegates/test/DelegateMocking.java b/dispatch-rest-delegates/src/main/java/com/gwtplatform/dispatch/rest/delegates/test/DelegateMocking.java index b5dd85f..b49fb85 100644 --- a/dispatch-rest-delegates/src/main/java/com/gwtplatform/dispatch/rest/delegates/test/DelegateMocking.java +++ b/dispatch-rest-delegates/src/main/java/com/gwtplatform/dispatch/rest/delegates/test/DelegateMocking.java @@ -132,7 +132,7 @@ RestCallback getCallback() { if (callback == null) { callback = new RestCallbackWrapper( captorValueOrDefault(successCaptor, (o, r) -> { }), - captorValueOrDefault(alwaysCaptor, (r) -> { }), + captorValueOrDefault(alwaysCaptor, r -> { }), captorValueOrDefault(failureCaptor, (t, r) -> { })); } diff --git a/dispatch-rest-delegates/src/main/java/com/gwtplatform/dispatch/rest/delegates/test/DelegateTestUtils.java b/dispatch-rest-delegates/src/main/java/com/gwtplatform/dispatch/rest/delegates/test/DelegateTestUtils.java index e5f98e2..959ff57 100644 --- a/dispatch-rest-delegates/src/main/java/com/gwtplatform/dispatch/rest/delegates/test/DelegateTestUtils.java +++ b/dispatch-rest-delegates/src/main/java/com/gwtplatform/dispatch/rest/delegates/test/DelegateTestUtils.java @@ -24,9 +24,9 @@ /** * Utility methods to help mocking {@link com.gwtplatform.dispatch.rest.delegates.client.ResourceDelegate}s. - *

+ *

* Important:

  • {@link #init()} must be called before each test. Not doing it may cause unexpected - * results. Using JUnit's {@link org.junit.Before @Before} is perfect for that.
  • {@link + * results. Using JUnit's org.junit.Before is perfect for that.
  • {@link * DelegateMocking#useResource(Object) useResource(Object)} must be called before any other methods exactly once * and before any other methods for the delegate is called. Assertion errors will be thrown otherwise.
  • *
diff --git a/dispatch-rest-delegates/src/main/resources/com/gwtplatform/dispatch/rest/delegates/ResourceDelegate.gwt.xml b/dispatch-rest-delegates/src/main/resources/com/gwtplatform/dispatch/rest/delegates/ResourceDelegate.gwt.xml index 2a54bab..3d3e731 100644 --- a/dispatch-rest-delegates/src/main/resources/com/gwtplatform/dispatch/rest/delegates/ResourceDelegate.gwt.xml +++ b/dispatch-rest-delegates/src/main/resources/com/gwtplatform/dispatch/rest/delegates/ResourceDelegate.gwt.xml @@ -1,6 +1,6 @@ - + diff --git a/dispatch-rest-delegates/src/main/resources/com/gwtplatform/dispatch/rest/delegates/processors/Delegate.vm b/dispatch-rest-delegates/src/main/resources/com/gwtplatform/dispatch/rest/delegates/processors/Delegate.vm index fc9d454..50e3422 100644 --- a/dispatch-rest-delegates/src/main/resources/com/gwtplatform/dispatch/rest/delegates/processors/Delegate.vm +++ b/dispatch-rest-delegates/src/main/resources/com/gwtplatform/dispatch/rest/delegates/processors/Delegate.vm @@ -1,7 +1,7 @@ package $impl.packageName; import javax.annotation.Generated; -#if($isRootResource)import javax.inject.Inject;#end +#if($isRootResource)import jakarta.inject.Inject;#end import com.gwtplatform.dispatch.rest.client.RestDispatch; import com.gwtplatform.dispatch.rest.delegates.client.AbstractResourceDelegate; diff --git a/ginuibinder/pom.xml b/ginuibinder/pom.xml index 12ffa14..d9de8b1 100644 --- a/ginuibinder/pom.xml +++ b/ginuibinder/pom.xml @@ -18,25 +18,30 @@ http://arcbees.github.io/GWTP/ - 2.8.0 - 2.1.2 + 2.12.1 + HEAD-SNAPSHOT - 2.10.3 - + 3.13.0 + 3.11.1 + + 11 + UTF-8 + UTF-8 + - com.google.gwt + org.gwtproject gwt-user ${gwt.version} - com.google.gwt + org.gwtproject gwt-dev ${gwt.version} - com.google.gwt.inject + io.github.gwtplus.gin gin ${gin.version} @@ -57,6 +62,18 @@ + + org.apache.maven.plugins + maven-compiler-plugin + ${maven-compiler-plugin.version} + + + ${target.jdk} + ${target.jdk} + ${project.build.sourceEncoding} + + + org.apache.maven.plugins maven-javadoc-plugin diff --git a/ginuibinder/src/main/java/com/google/gwt/uibinder/rebind/FieldManager.java b/ginuibinder/src/main/java/com/google/gwt/uibinder/rebind/FieldManager.java index a1b35b0..b0b9b4c 100644 --- a/ginuibinder/src/main/java/com/google/gwt/uibinder/rebind/FieldManager.java +++ b/ginuibinder/src/main/java/com/google/gwt/uibinder/rebind/FieldManager.java @@ -133,8 +133,10 @@ public FieldManager(TypeOracle typeOracle, MortalLogger logger, boolean useLazyW /** * Converts the given field to its getter. Example: - *
  • myWidgetX = get_myWidgetX() - *
  • f_html1 = get_f_html1() + *
      + *
    • myWidgetX = get_myWidgetX()
    • + *
    • f_html1 = get_f_html1()
    • + *
    */ public String convertFieldToGetter(String fieldName) { // could this conversion can be moved to FieldWriter? @@ -221,8 +223,8 @@ public void push(XMLElement source, FieldWriter fieldWriter) { * When making a field we peek at the {@link #parsedFieldStack} to make sure * that the field that holds the widget currently being parsed will depended * upon the field being declared. This ensures, for example, that dom id - * fields (see {@link UiBinderWriter#declareDomIdHolder()}) used by an HTMLPanel - * will be declared before it is. + * fields (see {@link com.google.gwt.uibinder.rebind.UiBinderWriter#declareDomIdHolder(String)}) + * used by an HTMLPanel will be declared before it is. * * @param fieldWriterType the field writer type associated * @param fieldType the type of the new field @@ -257,8 +259,8 @@ public FieldWriter registerField(String type, String fieldName) * When making a field we peek at the {@link #parsedFieldStack} to make sure * that the field that holds the widget currently being parsed will depended * upon the field being declared. This ensures, for example, that dom id - * fields (see {@link UiBinderWriter#declareDomIdHolder()}) used by an HTMLPanel - * will be declared before it is. + * fields (see {@link com.google.gwt.uibinder.rebind.UiBinderWriter#declareDomIdHolder(String)}) + * used by an HTMLPanel will be declared before it is. * * @throws UnableToCompleteException on duplicate name * @return a new {@link FieldWriter} instance @@ -274,9 +276,11 @@ public FieldWriter registerFieldForGeneratedCssResource( * Register a new field for {@link com.google.gwt.uibinder.client.LazyDomElement} * types. LazyDomElement fields can only be associated with html elements. Example: * + *
      *
    • LazyDomElement<DivElement> -> <div>
    • *
    • LazyDomElement<Element> -> <div>
    • *
    • LazyDomElement<SpanElement> -> <span>
    • + *
    * * @param templateFieldType the html type to bind, eg, SpanElement, DivElement, etc * @param ownerField the field instance @@ -300,8 +304,8 @@ public FieldWriter registerFieldForLazyDomElement(JClassType templateFieldType, * When making a field we peek at the {@link #parsedFieldStack} to make sure * that the field that holds the widget currently being parsed will depended * upon the field being declared. This ensures, for example, that dom id - * fields (see {@link UiBinderWriter#declareDomIdHolder()}) used by an HTMLPanel - * will be declared before it is. + * fields (see {@link com.google.gwt.uibinder.rebind.UiBinderWriter#declareDomIdHolder(String)}) + * used by an HTMLPanel will be declared before it is. * * @param assignableType class or interface extened or implemented by this * type diff --git a/ginuibinder/src/main/java/com/google/gwt/uibinder/rebind/GinUiBinderGenerator.java b/ginuibinder/src/main/java/com/google/gwt/uibinder/rebind/GinUiBinderGenerator.java index c1d2f4b..871c0ac 100644 --- a/ginuibinder/src/main/java/com/google/gwt/uibinder/rebind/GinUiBinderGenerator.java +++ b/ginuibinder/src/main/java/com/google/gwt/uibinder/rebind/GinUiBinderGenerator.java @@ -30,7 +30,7 @@ * that allows fields to be instantiated using gin dependency * injection. Modifications are clearly indicated by * {@code MODIFICATION} comments. - *

    + *

    * To use this you need to use the following in your module file: *

     <inherits name="com.google.gwt.uibinder.GinUiBinder" />
    * instead of {@code com.google.gwt.uibinder.UiBinder}.